I am creating a plugin with custom written rules and with QualityProfile implemented
public class QualityProfile implements BuiltInQualityProfilesDefinition {
public static final String QUALITYPROFILE = "SEC-AI";
@Override
public void define(Context context) {
NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(QUALITYPROFILE, "java");
NewBuiltInActiveRule rule1 = profile.activateRule(CogniCryptRulesDefinition.REPOSITORY,"javax.crypto.Cipher" );
rule1.overrideSeverity("CRITICAL");
profile.setDefault(true);
profile.done();
}
}
Problem here is when i start analysis this custom QualityProfile has to be applied for analysis
But not via defining inside of sonar.property file or cmd arguments
I want to set QualityProfile programatically within Plugin itself but not sure how we can do this.
Is there any documentation that I can follow or some code snippet example ?
Thanks