harmonize code quality for core and modules with codacy

Dear @raff,

I just saw on a core PR https://github.com/openmrs/openmrs-core/pull/1737 that you setup codacy to check the code quality of PRs. Nice :slight_smile:

I just did this myself for the radiology module

Are you going to share your code quality pattern settings? It would be great to handle this like code formatting so we can also harmonize the code quality of modules in general. We could just export the settings as json and put it into the core repo with the formatter xml.

And if so, is there going to be a debate/vote on what patterns we want to adhere to?

We already follow Sonar rules which include FindBugs and CheckStyle. I believe they are pretty standard.

@teleivo, I’m still experimenting and exploring the rules. Once we settle on them I think it’s a good idea to export the rules and version in our repository so that they can be used to configure other projects. As Lluis noted our core code is in a pretty good shape already thanks to fixes we made when introducing Sonar and we should simply match codacy rules with those from Sonar.

I think codacy is a much better tool for our needs than Sonar. It enables pull request checking and is easier to setup than Sonar for individual projects.

For what I see, Codacy uses PMD (Sonar too). But yes the PR integration is pretty nice. PMD has debatable rules, specially the ones about long methods, long classes. Rules that even the Java API violates :slight_smile:

codeclimate.com should work – they released their entire platform

exactly what I mean :slight_smile: modules just cannot use openmrs sonar at the moment, as far as I know. so this would be a great way to get them in line with the core as well

Any advantage over the others?

@raff @teleivo Sonar does support the PR checking feature. Check this out http://docs.sonarqube.org/plugins/servlet/mobile#content/view/5311422

1 Like