Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET 5 Code Analyzer Recommendation [closed]

We're building a new ASP.NET 5 application (currently using RC1) which also has some ASP.NET 5 class library projects attached to it. Looks like the Analyze tool in Visual Studio 2015 doesn't support the new code.

We really want to be able to run some basic analysis e.g. cyclomatic complexity, maintainability, etc. What can we use to analyze our code?

like image 217
Sam Avatar asked Sep 10 '26 06:09

Sam


1 Answers

Have you tried NDepend? It is a commercial .NET code analyzer integrated in Visual Studio. A full-featured 14-day-trial is available for download.

It has built-in support for cyclomatic complexity, proposes many default rules, and lets edit custom code rules as C# LINQ query.

Hence if you want a code rule that checks that you have no method with a cyclomatic complexity higher than 15 for example, you can create it as:

// <Name>Methods too complex</Name>
warnif count > 0
from m in JustMyCode.Methods 
where m.CyclomaticComplexity > 15 
select new { m, m.CyclomaticComplexity }

Disclaimer: I work for NDepend

like image 103
Patrick from NDepend team Avatar answered Sep 11 '26 19:09

Patrick from NDepend team



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!