All Projects → rsoesemann → codeclimate-apexmetrics

rsoesemann / codeclimate-apexmetrics

Licence: other
ApexMetrics - Code Climate engine for Salesforce [DISCONTINUED use CC PMD instead)

Programming Languages

shell
77523 projects
groovy
2714 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to codeclimate-apexmetrics

codeclimate-eslint
Code Climate Engine for ESLint
Stars: ✭ 86 (+86.96%)
Mutual labels:  static-code-analysis, linter, codeclimate
static-code-analysis-plugin
A plugin to simplify Static Code Analysis on Gradle. Not restricted to, but specially useful, in Android projects, by making sure all analysis can access the SDK classes.
Stars: ✭ 36 (-21.74%)
Mutual labels:  static-code-analysis, linter, pmd
Pmd
An extensible multilanguage static code analyzer.
Stars: ✭ 3,667 (+7871.74%)
Mutual labels:  static-code-analysis, linter, apex
healthier
🧘‍♀️ Healthier is an opinionated style agnostic code linter – a friendly companion to Prettier
Stars: ✭ 78 (+69.57%)
Mutual labels:  static-code-analysis, linter
Sonar Pmd
☕️ PMD Plugin for SonarQube
Stars: ✭ 139 (+202.17%)
Mutual labels:  static-code-analysis, pmd
Rubocop
A Ruby static code analyzer and formatter, based on the community Ruby style guide.
Stars: ✭ 11,593 (+25102.17%)
Mutual labels:  static-code-analysis, linter
Eslint Config Standard Jsx
ESLint Shareable Config for JSX support in JavaScript Standard Style
Stars: ✭ 79 (+71.74%)
Mutual labels:  static-code-analysis, linter
Eslint Config Standard
ESLint Config for JavaScript Standard Style
Stars: ✭ 2,229 (+4745.65%)
Mutual labels:  static-code-analysis, linter
Bento
[DEPRECATED] Find Python web-app bugs delightfully fast, without changing your workflow. 🍱
Stars: ✭ 147 (+219.57%)
Mutual labels:  static-code-analysis, linter
Sputnik
Static code review for your Gerrit patchsets. Runs Checkstyle, PMD, FindBugs, Scalastyle, CodeNarc, JSLint for you!
Stars: ✭ 189 (+310.87%)
Mutual labels:  static-code-analysis, pmd
Whispers
Identify hardcoded secrets and dangerous behaviours
Stars: ✭ 66 (+43.48%)
Mutual labels:  static-code-analysis, linter
Abaplint
Standalone linter for ABAP
Stars: ✭ 111 (+141.3%)
Mutual labels:  static-code-analysis, linter
Unimport
A linter, formatter for finding and removing unused import statements.
Stars: ✭ 96 (+108.7%)
Mutual labels:  static-code-analysis, linter
universalmock
A universal mock class in Apex
Stars: ✭ 55 (+19.57%)
Mutual labels:  salesforce, apex
Rubberduck
Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
Stars: ✭ 1,287 (+2697.83%)
Mutual labels:  static-code-analysis, linter
Cflint
Static code analysis for CFML (a linter)
Stars: ✭ 156 (+239.13%)
Mutual labels:  static-code-analysis, linter
Spotbugs
SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.
Stars: ✭ 2,569 (+5484.78%)
Mutual labels:  static-code-analysis, linter
Revive
🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
Stars: ✭ 3,139 (+6723.91%)
Mutual labels:  static-code-analysis, linter
Warnings Ng Plugin
Jenkins Warnings Plugin - Next Generation
Stars: ✭ 248 (+439.13%)
Mutual labels:  static-code-analysis, pmd
Kube Score
Kubernetes object analysis with recommendations for improved reliability and security
Stars: ✭ 1,128 (+2352.17%)
Mutual labels:  static-code-analysis, linter

DISCONTINUED - This Salesforce-only PMD engine will not be updated anymore. Help make https://github.com/codeclimate/codeclimate-pmd available for all languages. Not Java-only.

ApexMetrics - Code Climate engine for Salesforce.com Apex

ApexMetrics is a Code Climate engine for the programming language Apex of the Salesforce.com cloud platform.

If you connect your Github repositories to Code Climate and enable the Engine static code analysis is performed on every commit or pull request. The resulting continuous metrics will tell you where code improved or degraded over time and which hot spots need refactoring.

The engine and all of its "ingredients" are open-source so everybody in the community can contribute. The engine was built by a software engineers at Up2Go who struggled with enforcing Clean Code into their daily work given the lack of metrics tools in the Salesforce.com ecosystem. Not to forget the awesome support by many others.

What we check | How to configure | How to contribute

What issues are recognized?

50+ rules for Apex and Visualforce..

Enable and configure the Engine

Code Climate will not run this engine on your code unless you have this minimal '.codeclimate.yml' (Note the leading dot) in the root directory of your repository.

engines:
  apexmetrics:
    enabled: true
ratings:
  paths:
    - "**.cls"
    - "**.trigger"
    - "**.page"
    - "**.component"

For more details about Code Climate configuration go to docs.codeclimate.com.

Exclude files and paths (optional)

To exclude single files or folders from the analysis add a exclude_paths section to the file like in this minimal example:

engines:
  apexmetrics:
    enabled: true
ratings:
  paths:
    - "**.cls"
    - "**.trigger"
exclude_paths:
  - "/src/triggers"
  - "**.xml"

We recommend you to adapt a copy of this .codeclimate.yml which already excludes most of the irrelevant Salesforce.com files and folders.

For more details about how to exclude files and folders go to docs.codeclimate.com.

PMD Rule customization (optional)

Not all checks make sense under all circumstances so configurability is crucial when it comes to Code metrix. By adjusting your .codeclimate.yml you can eighter disable certain checks for a single issue or for your whole repo.

But that's not enough. One key benefit of Code Climate is grading. Grading not only takes the amount of issues into a account but also how severe issues are to fix. To customize if and when code is marked as issue you need to go "one level deeper". The static code analysis performed by this engine uses an Apex port of the famous Java tool PMD. PMD is very flexible and can be configured using a so called ruleset xml file.

By default or engine uses this apex-ruleset.xml. It enables all rules and runs them with values we came up with as good defaults. Just add a copy of that file to the root directory of your repository and adapt it to your needs.

<rule ref="rulesets/apex/complexity.xml/ExcessiveClassLength" message="Avoid really long classes (lines of code)">
  <priority>3</priority>
  <properties>
    <!-- Rule specific property defining, when a class is marked as too long -->
    <property name="minimum" value="1000"/>

    <!-- Code Climate specific properties -->
    <property name="cc_remediation_points_multiplier" value="150"/>
    <property name="cc_categories" value="Complexity"/>
    <property name="cc_block_highlighting" value="false"/>
  </properties>	
</rule>

Some rules have parameters which define if and when code is marked as issue. To learn how such parameters influence a check go to the readup section of an issue which describs

All properties starting with cc_ are Code Climate specific and define how the results are displayed or how grades are calculated.

  • cc_remediation_points_multiplier: This is multiplication factor for the Code Climate Remediation Point default of 50.000. To understand the semantics and importance of Remediation point please check the docs.codeclimate.com.
  • cc_categories: The Code Climate specific categorization. Might differ from PMD.
  • cc_block_highlighting: Defaults to 'false'. Only the first line of a problematic block is highlighted in the UI. If set to 'true' the whole block is highlighted which currently looks ugly.

How to contribute

There is a lot of room for improvement or extension. Depending on what you want to do you eighter need to fork, extend and pull request this repository or the PMD repository. Please check the Wiki to learn how to contribute.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].