Code Analysis - Day 4 Flashcards

1
Q

Source code analysis tools

A

Identify violations in code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly