Commands

Designite (C#) is a powerful console application for analyzing C# code and exporting results in CSV or XML format. The new console application provides the following capabilities:

  • Analyze C# solutions and projects to detect a wide range of code smells across architectural, design, and implementation levels, including testability and test-related smells.

  • Run batch analyses on selected projects for customized, large-scale assessments.

  • Integrate with Continuous Integration (CI) pipelines to automate code quality analysis.

Analyze a solution/project

To analyze a C# solution and to export the analysis results in the default (CSV) format, you can use the following command:

DesigniteConsole.exe -i "c:\Workspace\xunit\xunit.vs2015.sln" -o "C:\temp\"

You may specify the export format explicitly as follows:

DesigniteConsole.exe -i "c:\Workspace\xunit\xunit.vs2015.sln" -o "C:\temp\" -c

Use -c for CSV and -x for XML format. The following command can be used to emit the results in XML format.

Tip

You need to specify the path of a file when you want the output in XML format and the path of a folder when you want the output in CSV format.

_images/dc5_analysis.png


Analyze a subset of projects in a solution

When you analyze a C# solution, the application automatically attempts to process all projects within the solution. If you want to analyze only a few specific projects, the application makes this easy: Create a batch file that lists the paths of the C# projects you wish to analyze, placing one project path per line. An example batch file is shown below:

[Projects]
c:\Workspace\NUnit\src\NUnitConsole\nunit3-console\nunit3-console.csproj
c:\Workspace\NUnit\src\NUnitEngine\Addins\vs-project-loader\vs-project-loader.csproj
c:\Workspace\NUnit\src\NUnitFramework\mock-assembly\mock-nunit-assembly-4.5.csproj

It is important to mention [Projects] tag to help the application identify the specific projects to analyze. The following command can be used to analyze the above batch file.

DesigniteConsole.exe -i "C:\Workspace\NUnit\DesigniteTest.batch" -o "C:\temp\"

Register a license key

DesigniteConsole.exe -r <license_key>

Analyze code quality in CI environment

The Designite console application can be integrated into GitHub Continuous Integration (CI) pipelines. The following command analyzes a specified repository within the CI environment.

DesigniteConsole.exe -ci -repo <repo_owner_or_org>/<repo_name> -pat <PAT> [-k <Designite_key>]

For step-by-step instructions on integrating the tool into your CI pipeline, see the detailed guide.