Code Analysis - Day 4 Flashcards
1
Q
Source code analysis tools
A
Identify violations in code.
2
Q
PMD
A
Programming Mistake Detector
- detects inefficient code; unused variables, empty switch/if/while, unnecessary object creation, naming conventions, etc.
- detected using set of rules
- rules defined in XML format (.exsd file)
Configure PMD with rules prior to use
3
Q
Configuration
A
Through >window > preferences > PMD > Rule configuration > select default existing rules > click on import rule set > import by copy > select rules and click okay
4
Q
Configured PMD RULES
A
Class naming: Pascal case Variable naming: camal case Method naming: camal case Package case: lowercase System.out.PrintIn should only be in main method Unused imports should not be present