Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
cr2checkstyle
Advanced tools
Convert complexity-report data to Checkstyle XML
This purpose of this command line tool is to convert the JSON output of complexity-report to Checkstyle-compatible XML.
cr2checkstyle reads from stdin
and writes to stdout
:
$ cr --format json --output report.json .
$ cr2checkstyle < report.json > report.xml
Or simply use piping:
$ cr --format json . | cr2checkstyle > report.xml
cr2checkstyle always terminates with an exit code of 0 (unless an internal error occurred), even if the generated checkstyle report contains items with severity "error". To change this behaviour use the --exit-code
option.
By default, cr2checkstyle has no thresholds set so it will not generate any warnings or errors. Currently supported metrics are cyclomatic complexity, halstead difficulty and the maintainability index. The corresponding command line options are:
module-maintainability
module-cyclomatic-complexity
function-cyclomatic-complexity
module-halstead-difficulty
function-halstead-difficulty
Thresholds are given as a low and high watermark. Values above the high watermark will cause errors, values between the low and high watermark will cause warnings (likewise for higher-is-better metrics such as the maintainability index):
# Check module-level maintainability index:
# 0-80 is an error, 80 to 90 is a warning, above 90 is ok
$ cr2checkstyle --module-maintainability 80,90
# Check function-level cyclomatic complexity:
# 0-2 is ok, 2-4 is a warning, above 4 is an error
$ cr2checkstyle --function-cyclomatic-complexity 2,4
Internally, parameters are parsed with yargs so you can also use environment variables (e.g., CR2CS_FUNCTION_HALSTEAD_DIFFICULTY=3,6
) and the cr2checkstyle
-property in your package.json
.
FAQs
Convert complexity-report data to Checkstyle XML
The npm package cr2checkstyle receives a total of 0 weekly downloads. As such, cr2checkstyle popularity was classified as not popular.
We found that cr2checkstyle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.