What are the differences between PMD and FindBugs?

后端 未结 3 2045
醉酒成梦
醉酒成梦 2020-12-22 20:19

There was a question comparing PMD and CheckStyle. However, I can\'t find a nice breakdown on the differences/similarities between PMD and FindBugs. I believe a key differen

3条回答
  •  不思量自难忘°
    2020-12-22 21:12

    The best feature of PMD, is its XPath Rules, bundled with a Rule Designer to let you easily construct new rules from code samples (similar to RegEx and XPath GUI builders). FindBugs is stronger out of the box, but constructing project specific rules and patterns is very important.

    For example, I encountered a performance problem involving 2 nested for loops, resulting in a O(n^2) running time, which could easily be avoided. I used PMD to construct an ad-hoc query, to review other instances of nested for loops - //ForStatement/Statement//ForStatement. This pointed out 2 more instances of the problem. This is not a generic rule whatsoever.

提交回复
热议问题