Sabik
Visualize source code complexity with Sabik. This tool is to find the bad smell code. I think your helpful refactoring.
Install / Use
/learn @ytetsuro/SabikREADME
This project is under development.
Please feel free to PullRequest and Issue.
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.
<!-- toc --> <!-- tocstop -->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.
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.
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.
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.
License
Copyright (c) 2020 Tetsuro Yoshikawa Licensed under the MIT license.
Related Skills
Writing Hookify Rules
110.4kThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
review-duplication
100.5kUse this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to reuse existing project best practices and shared utilities.
feishu-drive
350.8k|
things-mac
350.8kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)

