npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sabik

v0.2.4

Published

Source code metrics tool.

Downloads

1,193

Readme

Sabik

This project is under development.

Please feel free to PullRequest and Issue.


ci-build Known Vulnerabilities Coverage Badge LogicalLineOfCode(Average per method) CognitiveComplexity(Max) Maintainability(Min)

Visualize source code complexity with Sabik. This tool is to find the bad smell code. I think your helpful refactoring.

If you want to see what it looks like, click here.

Basic Using

Please use Node.js >= 14.

If you use Node.js 14 or less, please use version 0.2.0.

$ npx sabik /target/path

Local installation

If you felt sabik is slow, using local installation.

$ npm i -g sabik

Using sabik with local installed

$ sabik /target/path

Help

USAGE
  $ sabik [TARGET]

OPTIONS
  -h, --help                               show CLI help

  -o, --outputReportPath=outputReportPath  output report path.
                                                 For HTML, specify the directory, and for JSON, specify the file.

  -t, --outputFormat=(HTML|JSON)           [default: HTML] output report format. HTML or JSON. default: HTML

  -v, --version                            show CLI version

  --excludes=excludes                      [default: $^] exclude patterns. example: .test.ts$ .spec.ts$

  --matches=matches                        [default: .*] match patterns. example: .ts$

Support Programming Language

  • TypeScript
  • JavaScript
  • PHP

For now.

What analyzable metrics?

Sabik analyzable metrics are following.

  • Cyclomatic Complexity
  • Cognitive Complexity
  • Halstead complexity measures
  • Line of Code(Logical, Physical)
  • Maintainability

For now.

Cyclomatic Complexity

Cyclomatic Complexity is metrics for linearly independent paths count. Made Thomas McCabe. High is bad, low is good metrics. Higher when your code has a deep nest. It’s very tiresome add test when over 8 scores. (In my experience)

If you want to know more about the detail, please see the following.

CyclomaticComplexity

Cognitive Complexity

Cognitive Complexity is metrics for human readability. Made SonarSource inc. High is bad, low is good metrics. Higher when your code has a deep nest. It’s read very hard when over 8 scores. (In my experience)

If you want to know more about the detail, please see the following.

CognitiveComplexity

Halstead complexity measures

Halstead complexity measures are metrics for a difficulty to understand. Made Maurice Howard Halstead. High is bad, low is good metrics. Higher when your code has many responsibilities. These metrics are judge difficulty from vocabulary size, for example, the newspaper is difficult but, children's book is easy to understand.

If you want to know more about the detail, please see the following.

Halstead complexity measures

Line of Code(Logical, Physical)

Physical Line of Code is metrics for line count include comments. Logical Line of Code is metrics for line count ignored comments. High is bad, low is good metrics.

Maintainability

Maintainability is metric for software maintainability. Made Microsoft inc. Low is bad, High is good metrics. This metric ranges from 0 ~ 100. It’s maintenance hard when under 60 scores. (In my experience)

If you want to know more about the detail, please see the following.

Maintainability

License

Copyright (c) 2020 Tetsuro Yoshikawa Licensed under the MIT license.