Ignorer les liens de navigation
Home
Download
Product ▼
Purchase
Upgrade
Documentation ▼
About ▼

    Getting Started

Share |

 Follow us on Twitter


Watch a Video Tour!
Getting Started
Product Features

Online Demo (2mn30) :

The Camtasia Studio video content presented here requires a more recent version of the Adobe Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.



Tutorial with explanations and screenshots :
  • Installing the NDepend addin for Visual Studio 2010, 2008 or 2005
  • Analyzing a Visual Studio solution
  • Analyzing a .NET applications using Visual NDepend
  • What does the NDepend report tell me about my code?
  • I want to go further to have a better control over my code




  • Installing the NDepend addin for Visual Studio 2010, 2008 or 2005
    1. Download the NDepend installation zip file
    2. Unzip NDepend files anywhere on your system, preferably under %ProgramFiles%\NDepend



    3. Start NDepend.Install.VisualStudioAddin.exe
    4. Click the button Install for the right Visual Studio version



    5. Start Visual Studio



    Analyzing a Visual Studio solution
    1. Start Visual Studio after having installed the NDepend addin.
    2. Open the Visual Studio solution containing the code to analyze.
    3. Click the greyed NDepend circle status (bottom right of the Visual Studio window)
      OR
      click the menu NDepend > Attach new NDepend project to current Visual Studio solution
        Note:
      • A NDepend project can be attached to several Visual Studio solutions.
      • This is useful if you wish to analyze several .NET assemblies compiled with several Visual Studio solutions.
      • A benefit will be the possibility to navigate across several Visual Studio solutions opened in several Visual Studio instances.



    4. The dialog opened has been populated with .NET assemblies of the Visual Studio solution. Here you can add more .NET assemblies compiled from another solutions



    5. Click Ok : the NDepend analysis start. It will just take a few seconds, likely under 15 seconds, to analyze your code base for the first time.



    Analyzing a .NET applications using Visual NDepend
    1. Start VisualNDepend.exe
    2. Select the option: Select assemblies to analyse



    3. Populate the data grid with your assemblies by using the browse button or by using drag and drop.



    4. Click OK. It will trigger the analysis of your assemblies and code source by NDepend.Console.exe. This analysis will take a few seconds to a few minutes depending on the size of the assemblies. Once done, the result is displayed in the VisualNDepend.exe UI.



    What does the NDepend report tell me about my code?
    • Application Metric: This section gives you an idea of the topology of your application.
    • Assembly Metric: This section gives you an idea of the size of each assembly within your application in terms of #IL instructions and others metrics.
    • VisualNDepend View: This section illustrates the size of your assemblies, namespaces, types and methods in terms of #IL instructions. You can browse this view dynamically by clicking the Launch Visual NDepend on this Project icon in the NDepend.Project UI.
    • Assembly Abstracness vs. Instability: This section illustrate the Abstracness/Instability principle explained in the assemblies metrics section.
    • Assembly Dependencies: This section shows all dependencies between assemblies of your application in a table.
    • Assembly Dependency Diagram: This section shows all dependencies between assemblies of your application in a diagram
    • Assembly build order: This section gives you one of the possible build order for your assemblies. If a cycle exists in your assemblies dependencies graph, this section will report it.
    • NDepend information and warnings: This sections gives you advices about your code:
      • It warns you when an assembly depends on a less stable assembly than itself.
      • It warns you when the visibility of a type or of a member is not optimal (in the context of the analysed application).
      • It warns you when a type or a member is not used (in the context of the analysed application).
    • CQL Queries and Constraints: This section reports default CQL constraints which have been violated. More about the CQL language and CQL constraints here. You can build your own CQL constraints with VisualNDepend. Click the Launch Visual NDepend on this Project icon in the NDepend.Project UI.
    • Type Metrics: This section recaps type metrics in a table. A link to the documentation is provided for each metric.



    I want to go further to have a better control over my code
    • Understand metrics yielded by NDepend and read recommendations.
    • Get a new understanding of your code by playing with the NDepend panels. Modify the view with the Level and Metric combo boxes.
    • Tune your report thanks to the Output panel in the NDepend.Project UI.
    • Learn CQL (Code Query Language) and create custom CQL constraints with VisualNDepend. You'll find it useful mainly to create:
      • Naming constraints (for example: I want the static fields of these assemblies ... to be named like that).
      • Code quality constraints (for example: I don't want methods with more than 200 IL instructions, except for generated methods which are ...).
      • Encapsulation constraints (for example: I don't want that the constructors of these classes ... are called outside this namespace).
    • Integrate the NDepend report in your daily build process. Facilities are provided for both MSBuild and NAnt build technologies. Read the ReadMe.txt files contained in the .\MSBuild\ and .\NAnt\ folders.
Copyright © 2004-2010 SMACCHIA.COM S.A.R.L - Designed by GEMEA Interactive