All Projects → dart-code-checker → Dart Code Metrics

dart-code-checker / Dart Code Metrics

Licence: mit
Software analytics tool that helps developers analyse and improve software quality.

Programming Languages

dart
5743 projects
dartlang
94 projects

Projects that are alternatives of or similar to Dart Code Metrics

Horusec
Horusec is an open source tool that improves identification of vulnerabilities in your project with just one command.
Stars: ✭ 311 (+223.96%)
Mutual labels:  analysis, cli, ci
Hiper
🚀 A statistical analysis tool for performance testing
Stars: ✭ 2,667 (+2678.13%)
Mutual labels:  analysis, cli, tool
Phpinsights
🔰 Instant PHP quality checks from your console
Stars: ✭ 4,442 (+4527.08%)
Mutual labels:  quality, cli, tool
Wallace Cli
Pretty CSS analytics on the CLI
Stars: ✭ 281 (+192.71%)
Mutual labels:  analysis, cli, metrics
Sonar Java
☕️ SonarSource Static Analyzer for Java Code Quality and Security
Stars: ✭ 745 (+676.04%)
Mutual labels:  analysis, quality, analyzer
Pizza Cli
🍕 Order a pizza in a CLI app (just for fun!)
Stars: ✭ 58 (-39.58%)
Mutual labels:  cli, tool
Fsq
A tool for querying the file system with a SQL-like language.
Stars: ✭ 60 (-37.5%)
Mutual labels:  cli, tool
Matrix Commander
simple but convenient CLI-based Matrix client app for sending and receiving
Stars: ✭ 90 (-6.25%)
Mutual labels:  cli, tool
Image To Xls
A simple tool to make ascii art from an image using excel colored cells.
Stars: ✭ 75 (-21.87%)
Mutual labels:  cli, tool
Wait4x
Wait4X is a cli tool to wait for everything! It can be wait for a port to open or enter to rquested state.
Stars: ✭ 30 (-68.75%)
Mutual labels:  cli, tool
Neutron
Neutron is a CLI developed to help developers create new react projects with Redux + Redux Saga and offers well-structured code standardization.
Stars: ✭ 65 (-32.29%)
Mutual labels:  cli, tool
Nostromo
CLI for building powerful aliases
Stars: ✭ 76 (-20.83%)
Mutual labels:  cli, tool
Lucid
A simple mock-application for programs that work with child processes
Stars: ✭ 45 (-53.12%)
Mutual labels:  cli, tool
Social Analyzer
API, CLI & Web App for analyzing & finding a person's profile across +1000 social media \ websites (Detections are updated regularly by automated systems)
Stars: ✭ 8,449 (+8701.04%)
Mutual labels:  analyzer, analysis
Kube Score
Kubernetes object analysis with recommendations for improved reliability and security
Stars: ✭ 1,128 (+1075%)
Mutual labels:  analysis, ci
I Codecnes
i-Code CNES is a static code analysis tool to help developpers write code compliant with CNES coding rules.
Stars: ✭ 33 (-65.62%)
Mutual labels:  analysis, metrics
Andes
Python toolbox / library for power system transient dynamics simulation with symbolic modeling and numerical analysis 🔥
Stars: ✭ 68 (-29.17%)
Mutual labels:  analysis, tool
Codecharta
CodeCharta visualizes multiple code metrics using 3D tree maps.
Stars: ✭ 85 (-11.46%)
Mutual labels:  metrics, analyzer
Pancancer
Building classifiers using cancer transcriptomes across 33 different cancer-types
Stars: ✭ 84 (-12.5%)
Mutual labels:  analysis, tool
Fileinfo
📄Get information on over 10,000 file extensions right from the terminal
Stars: ✭ 86 (-10.42%)
Mutual labels:  cli, tool

Dart code metrics

Build Status Coverage Status License Pub Version Dart SDK Verison Dart Platform

Dart code metrics is a static analysis tool that helps improve code quality. It analyzes code metrics and provides additional rules for dart analyzer. Can be used as a command line tool, analyzer plugin or library.

Reports:

Output formats:

  • Plain terminal
  • GitHub
  • Codeclimate
  • HTML
  • JSON

Usage

Analyzer plugin

A plugin for the Dart analyzer library package providing additional rules from Dart code metrics.

  1. Add dependency to pubspec.yaml

    dev_dependencies:
      dart_code_metrics: ^2.4.1
    
  2. Add configuration to analysis_options.yaml

    analyzer:
      plugins:
        - dart_code_metrics
    
    dart_code_metrics:
      anti-patterns:
        - long-method
        - long-parameter-list
      metrics:
        cyclomatic-complexity: 20
        lines-of-executable-code: 50
        number-of-arguments: 4
        maximum-nesting: 5
      metrics-exclude:
        - test/**
      rules:
        - newline-before-return
        - no-boolean-literal-compare
        - no-empty-block
        - prefer-trailing-comma
        - prefer-conditional-expressions
        - no-equal-then-else
    
    

Command line tool

Simple usage

pub global activate dart_code_metrics
metrics lib

Flutter usage

flutter pub global activate dart_code_metrics
flutter pub global run dart_code_metrics:metrics lib

Full usage

Usage: metrics [options...] <directories>
-h, --help                                             Print this usage information.


-r, --reporter=<console>                               The format of the output of the analysis
                                                       [console (default), github, json, html, codeclimate]
    --verbose                                          Additional flag for Console reporter
    --gitlab                                           Additional flag for Code Climate reporter to report in GitLab Code Quality format
-o, --output-directory=<OUTPUT>                        Write HTML output to OUTPUT
                                                       (defaults to "metrics")


    --cyclomatic-complexity=<20>                       Cyclomatic complexity threshold
    --lines-of-executable-code=<50>                    Lines of executable code threshold
    --number-of-arguments=<4>                          Number of arguments threshold
    --number-of-methods=<10>                           Number of methods threshold
    --maximum-nesting=<5>                              Maximum nesting threshold


    --root-folder=<./>                                 Root folder
                                                       (defaults to current directory)
    --ignore-files=<{/**.g.dart,/**.template.dart}>    Filepaths in Glob syntax to be ignored
                                                       (defaults to "{/**.g.dart,/**.template.dart}")


    --set-exit-on-violation-level=<warning>            Set exit code 2 if code violations same or higher level than selected are detected
                                                       [noted, warning, alarm]

If you want command line tool to check rules, you should add configuration to your analysis_options.yaml as listed in Analyzer plugin usage example.

Library

See example/example.dart

Anti-Patterns

Rules

Rules are grouped by category to help you understand their purpose.

Right now auto-fixes are available through an IDE context menu (ex. VS Code Quick Fix).

Common

Intl specific

Angular specific

Contributing

If you are interested in contributing, please check out the contribution guidelines. Feedback and contributions are welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].