Qlty fully supports the JavaScript programming language.

Linters

LinterDescription
ESLintPluggable linter for JavaScript, TypeScript, and JSX
BiomeJavaScript linter implemented in Rust for speed
OXCJavaScript linter written in Rust as part of the Oxidation Compiler
SemgrepMulti-language, pattern-based static analysis tool
KnipUnused code detection tool for JavaScript and TypeScript

Auto-formatters

Auto-formatterDescription
PrettierOpinionated code formatter
BiomeJavaScript formatter implemented in Rust for speed

Note: It is important to choose a single auto-formatter to avoid conflicts between formatters.

Security scanners

NameNotes
ESLintExtensible with security rules e.g. eslint-plugin-security
Semgrep OSSMulti-language, pattern-based static analysis tool
OSV-ScannerScans for CVE vulnerabilities in NPM packages
TrivyScans for CVE vulnerabilities in NPM packages
TruffleHogScans for secrets in source code files
GitleaksScans for secrets in source code files

Code metrics

MetricDescription
Lines of CodeNumber of non-whitespace, non-comment lines in a file
ClassesNumber of total classes
FunctionsNumber of total functions
FieldsNumber of total fields
ComplexityAn estimate of how difficult the code is to understand
Cyclomatic complexityNumber of linearly independent paths through a function
LCOM4Lack of cohesion in methods
DuplicationSimilar or identical blocks of repeated code

Code smells

Qlty detects the following code maintainability smells in JavaScript code:

  1. Similar code
  2. Identical code
  3. Many function parameters
  4. Complex boolean logic
  5. High file complexity
  6. High function complexity
  7. Deeply nested control flow
  8. Many return statements

Code coverage

Test runners

  • Jest
  • Vitest
  • Mocha

Coverage formats

  • LCOV

See also