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
3
votes
3 answers

Does NDepend run on Mono/Linux?

I'd like to use NDepend at home for an open source project, but I can't find if it run on linux with mono 2.6.8. Any one have succesfully used it on a mono only machine?
Giacomo Tesio
  • 7,144
  • 3
  • 31
  • 48
3
votes
1 answer

How to lower IL nesting depth?

I am giving NDepend a try for 2 weeks now. I still couldn't really figure it out on how to lower ILNestingDepth. I have few methods left marked as "Methods too complex - critical". And as a fix method they suggest to seperate method into smaller…
Tolga Evcimen
  • 7,112
  • 11
  • 58
  • 91
3
votes
1 answer

NDepend Count, Average, etc.. reporting... aggregates. Possible? clean work arounds?

We have a huge code base, where methods with too many local variables alone returns 226 methods. I don't want this huge table being dumped into the xml output to clutter it up, and I'd like the top 10 if possible, but what I really want is the count…
Maslow
  • 18,464
  • 20
  • 106
  • 193
3
votes
1 answer

How can I find which property getters have side effects using NDepend?

A familiar problem using VisualStudio is the mysterious calling of property getters. If these have side effects (the most common being of the form if (foo == null) foo = new foo(); return foo; ), then the fact that the debugger Locals and Watch…
Joel in Gö
  • 7,460
  • 9
  • 47
  • 77
3
votes
1 answer

Can CQL be used to find methods that return `null`?

I want to find all methods that can explicitly return null. Is this possible in NDepend using CQL?
Steve Dunn
  • 21,044
  • 11
  • 62
  • 87
3
votes
1 answer

NDepend: Listing the attributes attached to a method, is it possible?

I am trying to use NDepend and its Linq based query language to generate some reports about the code's current state. I want to label some of my methods and classes with predefined "tags", for example the methods labeled with tag "Database" contains…
Ufuk Can Bicici
  • 3,589
  • 4
  • 28
  • 57
3
votes
2 answers

Setting up NCover for NUnit in FinalBuilder

Solved: Look at the bottom of this question for the working configuration I am attempting to set up NCover for usage in my FinalBuilder project, for a .NET 4.0 C# project, but my final coverage output file contains no coverage data. I am…
Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825
3
votes
0 answers

Cannot load NDepend project file

I am having troubles running NDepend from a NAnt task on a TeamCity build machine. Here is the error I am getting: [exec] ERROR: The NDepend project file {D:\TeamCity\buildAgent\work\f5b78bbd49510fb2\myproject.ndproj} can't be loaded. [exec]…
3
votes
2 answers

Finding magic numbers using NDepend

Does anyone know how I could find magic numbers in the source code using the CQL queries in NDepend? This is the same problem as this question, but I don't want to use regex if possible. So I want to find all statements like Int32 someValue =…
Joel in Gö
  • 7,460
  • 9
  • 47
  • 77
3
votes
1 answer

Can I enforce that fields in a POCO are only ever set in a type initialiser?

If I have a POCO such as this: [Poco] public class MyPoco { public string FirstName { get; set; } public string LastName { get; set; } public string Address { get; set; } } ... and it's initialised like this: new MyPoco { FirstName =…
Steve Dunn
  • 21,044
  • 11
  • 62
  • 87
3
votes
1 answer

NDepend not seeing assembly attributes in Portable Class Libraries

I have a solution that uses a few portable class libraries and I can't figure out how to fix the default rules that look for certain attributes to be defined on the assembly when the assembly is a portable class library. For example, the rule Mark…
Bryan Anderson
  • 15,969
  • 8
  • 68
  • 83
3
votes
1 answer

NDepend Code Quality Metrics - Custom CQL - Brownfield development

I'm working on a brown-field project that was initially developed for .NET 1.1, and subsequently was retro-fitted to .NET 2.0, with a smattering of .NET 3.5 I'm curious what kind of metrics to use to begin finding optimization and modernization…
John Weldon
  • 39,849
  • 11
  • 94
  • 127
3
votes
0 answers

Ndepend Error no is no application assembly defined in the project

I'm trying to analyze VS solution via Ndepend as part of a tfs build. I added an .ndproj file in the same directory of .sln file under Sources folder. I'm Using Team Build 2010 workflow activity to add Ndepend as part of the build. But I encountred…
3
votes
2 answers

How can I get NDepend to run as part of my build process?

I love NDepend and would love it even more if I could figure out how to get it to run a report overnight as part of our build process. We're using NDepend v5 and TFS 2012 and I can't for the life of me find any resources on how to do this. The…
revlucio
  • 128
  • 1
  • 6
3
votes
1 answer

How to Create a Custom NDepend Rule to Check DI Registrations

we are using Autofac as our container for dependency injection. We would like to check various things using NDepend to ensure our DI is set up properly and not being misused (we have a very large solution). In unit testing, I might take an…
Richard
  • 603
  • 5
  • 14