SuppressWarning is not being honoured in Apex

SonarQube Enterprise Edition
Version 9.6 (build 59041)

We are developing in Apex. There are some parts in our code for which we want to surpress the warnings. We have used the @SuppressWarnings annotation, but without any effects.

Some of our code snippets

@SuppressWarnings('PMD.OperationWithLimitsInLoop')
private void doUpdate() {
	for (SObjectType type : this.types) {
		// update DML statement
	}
}

We also tried the following without any effect
@SuppressWarnings('apex:S5382')

We have also tried putting the @SupressWarnings annotation in the code block, before the function definition, nothing really seems to work.

Every time we are getting the following issue warning:
Move this DML statement out of the loop or process sObjects by batch.

Help is much appreciated.

Hey there.

Today, in-code suppression isn’t supported for Apex. There is a ticket in our backlog: [SONARSLANG-505] - Jira

You will need to mark these issues as false-positive / won’t fix on your SonarQube instance, or narrow the focus to ignore specific issues.