ndepend

Analyzing an asp.net site with ndepend

Hi, I'm trying to analyze a web site (built with asp.net) with ndepend. If a take a look at the CQL queries about "unused code / dead code", the tool cites almost all my methods (including the onload, onprerender, ...), which is obviously wrong. Does anyone have any idea what I can do to have a better result ? Thanks in advance ...

Determine Unused Methods and Properties

I have a self-contained solution (non of the DLLs are used in any other project, so no worrying about Methods being used somewhere else). I'm trying to figure out a way to determine every method/property that is not in use at all. So I can't just look at private methods/properties, I need to also check Public methods and Properties. I...

Do you use NDepend?

Hi I've been trying out NDepend, been reading a few blogposts about it and even heard a podcast. I think that NDepend might be a really useful tool, but I still don't see where I would use it. How do you use it? Do you use it, why? why not? I would like to hear about some down to earth real world examples. ...

Are there any good/automateable dependency management tools for managing application, database & external resources dependencies?

I would like to build an overview/map of as many of our applications dependencies as possible. Analyzing .NET application dependencies is fairly easy using tools such as NDepend (which I love!). But when it comes to external dependencies, such as databases and webservices, I need something better, and preferably something that can be aut...

NDepend Assembly Metrics

Does anyone know if it's possible to choose what are the metrics computed per assembly (thus modifying the "AssembliesMetrics" section of the report). For example, I would like to know the number of type to refactor per assembly. Thanks in advance ...

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 inflection points. Are there any good CQL queries that anyone has found useful in cleaning u...

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 DebuggerNonUserCode attribute and InitializeComponent(). Unfortunately, I still get a few false...

C#/.NET analysis tool to find race conditions/deadlocks

Is there a tool that analyses .NET code and finds race conditions? I have a bit of code that has a public static property that gets or creates a private static field. It also has a public static method that sets this field to null (...yes, I know!..) As there are no locks around either of these methods, it's a safe bet that things'll ...

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 ASSEMBLIES "Company.System.Framework", "Company.System.Framework.ReferenceLookup", "Company.System.Framework.Web", "Company.System.Framework.Security", "Company.System.Framework....

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 = 23; Double anotherValue = 1; but not for (int i = 0; i < array.length; i++) ...

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 "App.BaseTypes.BusinessFacadeBase" OR DeriveFrom "App.BaseTypes.BusinessComponentBase" OR DeriveFrom "App.BaseTypes.Data...

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 are directly using the framework assembly, then manually list them in a second query SELE...

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 using: NCover 3.3.2 NUnit 2.5.4 FinalBuilder 6.3.0.2004 All tools are the latest official as ...

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 ignore the setting and always analyze all assemblies whether I want it to or not. I tried ...

Assembly Dependency using NDepend

Hi I install .NET 2.0 and .NET 4.0 in my machine. I write a small .NET 2.0 program (contains just one line Console output). When I check assembly dependency using NDepend, it shows my program is depending on .NET 4.0 assembly(mscorlib 4.0) instead of .NET 2.0 assembly(mscorlib 2.0). Thanks, ANT ...

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 windows call the properties - without even hitting any break points - can lead to unexpected e...

How do I programatically create an NDepend project file?

To start, this may be a useful link: http://www.ndepend.com/NDependConsole.aspx As anyone who has used Visual NDepend may know, with NDepends you need to import project / solution files, and the corresponding output directories, namespaces, and assemblies are added to the NDepends project. The problem I have, is I have TONS of these pr...

Can I use NDepend to count casts?

I've got some inherited code that has a tendency to pass objects around as interfaces (IFoo, for example) then, at arbitrary places in the code, spontaneously cast them to concrete implementations of those interfaces (say, MyConcreteFoo). Here's a silly example: public bool IsThisFooScaredOfMonkeys(IFoo foo) { if (foo is MyConcrete...

NDepend - Detect indirectly dependent libraries

I did following example project: SubClassLibrary - does not use any other DLL besides the .Net Framework ClassLibrary - this does use SubClassLibrary Main Program - this uses ClassLibrary directly If I run NDepend on the Main Program's solution, it only detects the dependency on "ClassLibrary", but not the dependency on "SubClassLibr...

NDepend cannot pick up new reference assembly automatically

Hi, I have a NDepend project that is using in automatic build process. When a developer adds one more assembly to the project, NDepend cannot pick up and analyze that assembly automatically. I can see the new assembly only when I add manually into NDepend project. How can I configure in NDepend project so that it will pick up new referen...