XC 10 - Tip #5: When the docs fails -NDepend
With a large software product like Sitecore with a huge code-base, it is difficult to get a good overview of how everything is connected together. Enter NDepend. NDepend is normally used to investigate code quality, but it is the best tool to get insights using the Dependency Graph explorer!
NDepend comes both with Visual Studio integration and with a stand-alone visual interface. I personally use the stand-alone interface (VisualNDepend.exe) because I'm not interested (with regard to getting insights) to analyze my own code.
NDepend allows you to create multiple projects, and in a project, you can select the assemblies to analyze.
I'm working on a Sitecore Commerce project that consists of two parts: The Commerce Engine solution and the Storefront solution. So what I did was create two NDepend projects:
- CommerceEngine - with the assemblies of my Sitecore.Commerce.Engine main project in the folder Sitecore.Commerce.Engine\bin\Debug\netcoreapp3.1.
- Storefront - with the assemblies of the XP website in the folder c:\inetpub\wwwroot\<XC10storefrontSite>\bin.
After the initial analysis of the assemblies, NDepend is really fast in showing code relationships. For example: where is the field ContactId used:
NDepend is very very powerful, and especially the Dependency Graph functionality is great for exploring a large codebase like Sitecore. See the video below for all the details:
I would like to thank Patrick Smacchia, developer of NDepend, for providing me a license of NDepend. You can download a 14 day trial from the NDepend website.