Static Analysis

TEAMMATES uses static analysis tools to maintain code quality. Tool versions are declared in build.gradle and package.json, and rulesets are in the static-analysis/ directory.

Tool stack

Suppressing rules

Rules can be suppressed when necessary. When doing so:

  • Be as specific as possible — suppress only the specific rule and scope (lines/methods/classes) required.
  • Re-enable the rule once the suppression is no longer necessary.
  • Always explain why the rule is being suppressed.

Running static analysis

To run all static analysis tools:

./gradlew lint --continue
npm run lint
Tool name Command
CheckStyle ./gradlew checkstyleMain, ./gradlew checkstyleTest
PMD ./gradlew pmdMain, ./gradlew pmdTest
SpotBugs ./gradlew spotbugsMain, ./gradlew spotbugsTest
ArchUnit ./gradlew architectureTest
ESLint npm run lint:ts
stylelint npm run lint:css:syntax
prettier npm run lint:css:styles
lintspaces npm run lint:spaces

gradlew.bat lint --continue
npm run lint
Tool name Command
CheckStyle gradlew.bat checkstyleMain, gradlew.bat checkstyleTest
PMD gradlew.bat pmdMain, gradlew.bat pmdTest
SpotBugs gradlew.bat spotbugsMain, gradlew.bat spotbugsTest
ArchUnit gradlew.bat architectureTest
ESLint npm run lint:ts
stylelint npm run lint:css:syntax
prettier npm run lint:css:styles
lintspaces npm run lint:spaces