Tools

Introduction to NDepend : Static Code Analysis Tool

June 16, 2018 .NET, .NET Core, .NET Framework, ASP.NET, Best Practices, C#.NET, Code Analysis, Code Quality, Dynamic Analysis, Emerging Technologies, Help Articles, Microsoft, Static Analysis, Tech-Trends, Tools, Tools, Visual Studio 2017, VisualStudio, Windows No comments , , , , , ,

As a developer, you always have to take the pain of getting adapted to the best practices and coding guidelines to be followed as per the organizational or industrial standards.  Easy way to ensure your coding style follows certain standard is to manually analyze your code or use a static code analyzer like FxCop, StyleCop etc. Earlier days I have been a fan of FxCop as it was free and it provides me all necessary general guidelines in terms  of improving my solution.

In this modern world of programming everything needs to be automated, as it saves time and money in terms of automating repetitive tasks and improves efficiency. This is where static code analysers coming effective.

What is Static Code Analysis?

Static program analysis is the analysis of computer software that is performed without actually executing programs, on some version of the program source code, and in the other cases, some form of the object code or intermediate compiled code .

Sophistication of static program analysis increases is based on how deep they analyze in terms of behavior of individual statements and declarations, to analyzing the entire source code.

PS: Analysis performed on executing programs is known as dynamic analysis.

In this article I will give you an overview of one such premier static code analysis tool that can be used for your daily development routine plus use it for CI integration for DevOps efficiency.

NDepend:

NDepend is a static analysis tool for .NET, specifically for managed code:  NDepdend supports a large number of code metrics, allowing to visualize dependencies using directed graphs and dependency matrix. It also performs code base snapshots comparisons, and validation of architectural and quality rules.

The important capabilities of NDepend are:

  • Dependency Visualization through dependency matrix and graphs.
  • Analyse and generate software quality metrics – as per the documentation it supports 82 quality metrices.
  • Declarative rule support through LINQ queries, and it is called CQLinq and comes with a large number of predefined CQLinq rules.
  • Integration support for Cruise Control.Net, SonarCube, am City. Code rules can be configured to be checked automatically in Visual Studio or during continuous integration(CI).

License: NDepend is a commercial tool with licensing options as below:

  1. Developer seats – $477 approx. / per seat.
  2. Build Machine seats  – $955 approx. / per seat.

** You could get volume discount if you bulk procure your licenses.

Installation: 

Once you obtained license you will able to download NDepend_2018.1.1.9041.zip, is latest version available while I write this article. Extract the zip file into your local folder, you could see the different packages/executables within the package.

image

1.) NDepend.Console    – Command line program to execute NDepend analysis.  You would be mostly using this component on CI Build server Help

2.) NDepend.PowerTools –  Helps write your own static analyzer based on NDepend.API, or tweak existing open-source Power Tools. Help

image

3.) NDepend.VisualStudioExtension.Installer – To install NDepend extension as part of Visual studio

image

4.) VisualNDepend – Independent visual environment for managing your NDepend tasks.

image

Visual Tool gives you different options to choose from:

  • You can analyse a Visual Studio Solution or project.
  • Analyse .NET assemblies in a folder.

image

image

image

For the demo purpose our analysis target would be one of the starter project from github –  ContosoUniversity by @alimon808.

image

image

Demo: Summary Report

image

Demo: Application Metrics

image

Demo: Dependency Dashboard:

image

Demo: Interactive Graph

image

Demo: Code Matrix View

image

Demo: Quality Gates Summary

image

Demo: Rules Summary

image

Conclusion:

NDepend is one of the best enterprise grade commercial static analyser seen so far.  There are Visual Studio Code Analysis, FxCop and Stylecop Analyzer tools available but they do not provide extensive level of analysis reports NDepend provides. Being a commercial tool it gives value for money for customers by what they need.  In terms of a day to day developer  or devops lifecycle, you can integrate NDepend in your build process, which could be simple as executing the NDepend Console and reviewing the output. With NDepend’s API it is easy to develop your own custom analysis tools based on CQLinq and NDepend.PowerTools(which is open source). You could find all the detailed help in NDepend documentation.

References:

StartW8–a closer, free Windows Aero start menu alternative–for Windows 8

January 18, 2013 All, Community, MSDN, Softwarez, Tips & Tricks, Tools, Tweaks, Windows, Windows 7, Windows 8 No comments

While searching for Third Party alternative software’s for bringing back windows start menu feel on Windows 8, I came across few interesting tools – and I introduced them in my earlier blog posts – Stardock’s Start8 (licensed version), Classic Shell, Power8 were those.

Logo

[logo courtesy: AreaGuard]

Today I just found another cool alternative that you can try for free – StartW8 – is developed by Area Guard. You can install and use the software free of cost. It gives you start menu closer to the appearance of Windows 8 aero look and feel.

Have a look at the screenshot @ http://www.areaguard.com/startw8-start-menu-for-windows8-screenshots

StartW8 key features

  • Automatically switch to desktop immediately after signing in
  • Added Windows Start menu in Windows 8 design, but Windows 7 functionality
  • Activate menu with Win key
  • Log off, lock and turn off buttons
  • Traditional search field
  • Favourite applications
  • All user configurable
  • Support for silent installation
  • Multilanguage support (18 languages)
  • Option to ignore the lower left Hot corner

[Quoted from AreaGuard StartW8 website]

Download and Try StartW8 from: http://www.areaguard.com/startw8

Power8–yet another replacement to bring back old Windows Start Menu in Windows 8

January 18, 2013 All, Community, MSDN, Softwarez, Tools, Tweaks, Windows, Windows 7, Windows 8 1 comment

Power8 is a similar windows start menu alternative like ‘Classic Shell’, which I introduced in the last post.

Benefits Power8 includes:

  • No system files patching;
  • No hooks over system objects;
  • No app-init DLLs;
  • No additional services, drivers, etc;
  • No trash in registry;
  • No installation – just unpack and launch;
  • Small, fast and powerful;
  • Open-source;

You can download Power8 from http://code.google.com/p/power8/

Download – Microsoft Web Deploy v3.0 for IIS

October 17, 2012 All, ASP.NET, IIS, IIS 7.5, IIS8, Microsoft, Tools, Tools, Web Deploy No comments

The Web Deployment Tool simplifies the migration, management and deployment of IIS Web servers, Web applications and Web sites.

  • Administrators can use command-line scripting with the Web Deployment Tool to synchronize IIS 6.0, IIS 7.0 and IIS 8.0 servers or to migrate an IIS 6.0 and IIS 7.0 servers to IIS 8.0.
  • The Web Deployment Tool allows administrators and delegated users to use IIS Manager to deploy ASP.NET and PHP applications to an IIS 7.0 and later servers.

For more information, see the following articles:

DOWNLOAD: Web Deploy v3.0 for IIS

and It can be installed through Web Platform Installer(WPI) 4.0