Codacy in openmrs-core PRs?

ahh, no need to excuse :slight_smile: thanks!

I dont mind using PMD (FindBugs is currently not supported by codacy or codeclimate) I think you would just need to explain the benefit of it.

My focus is to get the rules enforced in our workflow and therefore clean this up:

Once we really use and adhere to the checkstyle rules (import one checkstyle.xml into codacy) we can also tweak them or switch to another rules engine like PMD. I mean the rules which were defined 6 years ago so they might benefit from changes too. But at first I would really like to finalize the automatic loading of the rules in codacy.

Check accepted answer http://stackoverflow.com/questions/4297014/what-are-the-differences-between-pmd-and-findbugs

I will add that Findbugs finds NPEs that will be surely thrown, and also possible NPEs (fa variable is initialized to null and some execution path does not give it a value).

That’s why they are complementary, PMD does things that Findbugs does not and vice-versa.

Just judging from that post I would say that we would benefit from adding FindBugs to our checks and that checkstyle does what PMD does (of course a more in depth comparison between checkstyle and PMD might show that one is better than the other).

Codacy enterprise supports FindBugs, but its not supported for open source projects.

Anyway I think we should simply start with checkstyle rules synced to codacy https://issues.openmrs.org/browse/TRUNK-5080

You can create a ticket for FindBugs with your thoughts on how this can be integrated.

I think I found a solution :slight_smile:

I was able to inline the location of the checkstyle-suppressions.xml into the checkstyle.xml

Can someone please have a look at

Not sure if anyone did that but you can run the checks locally with

mvn checkstyle:checkstyle

which will create checkstyle-result.xml files in the target directories.

The important aspect: PR brings a single checkstyle.xml in the root with a link to the checkstyle-suppressions.xml (which now exempts test classes from the rule preventing underscores in method names)

If you think thats a good solution, please merge :smile: and then I’ll import the checkstyle.xml into codacy.