Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Code analyzer: FindBugs and PMD

Introduce two tools of Code analyzer

  • Login to see the comments

  • Be the first to like this

Code analyzer: FindBugs and PMD

  1. 1. Code Analyzer: FindBugs and PMD 2012/6/7 John
  2. 2. Agenda ● FindBugs ○ How to install ○ How to work ○ Configuration ● PMD ○ How to install ○ How to work ○ Configuration ●
  3. 3. FindBugs FindBugs™ is a program to find bugs in Java programs. It looks for instances of "bug patterns" --- code instances that are likely to be errors.
  4. 4. How to install For eclipse: 1. install:
  5. 5. How to work
  6. 6. Configuration
  7. 7. PMD PMD scans Java source code and looks for potential problems like: ● Possible bugs - empty try/catch/finally/switch statements ● Dead code - unused local variables, parameters and private methods ● Suboptimal code - wasteful String/StringBuffer usage ● Overcomplicated expressions - unnecessary if statements, for loops that could be while loops ● Duplicate code - copied/pasted code means copied/pasted bugs
  8. 8. How to install For eclipse: 1. install:
  9. 9. How to work
  10. 10. Configuration Level Filter: Rule Configuration: Window->Preferences->PMD->Rule Configuration

×