Skip to content

[Feature Request] Support for Inline Suppression of Specific Rule Violations in Apex (e.g., @IsTest(SeeAllData=true)) #1808

@FedorAtAdesso

Description

@FedorAtAdesso

Need/Problem Description

In our codebase, we enforce strict rules against certain patterns such as @istest(SeeAllData=true) due to best practices. However, there are rare but valid cases, such as tests that call Connect API classes for Commerce Cloud, where SeeAllData=true is necessary.

Describe your Desired Solution

Currently, there is no apparent way to suppress specific rule violations inline in Apex code. We'd like to request support for inline suppression (e.g., via //NOPMD or similar syntax), so we can selectively override violations in justified cases without disabling the rule globally.

This would allow us to:

  • Maintain strict rule enforcement project-wide
  • Clearly indicate and document exceptions inline
  • Avoid false positives in reports

Please consider adding support for this feature to improve rule flexibility in real-world Apex scenarios.

Alternatives Considered

The alternative is to not block violations or override the rule globally to lower the score, both isn't desirable

Additional Context (Screenshots, Files, etc)

No response

Workaround

No response

Urgency

High

Metadata

Metadata

Assignees

No one assigned

    Labels

    USER STORYNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions