Skip to content

Code Analyzer suppressions

Detailed page. Use “On this page” to jump directly to the section you need.

Review pull-request security evidence and inline Salesforce Code Analyzer suppressions here. Administrators can follow Security and data access to configure and run Checks.

Find every inline Salesforce Code Analyzer suppression in the Record Health Check package, exactly where each one is, and why it is safe to leave in place.

Record Health Check is engineered for AppExchange security-review readiness. Its release process keeps Salesforce Code Analyzer rules enabled by default, fails on new unsanctioned findings, and requires every narrow suppression to be documented and reviewable on this page. Those controls are supplemented by clean-source CI, permission-assignment tests, adversarial tests, package-boundary checks, and Salesforce runtime validation.

This readiness statement describes the repository’s engineering controls. It is not a claim that a specific package version has passed Salesforce AppExchange Security Review, and it does not replace Salesforce’s submission, automated scanning, manual review, clean-install, or integration-review requirements. State that a release is AppExchange approved only after Salesforce has approved that exact submitted solution and version.

Use this table to look up a suppression by file, rule, or category. Every suppression is a comment placed directly above the line it covers:

// code-analyzer-suppress-next-line <RuleName>: <reason>

The rule stays enabled for every other line in the package; a new violation anywhere else still fails the release scan. Reproduce this count from a clean checkout:

Terminal window
grep -rn "code-analyzer-suppress-next-line" \
packages/record-health-check/force-app \
packages/record-health-check/integration-tests

27 lines, as of 2026-08-18: 18 in the core package, 9 in the integration test harness.

18 suppressions across four rule categories.

Check Sets and Checks are stored as Custom Metadata Types (Record_Health_Check_Set__mdt, Record_Health_Check__mdt). Salesforce always lets Apex read a Custom Metadata Type record. It does not apply the same-object read permission or field-level security it applies to Accounts, Contacts, and other business records. That is a Salesforce platform behavior, not a gap in Record Health Check’s own code (Trailhead: Protect Custom Metadata Types & Records). Adding WITH USER_MODE to a query like this would have no effect, since Custom Metadata Type reads bypass record and field access checks either way.

Most reads below happen after Record Health Check’s own permission check confirms the user is allowed to run Checks at all (RecordHealthCheckAccess.canRunChecks()).

FileLineRuleWhat this line does
RecordHealthCheckDefinitionLoader.cls52ApexCRUDViolationLoads the Check Set Custom Metadata record shown on the card.
RecordHealthCheckDefinitionLoader.cls91ApexCRUDViolationLoads the active Checks that belong to that Check Set.
RecordHealthCheckDefinitionLoader.cls402ApexCRUDViolationCounts a Check Set’s inactive Checks for the administrator tooltip.
RecordHealthCheckDefinitionLoader.cls418ApexCRUDViolationLists those inactive Checks’ names for that same tooltip.
RecordHealthCheckScopePlanner.cls41ApexCRUDViolationLoads the Check Set’s own configuration. The Account, Contact, or other records it evaluates are queried separately, using the running user’s real record access (WITH USER_MODE).
RecordHealthCheckConfigService.cls59ApexCRUDViolationFinds which Check Set a given Check belongs to.
RecordHealthCheckConfigService.cls83ApexCRUDViolationChecks which object every active Check Set targets, to find the ones that apply to the current record page.
RecordHealthCheckConfigService.cls223ApexCRUDViolationLoads one Check’s configuration immediately before it runs.
RecordHealthCheckMetadataValidator.cls54ApexCRUDViolationReads every active Check Set so an administrator’s configuration can be validated. This runs for the person configuring Checks, not for a user viewing results.
RecordHealthCheckMetadataValidator.cls76ApexCRUDViolationReads every Check for that same administrator-facing validation.
RecordHealthCheckSetPicklist.cls51ApexCRUDViolationLists active Check Sets for the dropdown an administrator sees while building a Lightning page.
RecordHealthCheckController.cls363ApexCRUDViolationConfirms a Check actually belongs to the Check Set the caller says it does.
RecordHealthCheckSettingsProvider.cls20ApexCRUDViolationReads one Record Health Check setting: whether a Check Set publishes its interactive run event. Not a subscriber’s business record.
RecordHealthCheckSettingsProvider.cls35ApexCRUDViolationReads which Checks are enabled for that same interactive event publication.
FileLineRuleWhat this line does
RecordHealthCheckScopePipeline.cls178ApexSOQLInjectionBuilds the query that loads a record’s field values for evaluation. The record IDs come in as a bind variable, the object and field names are checked against Salesforce’s own schema first, and the query runs with the user’s real record access (WITH USER_MODE).
FileLineRuleWhat this line does
RecordHealthCheckDescribeCache.cls36AvoidMultipleMassSchemaLookupsLooks up Salesforce’s object and field metadata once per transaction and reuses it, instead of asking Salesforce again for every Check.
FileLineRuleWhat this line does
RecordHealthCheckContractHarnessTest.cls145OperationWithLimitsInLoopThis test deliberately checks records one at a time, instead of in bulk, to prove Record Health Check catches and rejects that pattern in a custom Apex Check.
RecordHealthCheckScopePlannerTest.cls208OperationWithLimitsInLoopThis test deliberately uses up all but two of the record-lookup slots, to prove the planner blocks a Check that would need three.

Not every finding here got a suppression comment. AvoidHardcodedCredentialsInFieldDecls matched a field named AUTHORIZATION_MESSAGE in three classes; its heuristic matched the word “AUTHORIZATION” in the field name, not its value, which was always a plain user-facing message (“You do not have permission to run Record Health Checks.”). Since this was a naming collision and not a real access-control question, the field was renamed instead of suppressed:

FileChange
RecordHealthCheckAgentRestResource.clsAUTHORIZATION_MESSAGE renamed to PERMISSION_DENIED_MESSAGE
RecordHealthCheckRunCheckAgentAction.clsAUTHORIZATION_MESSAGE renamed to PERMISSION_DENIED_MESSAGE
RecordHealthCheckRunSetAgentAction.clsAUTHORIZATION_MESSAGE renamed to PERMISSION_DENIED_MESSAGE

The public 'AUTHORIZATION' reason code these classes return to callers, documented in the Agent tool contract, did not change. Only the private field holding the message text did.

9 suppressions. This package only runs in a scratch org during development. It is never packaged, never installed in a subscriber org, and ships with none of the metadata described here.

RHC_Benchmark_Result__c is a regular custom object, not a Custom Metadata Type. It holds performance numbers from admin-run benchmark tests and nothing else. It is suppressed because it is disposable test-org infrastructure that a subscriber never sees, not because record access rules don’t apply to it.

FileLineRuleWhat this line does
RecordHealthCheckScaleBenchmark.cls22ApexCRUDViolationWrites a new row to the benchmark’s own results object, which exists only in the test org.
RecordHealthCheckScaleBenchmark.cls29ApexCRUDViolationSaves the async job ID on that same results row.
RecordHealthCheckScaleBenchmark.cls57ApexCRUDViolationWrites benchmark results even when the running user’s Permission Set intentionally has no access to the results object; the benchmark still needs to record what happened.
RecordHealthCheckScaleBenchmark.cls68ApexCRUDViolationSaves the job ID on the results row for a specific benchmark run.
RecordHealthCheckScaleBenchmark.cls85ApexCRUDViolationReads the benchmark results report. Enforcing normal field-level security here would make the benchmark’s own fields unreadable to the person running it.
RecordHealthCheckScaleBenchmark.cls120ApexCRUDViolationLooks up one benchmark run’s results row by its run ID.
FileLineRuleWhat this line does
RecordHealthCheckExhaustiveSmoke.cls20OperationWithLimitsInLoopStarts one background (Queueable) job at a time, up to Salesforce’s 50-job-per-transaction limit. Salesforce does not offer a bulk way to start Queueable jobs.
RecordHealthCheckExhaustiveSmoke.cls43OperationWithLimitsInLoopCounts how many of those background jobs have finished, capped at that same 50-job limit.
RecordHealthCheckExhaustiveSmoke.cls69QueueableWithoutFinalizerThis one-time test harness saves its own result directly; it has no follow-up job, so it does not need Salesforce’s Queueable Finalizer cleanup step.