Writing Clean and Consistent Code with Static Analysis using PMD and Apex

This page summarizes the projects mentioned and recommended in the original post on dev.to

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • PMD

    An extensible multilanguage static code analyzer.

    Nearly every programming language has a static analyzer of its own. For example, golang has gofmt, which is baked into the standard tooling, while Ruby has Rubocop, a community-led project. Even compiled languages like C have their own static analyzer through astyle. However, it can be difficult (and tedious) to run several analyzers across polyglot projects. Fortunately, that’s where a project like PMD can be of assistance. PMD is a static analyzer that allows you to define a standard set of rules that can be applied over multiple languages.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • sfdc-linting

    Finally, clone our sample Apex project at this Git repository: https://github.com/gjtorikian/sfdc-linting.git

  • dreamhouse-lwc

    Sample application for Lightning Web Components on Salesforce Platform. Part of the sample gallery. Real estate use case. Get inspired and learn best practices.

    This repository is a forked copy of the dreamhouse-lwc project, except it has (intentionally) introduced some errors. We’ll use this to demonstrate how PMD works.

  • Visual Studio Code

    Visual Studio Code

    Before getting started, you should have some familiarity with Apex, Salesforce’s programming language which unlocks new possibilities for your organization. We’ll be using VS Code along with the Apex plugin. You’ll also need the Salesforce CLI, which is a tool designed by Salesforce to simplify interacting with the platform.

  • pmd-github-action

    Github Action to run PMD static code analyser

    If you’re using GitHub Actions, you can just integrate an action such as this one, which takes care of all the installation and configuration for you. If you’re not, you simply need to run PMD as you do on the CLI, within a script:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • How to configure SonarLint to connect to SonarQube for VS Code

    2 projects | dev.to | 23 Jan 2022
  • Navigating the Software Developer Life: Soft Skills, AI Tools, and Team Dynamics

    1 project | dev.to | 17 Aug 2024
  • PMD 7 Is Here

    1 project | news.ycombinator.com | 22 Mar 2024
  • Amazon CodeGuru Reviewer: already time for retirement?

    2 projects | dev.to | 1 Aug 2023
  • Advanced Contextual Preamble (ACP): A Novel Prompt Engineering Technique for Enhancing Corporate AI Model Interactions and Streamlining User Experiences

    1 project | /r/ChatGPT | 9 Jul 2023