Live data from Hacker News

PMD source code analyzer

pmd.github.io

11–20 of 36 posts

Re: PMD source code analyzer

#11

Wow, crazy to see this project still alive and thriving. I was using it 10+ years ago when I worked exclusively in Java. It was great to find those "obvious" issues that slip in that you didn't notice when you should of. I think I had it as a SVN pre-commit hook at one point. In fact, the lead dev wrote a book "PMD Applied" and I wrote a review of it: http://caseysoftware.com/blog/book-review-pmd-applied It's since b…

I remember you writing that, thanks Keith!

Re: PMD source code analyzer

#12
post #3

Since it is not on the front page and probably everybody wants to know. Here is what it claims to do. "PMD scans source code in Java and other languages 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…

At one point Sven Jacob added some data flow analysis. It was interesting stuff; I feel like we could have taken that a lot further. But anyhow, the combination of PMD and FindBugs can find quite a few bugs that would be hard to track down otherwise.

Re: PMD source code analyzer

#13
I've checked out Coala, I've been using FindBugs and SonarQube in the past, and sadly, all of the solutions I've seen miss support for Lisp language family. I could use some kind of linter for my Common Lisp code.

Re: PMD source code analyzer

#15
post #4

I'm not sure why this is on the frontpage since PMD (like Checkstyle and FindBugs) has been around for years. Still If your not familiar with PMD you should take a look. Anyway these days you probably want to invest in setting up SonarQube which is a superior tool in many ways (multi-language code analysis with webbassd dashboard etc)

Yes agreed. FindBugs appears to be kind of defunct anyway; there hasn't been a release since 2015 and the main developer isn't working on it any more. SonarSource has been gradually dropping the PMD and FindBugs rules from SonarQube and writing their own replacements.

Re: PMD source code analyzer

#16
post #14
post #8

Here's a shameless plug for https://coala.io/ which is a sort of a meta-linter — coala can run PMD on your code along with ~100 other linters and code checkers.

If you're a Go programmer, there's a Go-specific metalinter: https://github.com/alecthomas/gometalinter

[deleted]

Re: PMD source code analyzer

#17
post #14
post #8

Here's a shameless plug for https://coala.io/ which is a sort of a meta-linter — coala can run PMD on your code along with ~100 other linters and code checkers.

If you're a Go programmer, there's a Go-specific metalinter: https://github.com/alecthomas/gometalinter

This seems especially useful when you don't want to think about how to set up linting, and what rules you want to use. There's a similar tool for Python, called prospector: https://github.com/landscapeio/prospector

With coala you need to configure which linters run on which files, and we recognize this as a thing we can improve upon. We're soon going to ship a feature which will allow configuration to just specify where the files are (e.g. 'src/*.py') and what aspects to check (e.g. 'syntax,smells,duplication,security'). Then coala will decide which tools are appropriate, get them from pip/npm/wherever, and run them.

Re: PMD source code analyzer

#18
post #8

Here's a shameless plug for https://coala.io/ which is a sort of a meta-linter — coala can run PMD on your code along with ~100 other linters and code checkers.

Well, I guess I don't need to worry about open sourcing my meta linter but instead look into adopting this.

Drat, I liked the name "Red Herring".

Re: PMD source code analyzer

#19

I've checked out Coala, I've been using FindBugs and SonarQube in the past, and sadly, all of the solutions I've seen miss support for Lisp language family. I could use some kind of linter for my Common Lisp code.

Hey, would it help you if we were to include https://github.com/fukamachi/sblint in coala? Do you know other tools? We could easily integrate them using https://api.coala.io/en/latest/Developers/Writing_Linter_Bea... if there's concrete interest
Post reply on HN