Static Analysis

TEAMMATES uses static analysis tools to maintain code quality. Tool versions are declared in build.gradle and package.json, and rulesets are listed below.

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 format
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:eslint
Stylelint npm run lint:css
Prettier npm run format

gradlew.bat lint --continue
npm run format
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:eslint
Stylelint npm run lint:css
Prettier npm run format