{"id":16876287,"url":"https://github.com/rsoesemann/codeclimate-apexmetrics","last_synced_at":"2025-03-22T07:31:53.598Z","repository":{"id":83920472,"uuid":"56225775","full_name":"rsoesemann/codeclimate-apexmetrics","owner":"rsoesemann","description":"ApexMetrics - Code Climate engine for Salesforce [DISCONTINUED use CC PMD instead)","archived":false,"fork":false,"pushed_at":"2018-02-13T08:57:16.000Z","size":108452,"stargazers_count":45,"open_issues_count":2,"forks_count":18,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-18T09:21:36.404Z","etag":null,"topics":["apex","clean-code","codeclimate","linter","pmd","salesforce","static-code-analysis"],"latest_commit_sha":null,"homepage":"http://bit.ly/1Xgw1Un","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rsoesemann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security.xml","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-14T09:43:56.000Z","updated_at":"2024-11-07T16:44:05.000Z","dependencies_parsed_at":"2023-04-25T14:47:20.761Z","dependency_job_id":null,"html_url":"https://github.com/rsoesemann/codeclimate-apexmetrics","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsoesemann%2Fcodeclimate-apexmetrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsoesemann%2Fcodeclimate-apexmetrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsoesemann%2Fcodeclimate-apexmetrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsoesemann%2Fcodeclimate-apexmetrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsoesemann","download_url":"https://codeload.github.com/rsoesemann/codeclimate-apexmetrics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244925178,"owners_count":20532873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apex","clean-code","codeclimate","linter","pmd","salesforce","static-code-analysis"],"created_at":"2024-10-13T15:38:53.318Z","updated_at":"2025-10-14T12:10:36.074Z","avatar_url":"https://github.com/rsoesemann.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 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.\n\n## ApexMetrics - Code Climate engine for Salesforce.com Apex\n\n\u003cimg src=\"https://github.com/Up2Go/codeclimate-apexmetrics/blob/master/resources/ApexMetricsLogo.png\" width=\"150\" align=\"left\"\u003e\n\nApexMetrics is a [Code Climate engine](https://codeclimate.com/engines) for the programming language [Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/) of the [Salesforce.com cloud platform](http://www.salesforce.com/platform/products/force).\n\nIf you [connect your Github repositories to Code Climate](https://docs.codeclimate.com/docs/importing-repositories) and enable the Engine [static code analysis](http://stackoverflow.com/questions/49716/what-is-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](http://blog.xebia.com/static-code-analysis-is-just-tip-of-the-iceberg/).\n\nThe engine and [all of](https://github.com/forcedotcom/idecore/tree/b5bf3a1cb6e8d94aaac10f375c771ec8eab821ba/com.salesforce.ide.apex.core/lib) [its \"ingredients\"](https://github.com/Up2Go/pmd) are open-source so everybody in the community can contribute. The engine was built by a software engineers at [Up2Go](https://github.com/Up2Go) who struggled with enforcing Clean Code into their daily work given [the lack of metrics tools in the Salesforce.com ecosystem](http://salesforce.stackexchange.com/questions/1697/apex-static-code-analysis). Not to forget the [awesome support](https://github.com/adangel) [by](https://github.com/forcedotcom/idecore/issues/167) [many](https://github.com/mrb) [others](https://github.com/sivakumar-kailasam).\n\n\n**[What we check](#rules) | [How to configure](#configuration) | [How to contribute](#contribute)**\n\n\n### \u003ca name=\"rules\"\u003eWhat issues are recognized?\u003c/a\u003e\n\n**[50+ rules for Apex and Visualforce..](https://pmd.github.io/latest/pmd_rules_apex.html)**\n\n### \u003ca name=\"configuration\"\u003eEnable and configure the Engine\u003c/a\u003e\n\nCode 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. \n\n```yaml\nengines:\n  apexmetrics:\n    enabled: true\nratings:\n  paths:\n    - \"**.cls\"\n    - \"**.trigger\"\n    - \"**.page\"\n    - \"**.component\"\n```\n\nFor more details about Code Climate configuration go to [docs.codeclimate.com](https://docs.codeclimate.com/docs/configuring-your-code-climate-analysis).\n\n##### Exclude files and paths (optional)\nTo exclude single files or folders from the analysis add a `exclude_paths` section to the file like in this minimal example:\n\n```yaml\nengines:\n  apexmetrics:\n    enabled: true\nratings:\n  paths:\n    - \"**.cls\"\n    - \"**.trigger\"\nexclude_paths:\n  - \"/src/triggers\"\n  - \"**.xml\"\n```\n\nWe recommend you to adapt a copy of this [.codeclimate.yml](https://github.com/Up2Go/codeclimate-apex/blob/master/resources/.codeclimate.yml) which already excludes most of the irrelevant Salesforce.com files and folders.\n\nFor more details about how to exclude files and folders go to [docs.codeclimate.com](https://docs.codeclimate.com/docs/excluding-files-and-folders).\n\n\n##### PMD Rule customization (optional)\n\nNot 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](https://docs.codeclimate.com/docs/marking-false-positives) or [for your whole repo](https://docs.codeclimate.com/docs/disabling-individual-checks).\n\nBut 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](https://github.com/pmd/pmd/tree/master/pmd-apex) of the [famous Java tool PMD](https://pmd.github.io/). PMD is very flexible and can be [configured using a so called ruleset xml file](http://pmd.sourceforge.net/pmd-4.3.0/howtomakearuleset.html). \n\nBy default or engine uses this [apex-ruleset.xml](https://github.com/Up2Go/codeclimate-apex/blob/master/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.\n\n```xml\n\u003crule ref=\"rulesets/apex/complexity.xml/ExcessiveClassLength\" message=\"Avoid really long classes (lines of code)\"\u003e\n  \u003cpriority\u003e3\u003c/priority\u003e\n  \u003cproperties\u003e\n    \u003c!-- Rule specific property defining, when a class is marked as too long --\u003e\n    \u003cproperty name=\"minimum\" value=\"1000\"/\u003e\n\n    \u003c!-- Code Climate specific properties --\u003e\n    \u003cproperty name=\"cc_remediation_points_multiplier\" value=\"150\"/\u003e\n    \u003cproperty name=\"cc_categories\" value=\"Complexity\"/\u003e\n    \u003cproperty name=\"cc_block_highlighting\" value=\"false\"/\u003e\n  \u003c/properties\u003e\t\n\u003c/rule\u003e\n```\n\nSome 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 \n\n\u003cimg width=\"500\" src=\"https://cloud.githubusercontent.com/assets/8180281/15602948/5ed00770-23f8-11e6-9932-97eb44b3f1a6.png\"\u003e\n\nAll properties starting with `cc_` are Code Climate specific and define how the results are displayed or how grades are calculated.\n\n* **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](https://github.com/codeclimate/spec/blob/master/SPEC.md#remediation-points).\n* **cc_categories**: The Code Climate specific [categorization](https://github.com/codeclimate/spec/blob/master/SPEC.md#categories). Might differ from PMD.\n* **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.\n\n\n### \u003ca name=\"contribute\"\u003eHow to contribute\u003c/a\u003e\n\nThere 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](https://github.com/Up2Go/codeclimate-apexmetrics/wiki#how-to-contribute) to learn how to contribute. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsoesemann%2Fcodeclimate-apexmetrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsoesemann%2Fcodeclimate-apexmetrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsoesemann%2Fcodeclimate-apexmetrics/lists"}