codeclimate / codeclimate-pmd

13 stars 7 forks source link

Adds support for Apex classes (Salesforce) #29

Closed kevinohara80 closed 5 years ago

kevinohara80 commented 5 years ago

Currently, Salesforce developers cannot use CodeClimate despite CodeClimate having PMD as a plugin. This is because the PMD plugin filters out all files that are not Java (.java). This patch allows for the Apex class extension to be processed as well (.cls).

Related to #26

oded-rosi-samanage commented 5 years ago

Hey @kevinohara80 , Unfortunately we were using the pmd module in CodeClimate and it stopped working after this merge. right now I can read the issue is that the .cls file is missing from the project, although they exist in the repo (just referenced to another place in the project). engine

After some reading i got to the ApexMetrics module, which should be discontinued shortly It seemed to be working for over 6 months (at least) on the apex classes in git, without using the ApexMetrics module (I wasn't even aware of it).

Please advice

filipesperandio commented 5 years ago

Hey @oded-rosi-samanage, if I understood the problem correctly, I believe you could fix the problem by adding an exclude_pattern configuration to you .codeclimate.yml config. You can add any kind of exclusion for an specific plugin, it could be all .cls files, or specific ones (for example, files causing problems by referring to others not reachable by the analysis):

plugins:
  pmd:
    enabled: true
    exclude_patterns:
      - "**/*.cls"
oded-rosi-samanage commented 5 years ago

Thanks for the quick answer @filipesperandio , it does work as expected