Codemetrics for Dart is a simple command line utility that provides some insight into the "quality" of code.
It uses static analysis of the code to determine:
and provides different reporting serialization formats:
For now, there is no pub package for this project, so you have to clone it
git clone https://github.com/daniel-v/codemetrics.git cd codemetrics pub get cd bin; dart codemetrics.dart --analysis-root=/path/to/your/package
You can also install it as a global package:
pub global activate --source git https://github.com/daniel-v/codemetrics.git
Executable name is
For html output use the --report-format=html and for JSON use --report-format=json. A full command could look like this:
dart bin/codemetrics.dart --analysis-root=/path/to/your/package --report-format=html > /tmp/test.html
There are number of areas you can contribute to this project:
For a high level overview of what CodeMetrics is, please read README.md
codemetricsnow. Command line usage:
pub global run codemetricsor
dart-codemetricsif Pub's bin folder is added to PATH
Please keep in mind, this is the first preview release of the software, things might break or might not function as intended
You can install the package from the command line:
$ pub global activate codemetrics
The package has the following executables:
Add this to your package's pubspec.yaml file:
dependencies: codemetrics: ^1.0.0-alpha+1
You can install packages from the command line:
$ pub get
Alternatively, your editor might support
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|1.0.0-alpha+1||Jul 6, 2018|
|1.0.0-alpha||Jun 2, 2018|
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.
Support Dart 2 in
The SDK constraint in
pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.
dartdoc successfully runs on your package's source files. (-10 points)
Dependencies were not resolved.
|Dart SDK||>=2-0-0-dev <2.0.0|