Search in sources :

Example 1 with OwaspTop10

use of org.sonar.api.server.rule.RulesDefinition.OwaspTop10 in project sonarqube by SonarSource.

the class DefaultNewRule method addOwaspTop10.

@Override
public DefaultNewRule addOwaspTop10(OwaspTop10Version version, OwaspTop10... standards) {
    Objects.requireNonNull(version, "Owasp version must not be null");
    // backward compatibility
    String versionPrefix = OwaspTop10Version.Y2017.equals(version) ? "owaspTop10:" : "owaspTop10-" + version.label() + ":";
    for (OwaspTop10 owaspTop10 : standards) {
        String standard = versionPrefix + owaspTop10.name().toLowerCase(Locale.ENGLISH);
        securityStandards.add(standard);
    }
    return this;
}
Also used : OwaspTop10(org.sonar.api.server.rule.RulesDefinition.OwaspTop10)

Aggregations

OwaspTop10 (org.sonar.api.server.rule.RulesDefinition.OwaspTop10)1