πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
Sign inDemoInstall
Socket

code-complexity

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-complexity

Measure the churn/complexity ratio. Higher values mean hotspots where refactorings should happen.

4.0.0
Source
npm
Version published
Weekly downloads
1.8K
-33.98%
Maintainers
1
Weekly downloads
Β 
Created
Source

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.

Keywords

quality

FAQs

Package last updated on 03 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts