Why do you believe it’s a false-positive/false-negative?
In the following code example, SonarQube should have reported a S5542 warning at line 12 because the encryption algorithm used (AES/CBC/PKCS5Padding) is weak.
Are you using
SonarQube Server / Community Build - Latest
Code Example
import java.security.NoSuchAlgorithmException;
import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
public class Main {
public static void main(String[] args) {
processCipher("AES/CBC/PKCS5Padding");
}
private static void processCipher(String transformation) {
try {
Cipher.getInstance(transformation);
} catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
e.printStackTrace();
}
}
}