Sunday, September 10, 2017

Rule "Same architecture installation" failed with Microsoft SQL Server Data Tools for Visual Studio 2013

Scenario:

I was installing Microsoft SQL Server Data Tools - Business Intelligence for Visual Studio 2013 with a 64 bit SQL Server 2014 Express and Visual Studio 2013. The installation will not start because of a failing rule check. "Same architecture installation"

I have selected existing SQL Server instance to add features:

image

Then selected “SQL server Data Tools – Business Intelligence for Visual Studio 2013.

image

After that installation start running “Feature Configuration Rules” and I got an error saying that Rule “Same architecture installation” failed.

image

Solution:

I have searched for the problem and found that only 32-bit version of SQL Server Data Tools for Visual Studio 2013 published by Microsoft.

image 

From MSDN forum and blog article:

Make sure you choose the "New Instance" option (strange as that might seem). Otherwise, you'll get an error that says the following:

Rule "Same architecture installation" failed.

On my machine x64 version of SQL Server was installed so it requires to do a new installation rather adding features to existing instance. I thought that It was due to the Operating System architecture difference but these tools require 32 bit instance of SQL Server.

Hope this help others to solve this strange issue.

Friday, June 30, 2017

Out of box “Emmet” code snippets in Visual Studio Code

Visual Studio Code has a port for Emmet out-of-the-box too, which gives us more HTML features. Emmet is a web-developer’s toolkit that can greatly improve your HTML & CSS workflow or programming.

Basically, most text editors out there allow you to store and re-use commonly used code chunks, called “snippets”. While snippets are a good way to boost your productivity, all implementations have common pitfalls: you have to define the snippet first and you can’t extend them in runtime. Same like full version of visual studio, Emmit is way to implement code snippets in the VS Code editor.

For example  let's say we wanted to just type div and then inside of that div we wanted to have a UL. And then we want that UL to have, let's say, five LIs. We could do LI right there and how do you do five of those, we can do *5. Now if I hit Tab, it's going to automatically generate all that HTML.

Emmet_in_vscode_thumb[2]

Notice it's kind of got a cursor there in the first spot, so let's see what that happens there. I can type I first, hit Tab, and go to second, and then just keep typing like this. Now you can use that and hit Escape to get out and to also create things like table or anything else that's more complex.

if you want to learn more about the Emmet syntax you can check out this link here at docs.emmet.io.

Thursday, June 29, 2017

How to run Node.js and Npm with web proxy

Recently I needed to install npm on my workplace computer and it always showing below connection timeout error message every time when I run any command.

clip_image002

I have faced such issue with VS Code when trying to install extensions and updates. After going through documentation, I found that here is the same issue with proxy settings and I got information by running ‘npm help config’ command. It redirected me to the npm config documentation and I found this:

clip_image004

To authenticate my corporate proxy, I set the environment variables HTTP_PROXY and HTTPS_PROXY but npm did not recognized these environment variables.

After doing search on internet and from my previous experience with vscode issue, I found the following same way to configure the proxy for npm.

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

If you need to specify credentials, they can be passed in the url using the following syntax.

http://user_name:password@proxy.company.com:8080

You can also set the proxy configuration as a command line argument or environment variable. Configuration parameters can be specified using -- when executing npm. So the proxy could also be specified as follows.

npm --https-proxy=http://niranjansingh:MyPass@172.29.01.01:8080 -g install yo

I have tried command line configuration to make it work and I have done my job.

Hope this help others also... Happy Coding!

How to setup major tools for VS Code development environment?

Visual Studio Code is light weight editor for web development languages. To enhance it you require some tools which speed up development in Visual Studio code and also prerequisites for doing development e.g. Node.js . Here are the few players which play some important roles to enhance the development environment features:

clip_image002

Bower is a package manager for the web.
Gulp enables you to automate and enhance your workflow.
Yeoman is Scaffolding tool for modern web apps and helps you to kick start new projects, prescribing best practices and tools to help you stay productive.

You can setup these as follows:

Step 1 – Install Node.js

To through previous post - How to create Node.js development environment in Visual Studio?. Just download the installation package from Node.js site and go through the setup wizard to complete installation to work npm working.

Step 2 - Install Bower

To install Bower first run the Command Prompt and Bower is installed globally by running the following command:

npm install -g bower

Step 3 - Install Gulp

To install Gulp.js globally on your system run the below command which enable you to run the ‘gulp’ command in your command prompt:

npm install -g gulp

clip_image004

Step 4 – Install Yeoman

To install Yeoman, just run the below command on command prompt:

npm install -g yo

You can install these in one go using below command:

npm install -g yo gulp bower

clip_image006

After that most of things are up and running to start with VS code.

Happy coding!

Wednesday, June 28, 2017

How to setup Proxy settings in Visual Studio Code?

I ran into problem that when I try to find extensions in the VS Code, it does not display anything and even not able to check for updates. In this scenario, I have downloaded newer version of VS Code but it was not the permanent solution to solve this problem.

In such type of issues, I found that our enterprise proxy block the request which sent to the respective software vendors. Finally I decided to get to know that how can I setup proxy settings in VS Code as I did with tortoiseSVN and other tools.

I found reference in VS Code documentation - Proxy server support

Many enterprises require that their computers run behind a proxy server and don't allow direct access to the Internet. A proxy server intermediary can limit access to the VS Code Extension Marketplace and prevent installing VS Code extensions.

Follow the below steps to setup proxy settings:

  1. File > Preferences > Settings

    clip_image002
  2. Navigate to the HTTP settings section and you will find settings for proxy as shown in below image:

    clip_image004

  3. Now change the proxy settings as per your environment, If you proxy does not require authentication then just simply enter proxy details:
    "http.proxy": http://172.28.57.20:8080/
    If proxy require authentication then you have to provide user details:
    "http.proxy": "http://niranjan:password@172.28.57.20:8080/"

Complete Settings which works in my case:

// VSCode: Place your settings in this file to overwrite the default settings
{
  "http.proxy": "http://user:pass@proxy.com:8080",
  "https.proxy": "http://user:pass@proxy.com:8080",
  "http.proxyStrictSSL": false
}

From documentation:
Additionally, use "http.proxyStrictSSL": false if your proxy server uses a self-signed certificate.
Note: VS Code supports http and https proxies, but not SOCKS proxies.

Friday, May 26, 2017

Running the first .NET Core program in Docker environment


 

What is .NET Core?

.NET Core is a general purpose development platform maintained by Microsoft and the .NET community. It is cross-platform which suppors Windows, macOS and Linux, and can be used in device, cloud, and embedded/IoT scenarios.

What is Docker?
Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications. It leverage the speed in developing, packaging and running portable distributed applications. Docker for Windows is a Docker Community Edition (CE) app.

Note: It requires Microsoft Hyper-V to run and the current version of Docker for Windows runs on 64bit Windows 10 Pro, Enterprise and Education (1511 November update, Build 10586 or later).
Hardware Virtualization must be enabled. It is prerequisites for Hyper-V and also for Docker also.. You can check it in the Task Manager’s performance tab for CPU.

image



Now we start installing Docker on Windows 10 Pro.
First enable Hyper-V and here are the steps:
  1. Press Windows + R and run appwiz.cpl to open “Programs and Features” section of Control Panel.

    clip_image001
  2. Now click on “Turn Windows features on or off”.

    clip_image003
  3. Check Hyper-V in Windows Features section to enable it.

    clip_image004
I found an interesting and easy to understand moving image(gif) to know that how to enable Hyper-V form control panel.
clip_image005
Installing Docker application
  1. First download Docker InstallDocker.msi installer from here and then double-click InstallDocker.msi to run the installer.
  2. Follow the install wizard to accept the license, authorize the installer, and proceed with the install.

    clip_image006
  3. Follow the install wizard to accept the license,and click Next.

    clip_image007
  4. Click Finish on the setup complete dialog to launch Docker.

    clip_image008
  5. When Docker start without error then you will see Docker icon in the taskbar.

    clip_image010
and Linux virtual machine in the Hyper-V so we need to switch to Windows containers. It may restart your computer as did with me.
and switch to windows container.
Now time to come for creating the first “Hello World” program on Docker and run it. To work with Docker, we have start “Power Shell” to run the CLI command to create the program.
  1. First run the following command to get a container with the dotnet core tools.

    docker run -it microsoft/dotnet:latest
  2. Now create “Hello World” console application:

    dotnet new console -o hwapp 
  3. It will create a directory with name ‘hwapp’. Go into that directory using ‘cd hwapp’ and run the restore command.
    dotnet restore
image

 

Description from MSDN article:
You can, of course, develop your applications by using any language supported by Docker, like Node.js, Java, Go, Python, etc., Right now Microsoft working hard to make better support for .NET Core and .NET Framework in Docker environments. You can actually try the official  .NET and ASP.NET Core images available at Docker Hub as I have used one of them in above exercise to run the program on the Docker container.

It is quite interesting that these containers are help full to create different type application and host them to make auto build as read so far about them.
















Wednesday, May 17, 2017

DevExpress introduces new ASP.NET Bootstrap controls in v17.1

DevExpress controls suite now include Bootstrap enabled ASP.NET controls in upcoming release. So far I found these controls well incorporated with Bootstrap framework.

These new  ASP.NET Bootstrap controls are compatible with the Bootstrap version 3.3.7. These provides out-of-the-box Bootstrap framework. Right now all not all DevExpress ASP.NET controls found in DevExpress Bootstrap controls. In DevExpress 17.1 Beta Demo Bootstrap controls are totally a separate category of controls.

DevExpress ASP.NET Bootstrap controls are new line of controls which somewhat gives us similar versions of DevExpress ASP.NET features There controls contains 4 type of controls as a subset of the DevExpress ASP.NET controls:

image

And Visual Studio toolbox also showing them in separate category of controls:

image

Let  check the DevExpress Bootstrap Controls:
Most of the added controls are similar to the standard DevExpress ASP.NET controls because they are derived from them. Editor controls has almost all of these properties and the client side events.

 

image

These bootstrap enabled controls has new properties section which specifies the bootstrap related properties. In case of button we use SettingsBootstrap.RenderOption  to specifies the button style as shown in the above image.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="DevExBootstrapControls.Default" %>

<%@ Register Assembly="DevExpress.Web.Bootstrap.v17.1, Version=17.1.2.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.Bootstrap" TagPrefix="dx" %>

<%@ Register Assembly="DevExpress.Web.v17.1, Version=17.1.2.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <!-- Optional theme -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <dx:BootstrapTextBox ID="btnMessage" ClientInstanceName="message" runat="server" Text="Hello, Bootstrap TextBox"></dx:BootstrapTextBox>
            <dx:BootstrapButton ID="btnShowTextMessage" runat="server" AutoPostBack="False" Text="Button">
                <ClientSideEvents Click="function(s, e) {
    alert(message.GetText());
}" />
                <SettingsBootstrap RenderOption="Success" />
            </dx:BootstrapButton>
            <br />
            <br />
            -- Grid --
            <br />
            <dx:BootstrapGridView ID="BootstrapGridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="AddressID">
                <Columns>
                    <dx:BootstrapGridViewTextColumn FieldName="AddressID" ReadOnly="True" VisibleIndex="0">
                    </dx:BootstrapGridViewTextColumn>
                    <dx:BootstrapGridViewTextColumn FieldName="AddressLine1" VisibleIndex="1">
                    </dx:BootstrapGridViewTextColumn>
                    <dx:BootstrapGridViewTextColumn FieldName="AddressLine2" VisibleIndex="2">
                    </dx:BootstrapGridViewTextColumn>
                    <dx:BootstrapGridViewTextColumn FieldName="City" VisibleIndex="3">
                    </dx:BootstrapGridViewTextColumn>
                    <dx:BootstrapGridViewTextColumn FieldName="StateProvinceID" VisibleIndex="4">
                    </dx:BootstrapGridViewTextColumn>
                    <dx:BootstrapGridViewTextColumn FieldName="PostalCode" VisibleIndex="5">
                    </dx:BootstrapGridViewTextColumn>
                    <dx:BootstrapGridViewTextColumn FieldName="rowguid" VisibleIndex="6">
                    </dx:BootstrapGridViewTextColumn>
                    <dx:BootstrapGridViewDateColumn FieldName="ModifiedDate" VisibleIndex="7">
                    </dx:BootstrapGridViewDateColumn>
                </Columns>
                <CssClasses Table="grid-table-with-template" />
            </dx:BootstrapGridView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString %>" ProviderName="<%$ ConnectionStrings:AdventureWorksConnectionString.ProviderName %>" SelectCommand="SELECT top 20 * FROM [Person_Address]"></asp:SqlDataSource>
        </div>
    </form>
</body>
</html>

and below is the output of these added controls on the page:

image

 

Conclusion: DevExpress Bootstrap controls idea is quite good and really decrease the development time rather using the flat table for rendering data and other operations using the editor controls. DevExpress native web form controls rich with the features so these Bootstrap enabled control really make intuitive user interface.

 

Thursday, April 13, 2017

Technical Dept Estimation with NDepend for controlling software cost in future.

Technical debt is a concept in programming that reflects the extra development work that arises when code that is easy to implement in the short run is used instead of applying the best overall solution at once after few release of the application.

 

It includes those internal things that you choose not to do now, but which will impede future development if left undone. especially in the context of refactoring.

In 1992, at the OOPSLA conference Ward Cunningham describes this concept as follows:

"Shipping first-time code is like going into debt. A little debt speeds development so long as it is paid back promptly with a rewrite. Objects make the cost of this transaction tolerable. The danger occurs when the debt is not repaid. Every minute spent on not-quite-right code counts as interest on that debt. Entire engineering organizations can be brought to a stand-still under the debt load of an unconsolidated implementation, object-oriented or otherwise."

Technical Dept increase with every release if residual issues left over from the last released are addressed. In Agile method, each sprint take care about the standard process to make a quality product but code refactoring and other stuff are not controlled at the right time then futures releases cost more in refactoring rather than doing at particular release using shortcuts. It is reduced by measuring Debt at every release to reduce to cost of the continuous development.

NDepend provide Continuous Code Quality using Smart Technical Debt Estimation. It enables you to estimate the cost to fix and the severity through customizable C# formulas for each issues persist at each sprint or release of the software.

In newer version NDepend v2017.1.0, NDepend estimates the technical-debt of a code base.

image

The technical-debt is estimated from C# LINQ formulas embedded inside each rule source code. This makes the the estimations both smart and easily customizable to your needs. In the below screen you will see the queries written for the predefined rules provided with the NDepend.

image

There are rules which can be added and modified as per the requirement. Debt estimation parameters are also customizable through NDepend Project Properties panel. See below images:

image

image

As per my opinion this feature is quite worth of use to improve the quality of the product for future cost reduction and it is quite easy to understand the serious Code Quality control in the development process through NDepend. It makes the managers to control the return on investment made on quality.

Hope NDepend benefits others to reduce the Technical Debts for their products..

Thursday, March 23, 2017

How to use multiple validators for one control at same place?

Scenerio:
Let suppose I have a textbox for email and I want to validate that user must enter valid email address. In this statement there are two checks:
  1. User must enter email address – Required field
  2. Email address must valid email address
To do this two validator are required so it is required to use RequiredFieldValidator and RegularExpressionValidator both but the problem is that when we put these control adjacent to each other as below:
clip_image001
If we do this then email validation message shown far from the text box because RequiredFieldValidator still maintain their place.
clip_image002
Solution:
Set the Display property to Dynamic on RequiredFieldValidator and RegularExpressionValidator. After doing this it render correctly.

clip_image003




Tuesday, March 7, 2017

Visual Studio 2017 Launched with new features…

Currently Visual Studio 2017 launch 20th Anniversary event is still running on 7 and 8 March. One day still left to  explorer know that what Microsoft brought in this version. There are lots improvement in this version of Visual Studio.

First one is the New Installation user interface which make it easier for you to select and install just the features you need. You can select individual components that you want to use in development environment.

image

image

Visual Studio has been optimized to reduce startup time and solution load time. The very first launch of Visual Studio is at least 50% faster.

Improved Code Navigation
There are huge improvements to code navigation features in Visual Studio 2017. It is changed to “Go To All (Ctrl +, or Ctrl + T)” lets you quickly find and go to files, types, methods, and other elements in your code. It allows you to locate items of any kind, even in large code bases. Go To Line is also improved.
  • Structure Guide Lines are now drawn in the editor so that you can easily visualize the structure of the code that you are working in. On mouse hover, a tooltip is displayed containing the context of the current code block relative to its ancestor blocks. Structure Guide Lines are currently supported for C#, Visual Basic, and XAML files, and for any files supported via TextMate grammars. This feature may be disabled in the Tools > Options dialog by unchecking the Show structure guide lines checkbox under the Text Editor > General category.

Coding Convention Support Via EditorConfig

The Visual Studio 2017 editor now supports EditorConfig, which allows developers to define and maintain consistent coding style conventions between different editors and IDEs. See documentation for more details, and .NET documentation for information on how to use .editorconfig files to govern your .NET code style. See known issues for limitations in EditorConfig support in this release.

Read this nice article - Code Style Configuration

Code Refactor improvement

Visual Studio provides lots of refactorings to help you be productive and make your code more readable. for example,

  • Simplify object initialization with an initializer.
  • Use specific type rather than var.
  • Convert String.Format to string interpolation [ “AA” + abc.ToString() to string.Format(“{0}{1}”, “AA”, abc.ToString()],
  • Convert property to a method, and vice versa.
  • Move class declaration to another file.

There are lots refactoring features included in Visual Studio 2017 which are provided by third-party tools e.g. Redgate Refactor and DevExpress CodeRush. I am using DevExpress CodeRush for these features but some theme are already exists in Visual Studio 2017. It is really good that some basic refactoring features now part Visual Studio itself.

Debugging and Diagnostics

Now Visual Studio has significant changes in this section also.. Check few of them below:

Run to Click

Simply click the icon next to a line of code while debugging to run to that line. No longer set temporary breakpoints or perform several steps to execute your code and stop on the line you want. Now while stopped at a break state under the debugger, the Run to Click icon subtly appears next to the line of code that your mouse is hovered over. Move your mouse to the icon and click the button, now your code will run and stop on that line the next time it is hit in your code path. Turn it off from Debug> Options > Enable Run to Click.

Debug_Run_Right_Click

The New Exception Helper

Use the new Exception Helper to view your exception information at a glance in a compact non-modal dialog with instant access to inner exceptions. Read this blog post for more detailed information on the new benefits of the Exception Helper.

Live Unit Testing is the interesting one which captured my eyes during the first day launch event. It visualize unit testing results and code coverage live in the editor. A symbol is shown whether this line of code pass the unit test or not. It also shows that this line of code is captured by unit test or not.

There are lots features added in newer version of Visual Studio. It looks like ultimate editor for developers.

Thursday, February 9, 2017

NDepend: New Feature “Technical Debt and Quality Gate”


What are the quality gates
Quality gates are basically acceptance criteria reviews that can be used throughout any project. Sure, managers of smaller, agile projects might say that this involves too much paperwork, but the nice thing about quality gates is that the strategy is fully customizable. It can be seen as a set of predefined quality criteria that a software development project must meet in order to proceed from one stage of its lifecycle to the next.
These are special milestone in a software project which are located before a phase that is strongly dependent on the outcome of a previous phase. They are especially useful between phases in which breaches in disciplines must be overcome.

How quality gates work:
You are not allowed to proceed the next gate until the previous gate has been completed successfully. It involves a checklist of deliverables, with some indication of the state of completion for each item. Checklist must be reviewed by the project manager (Manager) and a senior executive or stack-holders who is involved with the project. Quality gates therefore mean:
  • Formal checklists are used throughout the life of a project.
  • Formal sign-off and acceptance occurs at each gate.
  • Assessment of the quality and integrity of the product takes place.
  • Information is assured to be communicated to the correct stakeholders
Advantages of the Quality gates:
These are effective on any kind of project. There attractive because of the following advantages which includes:
  • Minimizes project failure risks through phase-by-phase checklists (or Gates)
  • Enables project managers to continuously communicate the process and build quality directly into the project
  • Reduces development cycle time—getting it done right the first time
  • Increases focus on a well-designed product
Now NDepend is equipped with this in v2017.1 and you will find default quality gates relative to technical debt and issues and issues, including Percentage of Debt, New Debt since Baseline or New Blocker / Critical / Major Issues. Quality gates relative to absolute technical debt value are disabled by default because the proper thresholds can only be defined in the context of a particular project.
Results of the applied rules are shown in the updated dashboard. This is quite new feature in NDepend for project management improvement.

image

You will find ratings and the status of passed rules.

image

HTML report has more details in a tabular format about the applied rules:
image

Then again the feature that I most like in NDepend is CQLinq which enables you to customize or add rules. CQLinq is much fast to run these rules and now much improved in case of performance.

image

There is a nice documentation is also available to know that how to Compute and Manage the Technical Debt with NDepend.

Monday, January 30, 2017

What's new in NDepend v2017.1

After my first article “Analyzing the Quality of your code with NDepend” on NDepend, I found few new interesting feature in it’s new release. Microsoft has introduced new version of the Visual Studio which my first choice for development. New Roslyn platform heading us to the Open source development using the Microsoft tools that making things easier to learn and get knowledge about the new tools. But we are going to explorer new features of the NDepend. Few of them are as below:
Support for Visual Studio 2017

  • NDepend 2017.1 supports Visual Studio 2017.
  • NDepend 2017.1. It also supports Visual Studio 2015, 2013, 2012 and 2010.

.NET Core support

  • NDepend can now analyze any .NET Core assembly and its associated PDB and source files.
  • The new .NET Core Portable PDB file format is now also supported.
  • Support for inferring code to analyze from a project.json file, which about to completely come in the first quarter of this year. All .NET Core assemblies you need to analyze can be easily found through Analyze .NET assemblies in directory (recursive).

Dashboard Improvements

  • Dashboards have been improved in the NDepend UI in Visual Studio, in the generated reports section and in the Team Services web portal.
  • It now contains technical debt estimations, quality gates, rules and issues data.
  • For each data, a visual indicator shows the progression since baseline. Red and green coloured values are used to pinpoint progress or regression.
  • Clicking any value generates a query that drills down through corresponding data, which can be a list of code elements, debt estimations, quality gates, rules or issues.clip_image002[4]

Visual Studio Team Services VSTS and TFS 2017 Advanced Extension
A new Visual Studio Team Services extension is available. It consists of a build task that analyses code and code coverage yielded by the build process.
A web portal presents the results which embeds the NDepend dashboard and makes data actionable by drilling down anything with a single click.

A new Visual Studio Team Services extension is available. It consists of a build task that analyses code and code coverage yield by the build process. A web portal presents analysis results.clip_image004[4]

  • The web portal has a dashboard that presents the most relevant data including technical debt, code size, quality gates, rules and issues numbers.
  • A TFS build can be used as a baseline. All dashboard data is then diff-ed since the baseline.
  • Each data presented in the dashboard is clickable to view more information.

    clip_image006[4]
  • A detailed summary of quality gates is available.
    clip_image008[4]
  • Technical debt can be drilled down till the issue level. Clicking an issue allows it to be edited in the Rules panel.
    The datagrid is interactive: issues can be grouped, ordered and filtered by rule name.
    clip_image010
  • Rules details can be explored. Clicking a rule violation redirects the user to the VSTS Code Search extension, displaying the source code of the culprit code element.
    clip_image012
  • The VSTS extension logs trend metrics for each build, and Trend charts are shown.
    clip_image014
  • A panel shows a code metrics recap for each code element. The datagrid is interactive: elements can be grouped, ordered and filtered by name.
    clip_image016

Report Improvements

  • The new improved report dashboard now contains information on debt and issues.
    clip_image018
  • The report main section contains Quality Gates status summary.
    clip_image020
  • The report Rules Summary now shows the number of issues added and fixed per rule.
    clip_image021[4]
  • A green/red colour scale is now shown on code coverage values.
    clip_image022[4]

Code Querying Improvements

  • Thanks to the new queryable domains QualityGates, Issues, IssuesInBaseline, Rules queries can be written to match IQualityGate, IIssue, IRule objects according to any criteria (rule violated or not, quality gate status that went from pass to fail, issues added since baseline, issues severity or debt...).
    clip_image023[4]
  • New syntax to write quality gates.
  • A new button lets you run the currently edited code query against the baseline.
    clip_image024[4] 
  • A code query can now return code elements of various kinds such as assemblies, namespaces, types, methods and fields.

    This new queryable domains are available including CodeElements ANTMF ; CodeElementParents ANT ; TypesAndMembers TMF ; Members MF ; CodeContainersANTM ; AttributeTargets ATMF ; where Assemblies, Namespaces, Types, Methods, Fields.
  • A query can now return values of technical debt through new types Debt, AnnualInterest, DebtRating, Severity, TrendIcon and can also return System.Version and System.TimeSpan values.
    clip_image025[4] 
  • A colour scale is now shown on query result metric values making it easier to compare them at a glance.
  • You can now write very simple queries like Methods or JustMyCode.CodeElements or codebase.PercentageCoverage. This syntax simplifies writing quality gates and trend metrics queries.
  • Trend metrics used to only be defined with queries that return a scalar. A trend metric can now also be defined with a query that returns rows. In such situation the trend metric value is equals to the row count.
  • Improved query edit experience including:
    - PageUp/PageDown and dot supported on completion items list
    - smart query results column width auto-adjustment
    - no more flickering on query result row sorting.

Smart Technical Debt Estimation

NDepend v2017 is the only VS extension that can tell the developer that, for example, since this morning the code just written has introduced debt that would cost about 30 minutes should it have to be repaid later.
Knowing this, the developer can fix the code before even committing it to the source control.

  • An NDepend rule can now assign a technical debt and annual interest values to its issues.
  • The technical-debt is the estimated man-time that would take to fix the issue.
  • The annual-interest is the estimated man-time consumed per year if the issue is left unfixed. This provides an estimate of the business impact of the issue.
  • Issues of a rule now have a severity level in the blocker, critical, major, minor, info range.
    The annual-interest is a measure of an issues severity. The severity and the annual-interest represent the same concept where the annual-interest is a continuous measure while the severity is a discrete measure.
  • For example the rule below matches methods which are too complex. The technical debt is linear to the methods excessive complexity and the annual-interest is linear to the methods code coverage by tests (10 minutes per year for 100% coverage, 2 hours per year for 0% coverage).
    All default rules now have these debt/interest formulas which offer real-world estimations, out of the box. If needed, these formulas can be easily customized.
    clip_image026[4]
  • The dashboard now shows estimated Debt values and evolution since baseline.
    This dashboard is available in the NDepend UI in Visual Studio, in generated reports and in the Team Services web portal.
    clip_image027[4]
  • Many facilities are proposed from the dashboard to query/sort/filter/group... the debt estimated values and the issues set.
    These facilities include sorting debt and issues per rule or per code element, focusing on new and fixed debt since baseline and issues to fix by priority heuristics.
    Customizable Quality Gates are now available to define excessive thresholds over debt estimations that might induce build failure and prevent check-in.
    Customizable trend metrics are now available to measure debt trending. The key is to offer comprehensive sets of actionable results.
  • The NDepend project properties now has a Debt and Issues panel to customize all technical debt computation aspects.
    This includes estimated Debt and Interest values conversion from man-time to cost estimation.
    This also includes Debt Ratio and SQALE Debt Rating on a code element (as defined by the SQALE method). These are expressed in percentage of the estimated technical-debt compared to the estimated effort it would take to rewrite the code element from scratch.
    Debt settings can also be shared among different NDepend projects.

    clip_image029
  • More info on Smart Technical Debt Estimation here

Quality Gates

A Quality Gate is a check on a code quality fact that must be enforced before releasing and eventually, before committing to source control.
Quality Gates for example can forbid issues with a certain severity introduced since the baseline, enforce particular code coverage by tests ratio on new and refactored code or enforce thresholds on any Technical Debt criteria.

  • CQLinq can now be used to write quality gates. Technically a quality gate is like a trend metric. It's a code query that returns a scalar or rows (in which case the value is the row count). In practice a quality gate is used to fail a build when some thresholds are violated. A warn threshold, a fail threshold and a unit can be provided.
  • Thanks to the new CQLinq capabilities, quality gates can be use to measure and monitor any fact concerning code, but also any fact concerning technical-debt, rules and issues.
  • Quality gates can also rely on differences since baseline (diff), which means that they can monitor progression like new technical debt since baseline or % code coverage on new code written since baseline.

    clip_image030[4] 
  • 11 quality gates are provided per default and LINQ queries can be written to query the quality gates status.

    clip_image031[4] 
  • In previous NDepend versions, a build used to fail upon critical rules failures. Now the build fails upon any quality gate failure. The critical rule concept has been kept and the default quality gate Critical Rules Violated mimics the build fail behavior of previous NDepend versions.

Issues Management

  • A new Issues menu offers actionable options to list issues to be fixed by priority, and browse debt and issues per rule or per code element.

    clip_image032[4]
  • Quality gates, rules and issues numbers are shown from the dashboard. All these numbers are clickable to get lists of quality gates, rules or issues.

    clip_image033
  • A single click allows to list issues with a particular severity, added or fixed, since baseline.

    clip_image034
  • New menu to list issues concerning a code element.
    clip_image035
  • Hovering an issue with the mouse displays a complete description.

    clip_image036 
  • Code element tooltip now shows debt and issues related data.
    clip_image037

Enhanced Baseline Experience

Do you want to measure progress since this morning, last week or since the last release?
Choose the baseline in a single click from the Dashboard and harness the updated results in just a few seconds.

  • Any stored baseline can be applied from the dashboard through a single click.
    Code base diff, rules, issues and quality gates are then recomputed in a few seconds.
  • Any newly created project now has the baseline settings set to 30 days ago per default.
    As a consequence, the stored baseline with the date closest to 30 days ago is applied.
    The first analysis result of a project is compared with itself since no other result can be used as the baseline.
  • Rules and Quality Gates are now executed against both current and baseline analysis results. Debt estimation, issues and status differences can then be queried.

    clip_image039
  • The search panel can now match all code elements added, refactored or removed since baseline.
    The results also show debt and issues information.
    This perspective is ideal to browse changes and issues introduced since baseline.
    clip_image041

Default Rules-Set Improvements

  • All default rules now include debt/interest estimation formulas that offer real-world estimations of the technical-debt, out of the box. If needed, these formulas can be easily customized.
    Typically rules related to poor coverage, poor quality and poor structure are the highest source of technical-debt.
  • The new CQLinq capabilities 52 existing rules have been improved to offer less false positives and more relevant data.
  • For example the rule Avoid namespaces mutually dependent has been improved to offer actionable results. It now lists all dependencies to remove at type and method level to reach a clean layered code structure.
    clip_image043
  • New rule Assemblies should have the same version lists application assemblies that have a different version than most other application assemblies.
  • New rule Avoid non-readonly static fields.
  • New notmycode query Discard generated Namespaces from JustMyCode matches the VB.NET generated namespace My.
  • The notmycode query Discard generated Types from JustMyCode now also matches anonymous types.

Enhanced Visual Studio Integration

  • NDepend analysis can be started after a build to automatically refresh NDepend results. New settings are provided to avoid starting the NDepend analysis when the builds purpose is to provide up-to-date compiled bits for a run session, a debug session or a unit-test session. In such a situation, it might be preferable to avoid starting the NDepend analysis to avoid both consuming CPU cycles and distracting the developer's focus.
  • Minimal interval between NDepend results being refreshed automatically after a build in VS which can now also be expressed in minutes.

NDepend.API Improvements

  • Possibility to compute an issues-set and an issues-set-diff through a single method call thanks to the new methods ComputeIssues() and ComputeIssuesDiff() declared in ExtensionMethodsProjectAnalysis.
  • Possibility to compile a code query once and resolve it against multiple code bases. This facility represents a significant optimization when multiple resolutions are needed, because query compilation is way slower than query resolving.
    Related method ExtensionMethodsQuery.CompileNoResolve() which returns a IQueryCompiledUnresolved that presents two Resolve() methods, against a ICodeBase and an ICompareContext.
  • The new method ExtensionMethodsQuery.GenerateCompletionItems() provides completion items in code query edition context.
  • The new method ExtensionMethodsQuery.CompileMany(IEnumerable<IQuery>) takes an enumerable of IQuery and returns a dictionary of IQueryCompiled indexed by IQuery.
Conclusion
NDepend is again loaded with more improvements and features from it’s last version. NDepend team introduced above valuable feature and enhancements.

Note: Some text and Images are taken from NDepend documentation.