Questions tagged [ndepend]

NDepend is a static analysis tool for .NET managed code that focuses on code dependencies and quality.

NDepend is a static analysis tool for .NET managed code that provides extensive code metrics and dependency visualization using directed graphs and a dependency matrix. It also validates code architecture, design, and quality rules, integrates test-coverage analysis, and enables trend monitoring through codebase snapshot comparisons.

NDepend comes with many predefined code rules that users can supplement with custom rules written in Code Query Language (CQL). CQL is very similar to SQL, making codebase queries much like querying a relational database. The tool can also automatically check code rules during continuous integration.

References:

286 questions
7
votes
1 answer

NDepend: How to not display 'tier' assemblies in dependency graph?

I was able to do this in an earlier version of nDepend by going to tools->options and setting which assemblies would be part of the analysis (and ignore the rest). The latest version of the trial version of nDepend lets me set it, but it seems to…
7
votes
2 answers

How to restrict NDepend methods query on type attribute

I'm trying to get NDepend to identify long methods using a modified version of the standard "Methods too big" query. I don't want to report long methods that the developers have little control over, so I filter out generated code using the…
Brian Rasmussen
  • 114,645
  • 34
  • 221
  • 317
7
votes
1 answer

Find all uses of a method (including via interface) using NDepend

Using NDepend, how can I find all, direct and indirect, uses of a specific method or property? In particular, I need to find usages that occur via an interface somewhere along the use path. Thanks!
Joel in Gö
  • 7,460
  • 9
  • 47
  • 77
6
votes
2 answers

The VS 2010 Ultimate vs 3rd party utilities

From https://stackoverflow.com/questions/273858/software-worth-buying, https://stackoverflow.com/questions/143088/open-source-c-projects-that-have-high-code-quality and https://stackoverflow.com/questions/180939/net-must-have-development-tools, I…
prosseek
  • 182,215
  • 215
  • 566
  • 871
6
votes
1 answer

Why does list initialization with lambda causes high cyclomatic complexity?

Initialization of list with lambdas causes high IL cyclomatic complexity: why, and how remove this complexity? For example following code causes the static constructor of the class (which is actually compiler generated) to be very complex: 1 + the…
sthiers
  • 3,489
  • 5
  • 34
  • 47
6
votes
3 answers

NDepend - Several .NET assemblies have the name {MyAssembly} but they are different

I've just started using NDepend and am trying to analyse a solution. This warning appears when I add the solution's assemblies and it will not load any assemblies with the warning: Cant' load the assembly {MyAssembly}: Several .NET assemblies have…
David Neale
  • 16,498
  • 6
  • 59
  • 85
6
votes
1 answer

Can NDepend output code in all methods up the dependency tree for specific methods?

I’m looking to be able to integrate into our build process the ability to compare after each build against the prior build any code changes made on any dependencies for a list of specific methods. So, if I have two methods that access the database,…
David Penn
  • 61
  • 2
6
votes
1 answer

Can I tell NDepend to ignore a single result?

I'm running NDepend against my C# project in VS 2012. There is a particular "critical rule violation" that I have looked at and have decided that I want to leave as-is. I want to tell NDepend to ignore this one violation and NOT count it against…
JoeMjr2
  • 3,804
  • 4
  • 34
  • 62
5
votes
1 answer

NDepend CQL Query for missing IDisposable implementation

I realize that the query this question is looking for won't be enough to find every little problem with IDisposable implementations, but every early warning counts, so I'll take what I can get. I'd like to know if anyone has come up with a CQL query…
Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825
5
votes
0 answers

How to change "Potentially dead Methods" CQLinq to be useful in a WPF MVVM project

Just started NDepend on a WPF project. Changed the "potentially dead types" built-in query to include our System.Windows.Application derived class instead of the class called Program: // Potentially dead Types warnif count > 0 let…
wigy
  • 2,174
  • 19
  • 32
5
votes
1 answer

How do you ignore .NET assemblies in NDepend?

BACKGROUND As time goes by, I find myself more and more turning to NDepend to gain insight into the design/implementation of legacy applications. QUESTION Rather than adding JustMyCode to CQL queries, is there a way to permanently configure…
Pressacco
  • 2,815
  • 2
  • 26
  • 45
5
votes
3 answers

How do I check for missing scope.Complete() statements?

Programmers on my team sometimes open a transaction and forget to include the scope.Complete() statement (see code block below). Any ideas on ways to either Search our solution for missing scope.Complete() statements, or Have Visual Studio…
Ben Paul
  • 118
  • 1
  • 5
4
votes
1 answer

Solution-wide namespace dependency graph in NDepend

NDepend seems to be a great tool for code analysis, especially for dependency graph visualization, so we bought a copy. However, the one thing I really need most seems not to be possible: I need a namespace dependency graph over the whole solution.…
theDmi
  • 17,546
  • 6
  • 71
  • 138
4
votes
1 answer

How can NDepend be instructed to ignore EF classes?

I'm having a little problem with NDepend not ignoring generated code. It's picking up issues around methods with too many parameters on the designer.cs file generated by EF when the entity data model is created. The class is commented with an…
Troy Hunt
  • 20,345
  • 13
  • 96
  • 151
4
votes
1 answer

NDepend -Finding dead methods

I have two public methods A & B. I modified CQL to show me methods which are public and dead. If B is only called by A and A is coming as dead method(not called or referenced anywhere in the application) can NDepend show both the methods as dead by…
Anuradha
  • 41
  • 2
1
2
3
19 20