code-complexity
Measure the churn/complexity ratio. Higher values mean hotspots where refactorings should happen.
Last updated 24 days ago by simonrenoult .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install code-complexity 
SYNC missed versions from official npm registry.

code-complexity

Measure projects complexity based on files sloc and commit count.

Build Status Coverage Status Style Status NPM Version

Usage

$ npx code-complexity <path-to-git-directory>

Help

    Usage: code-complexity <dir> [options]
    
    Measure the churn/complexity ratio. Higher values mean hotspots where refactorings should happen.
    
    Options:
      -V, --version          output the version number
      --filter <strings>     list of globs (comma separated) to filter
      -f, --format [format]  format results using table or json
      -l, --limit [limit]    limit the number of files to output
      -i, --since [since]    limit the age of the commit analyzed
      -s, --sort [sort]      sort results (allowed valued: ratio,
                             churn, complexity or file)
      -h, --help             display help for command
    
    Examples:
    
    $ code-complexity <dir>
    $ code-complexity <dir> --limit 3
    $ code-complexity <dir> --sort ratio
    $ code-complexity <dir> --filter 'src/**','!src/front'
    $ code-complexity <dir> --limit 10 --sort ratio

Output

$ npx code-complexity . --sort=ratio --limit=3

┌──────────────────────────────┬────────────┬───────┬───────┐
│ file                         │ complexity │ churn │ ratio │
├──────────────────────────────┼────────────┼───────┼───────┤
│ src/cli.ts                   │ 103        │ 8     │ 824   │
├──────────────────────────────┼────────────┼───────┼───────┤
│ test/code-complexity.test.ts │ 107        │ 7     │ 749   │
├──────────────────────────────┼────────────┼───────┼───────┤
│ .idea/workspace.xml          │ 123        │ 6     │ 738   │
└──────────────────────────────┴────────────┴───────┴───────┘

Troubleshooting

  • Error: stdout maxBuffer exceeded: use the flag --since to limit the number of commits to analyze.

Current Tags

  • 4.0.1                                ...           latest (24 days ago)

20 Versions

  • 4.0.1                                ...           24 days ago
  • 4.0.0                                ...           24 days ago
  • 3.3.2                                ...           2 months ago
  • 3.3.0                                ...           2 months ago
  • 3.2.0                                ...           2 months ago
  • 3.0.3                                ...           2 months ago
  • 3.0.2                                ...           2 months ago
  • 3.0.1                                ...           2 months ago
  • 3.0.0                                ...           2 months ago
  • 2.1.3                                ...           3 months ago
  • 2.1.2                                ...           2 years ago
  • 2.1.1                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.1.3                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 29
Last Day 0
Last Week 0
Last Month 17
Dependencies (6)
Dev Dependencies (20)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |