How does NDepend help me have a better understanding and control over my .NET code?
NDepend analyses .NET assemblies of an application and generates reports containing design quality metrics, warnings and diagrams. More on reports in the Sample Reports section.
The VisualNDepend tool allows analysing all these data thanks to an interactive view. Such view can be tuned according to numerous software metrics. Here are some screenshots of VisualNDepend. The sample analyzed application is the 15 main assemblies of the .NET Framework 2.0 (2.8M IL instructions):
NDepend 2.0 supports the Code Query Language (CQL) (1.0 specification available here). Basically, NDepend considers your code as a database and CQL allows to query and check some assertions on this database. As a consequence, CQL is similar to SQL and support the SELECT TOP FROM WHERE ORDER BY pattern. Here are some sample CQL queries and constraints:
Writing CQL queries and constraints is straightforward both because it is a SQL-like langage and because VisualNDepend provides a CQL editor which supports intellisense and verbose compile error description.
NDepend provides facilities to be integrated into build scripts written with MSBuild or NAnt.
Getting Started
First download NDepend 2.0. Currently a 100% featured beta version is available for free.
Then read the Quick Start Tutorial.
A list of features is available here.
NDepend analyses .NET assemblies of an application and generates reports containing design quality metrics, warnings and diagrams. More on reports in the Sample Reports section.
The VisualNDepend tool allows analysing all these data thanks to an interactive view. Such view can be tuned according to numerous software metrics. Here are some screenshots of VisualNDepend. The sample analyzed application is the 15 main assemblies of the .NET Framework 2.0 (2.8M IL instructions):
NDepend 2.0 supports the Code Query Language (CQL) (1.0 specification available here). Basically, NDepend considers your code as a database and CQL allows to query and check some assertions on this database. As a consequence, CQL is similar to SQL and support the SELECT TOP FROM WHERE ORDER BY pattern. Here are some sample CQL queries and constraints:
WARN IF Count > 0 IN SELECT METHODS WHERE NbILInstructions > 200 ORDER BY NbILInstructions DESC // METHODS WHERE NbILInstructions > 200 are extremely complex and // should be split in smaller methods. |
WARN IF Count > 0 IN SELECT FIELDS WHERE NameLike "^m_" AND IsStatic // A static field should not be named 'm_XXX'. |
WARN IF Count > 0 IN SELECT TYPES OUT OF NAMESPACES "System.Xml" WHERE DepthOfIsUsing "System.Xml.XmlChildNodes" == 1 // Restrict the possibility to use the type "System.Xml.XmlChildNodes" // only to certain namespace. |
SELECT TYPES WHERE DepthOfDeriveFrom "System.Windows.Forms.Control" == 1 // Select classes which derive directly from control. |
SELECT TOP 10 TYPES WHERE IsStructure ORDER BY NbILInstructions DESC |
Writing CQL queries and constraints is straightforward both because it is a SQL-like langage and because VisualNDepend provides a CQL editor which supports intellisense and verbose compile error description.
NDepend provides facilities to be integrated into build scripts written with MSBuild or NAnt.
Getting Started
First download NDepend 2.0. Currently a 100% featured beta version is available for free.
Then read the Quick Start Tutorial.
A list of features is available here.