This is an Apache Maven project. Run mvn test
to
run your tests. JUnit is provided as dependency.
Law Of Demeter: Principle of Least Knowledge.
PMD contains a rule LawOfDemeter
to check code for compliance with Law Of Demeter.
This project is set up to check the code using the Maven PMD Plugin on each mvn test
.
You can also check the rules on their own with mvn pmd:check
.
By using the Maven Shell the time to run the check can be reduced by 50%.
In Eclipse, use Run As/Maven build...
and see the violations in the Console:
In IntelliJ IDEA, use Maven Projects/Plugins/pmd/pmd:check
and see the violations in the Console:
Obviously code analysis cannot find everything.
You can use // NOPMD
line comments and @SuppressWarnings("PMD.LawOfDemeter")
annotations to suppress false positives.
Use your good judgement. The goal is to follow the law, not to suppress it.
This work is licensed under a 3-Clause BSD License, see LICENSE
in repository.