Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>To browse .NET code dependencies, you can use the capabilities of the tool NDepend. The tool proposes:</p> <ul> <li>a <a href="http://www.ndepend.com/docs/visual-studio-dependency-graph" rel="nofollow noreferrer">dependency graph</a> </li> <li>a <a href="http://www.ndepend.com/docs/dependency-structure-matrix-dsm" rel="nofollow noreferrer">dependency matrix</a>,</li> <li>and also some <a href="http://www.ndepend.com/docs/cqlinq-features#Dependencies" rel="nofollow noreferrer">C# LINQ queries</a> can be edited (or generated) to browse dependencies. </li> </ul> <p>For example such query can look like:</p> <pre><code>from m in Methods let depth = m.DepthOfIsUsing("NHibernate.NHibernateUtil.Entity(Type)") where depth &gt;= 0 &amp;&amp; m.IsUsing("System.IDisposable") orderby depth select new { m, depth } </code></pre> <p>And its result looks like: (notice the code metric <strong>depth</strong>, 1 is for direct callers, 2 for callers of direct callers...) (notice also the Export to Graph button to export the query result to a <a href="http://www.ndepend.com/docs/visual-studio-dependency-graph#Call" rel="nofollow noreferrer">Call Graph</a>)</p> <p><a href="https://i.stack.imgur.com/oAwfm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oAwfm.png" alt="NDepend dependencies browsing through C# LINQ query"></a></p> <p>The dependency graph looks like:</p> <p><a href="https://i.stack.imgur.com/8lMZ4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8lMZ4.jpg" alt="NDepend Dependency Graph"></a></p> <p>The dependency matrix looks like:</p> <p><a href="https://i.stack.imgur.com/uC54j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uC54j.png" alt="NDepend Dependency Matrix"></a></p> <p>The dependency matrix is <em>de-facto</em> less intuitive than the graph, but it is more suited to browse complex sections of code like:</p> <p><a href="https://i.stack.imgur.com/nUy4Z.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nUy4Z.jpg" alt="NDepend Matrix vs Graph"></a></p> <p><em>Disclaimer: I work for NDepend</em></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload