Codemaid



For more details, please visit: https://www.codemaid.net

Currently supports VS2017 and VS2019.

For Visual Studio 2012/2013/2015, the last supported version is v10.6.

CodeMaid Web Site Other Useful Business Software SQL Server Performance Monitoring Are you constantly fighting database performance fires, looking in vain for the root cause of SQL Server slowdowns? Choco upgrade codemaid -y -source='STEP 3 URL' other options See options you can pass to upgrade. See best practices for scripting. Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey.

For Visual Studio 2010, the last supported version is v0.8.1.

For Visual Studio 2005/2008, the last supported version is v0.4.3.

Codemaid

Links

Project home, Documentation, News: www.codemaid.net
Download, Reviews: Visual Studio Marketplace

Code, Issues: GitHub
Continuous Integration: AppVeyor

Twitter @codemaid: Twitter

Features

Code Cleaning

Cleanup random white space into a simple standard order. Add unspecified access modifiers. Utilize Visual Studio’s built-in formatting capabilities. Remove and sort using statements. And do it all automatically on save or on demand, from an individual file to the entire solution.

Codemaid c#

Code Digging

Visualize and navigate through the contents of your C# and C++ files from a tree view hierarchy. Quickly switch between different sorting methods to get a better overview. Drag and drop to reorganize the code. See McCabe complexity scores and informative tooltips.

Code Reorganizing

Latehomecomer book. Reorganize the layout of members in a C# file to follow Microsoft’s StyleCop convention, or your own preferences. Automatically generate regions to match. Boxcryptor chrome. Run on demand or automatically during cleanup.

Comment Formatting

Format comments to wrap at a specified column and arrange tags on separate lines. Run on demand or automatically during cleanup.

Joining

Join two adjacent lines, or a highlighted section of code onto a single line.

Finding

Find the current file in the solution explorer window.

Sorting

Sort a highlighted section of code alphabetically.

Collapsing

Recursively collapse nodes or the entire tree in the solution explorer window.

Progressing

View the overall progress of a build within Visual Studio, or in the Windows taskbar, both with a green/red status indication.

Configuring

Enable, modify or disable many of the aspects of how CodeMaid does its work.

Switching

Switch between related files, such as cpp and header files or xaml and code-behind.

Toggling

Toggle read-only state of files without jumping into the windows explorer.

and More!

Remove regions, close read-only files, etc.

Cyclomatic Complexity in .NET Core

Cyclomatic complexity is a simple code metric, commonly used to identify complex methods which are difficult to maintain and therefore good candidates for refactoring. It is one of the five code metrics built into Visual Studio 2017.

Surprisingly, the code metrics feature in Visual Studio 2017 (version 15.7) isn't available for .NET Core and .NET Standard projects. If you try to generate code metrics for an unsupported project type, the command won't be available.

If you generate them for the full solution instead, unsupported projects will be skipped with the following error:

One or more projects were skipped. Code metrics are available only for C#, Visual Basic, and C++/CLI projects that are not Web Site projects.

Let's look at third party extensions which you can use instead.

Codemaid

NDepend

NDepend is probably the most advanced static code analysis tool for .NET, therefore it was my first choice when looking for alternatives. Of course, cyclomatic complexity is one of many supported code metrics. It will be calculated as part of the default analysis configuration.

The cyclomatic complexity value is also included in calculations for default project rules, such as the Avoid methods too big, too complex in the Code Smells group. Thanks to its most recognizable Code Query over LINQ feature, you can easily include it in your own rules and queries as well.

Codemaid For Visual Studio

ReSharper

ReSharper used to be the must-have extension for many .NET developers until the introduction of Roslyn compiler services with Visual Studio 2015 when many of its features were built directly into Visual Studio or provided by other free extensions.

Although there are many code inspections built into ReSharper, cyclomatic complexity isn't one of them. However, you can install a free plugin to add the functionality. After installing it (and restarting Visual Studio), the metrics value will be displayed inside the tooltip for each method name.

The threshold value for triggering a warning can be configured in ReSharper Options for Code Inspection. Sim city 5 free download mac.

CodeRush

The other large Visual Studio extension from the era before Roslyn was CodeRush. Unlike ReSharper, it was rewritten since then to take advantage of code analysis provided by Roslyn. In its latest version, cyclomatic complexity is one of the three code metrics available. You can choose to display the value for one of them in front of every method.

You can globally enable or disable the display of code metrics values in CodeRush Quick Setup options window.

CodeMaid

I haven't heard about CodeMaid until I started searching for extensions with support for cyclomatic complexity. It's a free open source extension for cleaning up and reorganizing code. Cyclometric complexity is displayed in the CodeMaid Spade treeview for code navigation.

In CodeMaid options window, warning and alert threshold values for cyclomatic complexity can be set. Based on those, the value in CodeMain Spade will be rendered in a different color.

Continuous Integration

So far, I have described how cyclomatic complexity values are presented in Visual Studio during development. If you would like to calculate the code metrics as part of continuous integration on the build server, there's even less choice. Only two extensions have command line support:

  • NDepend includes a fully featured command line version which can be used from any build server. Instructions are provided for using it with many of them. In a previous blogpost, I explored its integration with TeamCity.

  • ReSharper has a free command line tool for running code inspections on a build server. Support for extensions is incomplete and poorly documented. However, it seems that the cyclomatic complexity plugin can be used with it.

Summary

Codemaid Visual Studio

Let's conclude with an overview of available extensions and their support for cyclomatic complexity.

Codemaid Cleanup

Extension.NET framework.NET Standard.NET CoreContinuous integration
Visual Studio 2017YesNoNoNo
NDependYesYesYesYes
ReSharperYesYesYesYes
CodeRushYesYesYesNo
CodeMaidYesYesYesNo

If you're looking for a solution to use inside Visual Studio 2017 during development, your options are ReSharper, CodeRush and CodeMaid. If you aren't using any of them yet, start with CodeMaid which is the only one available for free. Otherwise, just enable the feature in the extension you're already using. It won't cost you anything extra and will cause the smallest performance hit.

In continuous integration scenarios, your best choice is NDepend. It's not cheap, but it will be worth the price if you take advantage of the many features it provides. If you're really looking only for cyclomatic complexity, you could try getting ReSharper command line tool to work, but don't expect it to add a lot of value to your build process.