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
2
votes
1 answer

NDepend Get Third Party references for each project in solution

For each project in my solution, I want to get a list of which third-party assemblies it uses. I guess something like this: let landscapeAssemblies = from a in JustMyCode.Assemblies let thirdPartyAssemblies = from a in…
reach4thelasers
  • 26,181
  • 22
  • 92
  • 123
2
votes
1 answer

How to get list of extension methods in a solution or project in VS2013?

How does one get the list of extension methods in a solution/project? Is there anything in VS 2013 by default to achieve that like class view or using ndepend cqlinq?
jimjim
  • 2,414
  • 2
  • 26
  • 46
2
votes
1 answer

Getting list of types that are effected by an extension method in cqlinq

How to get the list of types that are extended by a extension method in ndepend cqlinq? Using reflection to code this seems a bit of donkey work where ndepend is already there.
jimjim
  • 2,414
  • 2
  • 26
  • 46
2
votes
2 answers

How do I automatically fail a nant build if NDepend query raises a warning

OK first some background. I am busy automating our build process. We run a mixture of Vs 2005 and VS 2008 both targeting platform 2.0. We use Nant to do our builds using the MSBUILD task to do the compile and Cruise Control .net to do our CI. …
2
votes
1 answer

How to download reports from NDepend

Is it possible to download the report generated by NDepend? or is there any similar tool using which I can download the report that is generated? Also does NDepend have support for C++ or Objective-C? Thank you for your time.
Div
  • 117
  • 1
  • 1
  • 9
2
votes
1 answer

How to refactor to reduce nesting depth with try/multiple catches (NDepend)

In the following code, NDepend reports a violation because of a nesting depth of 6 (1 for each catch) and the limit is 5. So it gets flagged in this rule: Quick summary of methods to refactor Is having just a single catch for the more general…
Jerry R
  • 43
  • 4
2
votes
1 answer

Is the Cyclomatic complexity value shown by Visual studio ILCyclomatic complexity

I have ran code analysis on my solution using Visual studio 2012 and NDepend For a method MethodA Visual studio shows the complexity as 105 and Ndepend shows it as 12. However the ILCyclomatic complexity in NDepend is 112. Does this mean that the…
2
votes
1 answer

Ndepend.API to capture code violations

I want to extract the Code violations like errors,warnings from my C# code using Ndepend API. Can you please help me in fetching the information. Thanks. Sajesh
sajesh Nambiar
  • 689
  • 2
  • 10
  • 25
2
votes
1 answer

How to subtract or take complement of an intersection in NDepend?

A custom rule has to be created in NDepend to check the availability of a particular method (e.g. Dispose) in some classes. A warning has to be given for classes that do not contain the method. The following code gives all the classes that need to…
Abdul Rauf
  • 5,798
  • 5
  • 50
  • 70
2
votes
0 answers

how to check whether a function contains try and catch using NDepend?

Need to create a custom rule in NDepend using CQLinq to check whether a public method code block is inside try and catch. The following gives all the public methods: from m in Application.Methods where m.IsPublic select m Is there a feature in…
Abdul Rauf
  • 5,798
  • 5
  • 50
  • 70
2
votes
1 answer

NDepend query methods/types in framework assembly being used by other assemblies/types

I am trying to determine which types or methods in a base framework assembly are being used by other assemblies in the application system. I cannot seem to find a straight-cut query to do that. What i have to do is first determine which assemblies…
icelava
  • 9,787
  • 7
  • 52
  • 74
2
votes
0 answers

Why are sealed attributes slower to fetch than unsealed with GetCustomAttribute()?

I was running my code through NDepend tonight and had a rule violation that has me a bit perplexed. The rule quotes the following from MSDN: The .NET Framework class library provides methods for retrieving custom attributes. By default, these…
Johnathon Sullinger
  • 7,097
  • 5
  • 37
  • 102
2
votes
1 answer

FxCop custom rule for nested If

I am trying to get following metrics report for .Net assemblies 1. Boolean expression 2. Nested If 3. Method Parameters 3. Nested try 4. Missing switch default 5. Class fan-out complexity Basically, I want to generate toxicity report for these…
2
votes
0 answers

Ndepend CQL to find methods of certain types using particular framework assembly

In order to check if types not derived from certain base classes are using a low-level framework assembly, the following query can be used. SELECT TYPES WHERE IsDirectlyUsing "ASSEMBLY:Framework.Data" AND !(DeriveFrom…
icelava
  • 9,787
  • 7
  • 52
  • 74
2
votes
1 answer

Ndepend CQL to query types out of assembly wildcard

In order to determine what low-level framework types a web application is directly using, one has to define each and every assembly involved. SELECT TYPES FROM…
icelava
  • 9,787
  • 7
  • 52
  • 74