KoningJasper / core-metrics

A static analyzer extension for vscode and .NET Core.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

core-metrics

A static analyzer extension for vscode and .NET Core. Allows you to quickly spot and fix problem areas in your code and to see code quality changes on the fly. Core-metrics is build on top of the excellent roslyn-analyzer.

NOTE: Currently core-metrics only works on windows since bundled roslyn-analyzer files are windows only.

Metrics

The following metrics are calculated and treshholds can be set for these metrics.

  • Cyclomatic Complexity: Maximum cyclomatic complexity, cyclomatic complexity indicates the number of possible branches in the control flow (if, switch/case, for- and while-loop statements.
  • Class Coupling: Maximum (external) classed coupled in this method.
  • Depth of Inheritance: Maximum depth of inheritance.
  • Lines of Code: Maximum lines of code in a single method.
  • Maintainability Index: Minimum requirement of maintainability. Based on Halstead volume, class coupling. Between 0 and 100, 100 being the best possible score.

Settings

Settings can be set in the regular settings panel. File -> Preferences -> Settings. The settings for core-metrics can than be found by searching for coremetrics or by selecting Extensions->Core Metrics Extension in the treeview. The threshold values for flagging warnings can be set there.

By default (Entity-Framework) migrations are excluded by excluding the Migrations folder, this can be changed in the coreMetrics.excludedFolders setting.

References

This project is based on the roslyn-analyzer.

About

A static analyzer extension for vscode and .NET Core.

License:Mozilla Public License 2.0


Languages

Language:TypeScript 100.0%