
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
jscheckstyle
Advanced tools
Static analysis tool for javascript - calculates cyclomatic complexity, amongst other things
Supply Chain Security
Vulnerability
Quality
Maintenance
License
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
A command-line tool for analysing javascript source, providing measurements of function length, number of arguments, and cyclomatic complexity.
NOTE: jshint now does most of these checks, http://www.elijahmanor.com/2012/09/control-complexity-of-your-javascript.html so you may not need this any more. Use jshint instead, it checks for a whole load of other things as well.
npm install jscheckstyle
jscheckstyle some-javascript.js some-other-javascript.js (default output as nice table on command line)
jscheckstyle --violations some-javascript.js (will output rule-violating functions only)
jscheckstyle --html some-javascript.js > output.html
jscheckstyle --json some-javascript.js > output.json
jscheckstyle --checkstyle some-javascript.js > output.xml (will output Java checkstyle-compatible output, useful for Jenkins)
jscheckstyle --emacs some-javascript.js (produces output suitable for Emacs flymake - see flymake-jschecksyle.el)
There are three rules at the moment which will be violated if:
To exclude certain directories or files from being checkstyled, simply create a .jscheckstyleignore file at current directory, and specify the directory or file name (relative to current directory) that you want to exclude.
It is possible to change the default rules by specifying different limits in comments before a function.
For example:
/*
* @jscheckstyle.functionLength=20
* @jscheckstyle.numberOfArguments=10
* @jscheckstyle.cyclomaticComplexity=30
*/
function theFunction() {
...
}
Originally I started out modifying jsmeter to run as a command-line tool. Then I started hacking away, added some tests, the command-line interface, added the rules checking and the extra output types, replaced the parser with node-burrito and then realised there wasn't much of jsmeter left. So this tool is inspired by, and owes a huge debt to, jsmeter - but there's very little of the original code to be found (possibly only the HTML output renderer).
FAQs
Static analysis tool for javascript - calculates cyclomatic complexity, amongst other things
We found that jscheckstyle 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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.