private String qualifier = null;
private boolean isNewCodeReferenceIssue = false;
private String codeVariants = null;
+ private boolean prioritizedRule = false;
private Set<ImpactDto> impacts = new HashSet<>();
private Set<ImpactDto> ruleDefaultImpacts = new HashSet<>();
this.ruleCleanCodeAttribute = ruleCleanCodeAttribute;
return this;
}
+
+ public boolean isPrioritizedRule(){
+ return prioritizedRule;
+ }
+
+ public IndexedIssueDto setPrioritizedRule(boolean prioritizedRule){
+ this.prioritizedRule = prioritizedRule;
+ return this;
+ }
}
.setSeverity("severity")
.setTags("tags")
.setIssueType(6)
- .setBranchUuid("branchUuid");
+ .setBranchUuid("branchUuid")
+ .setPrioritizedRule(true);
indexedIssueDto.getImpacts().add(new ImpactDto().setSoftwareQuality(SoftwareQuality.SECURITY).setSeverity(Severity.HIGH));
indexedIssueDto.getRuleDefaultImpacts().add(new ImpactDto().setSoftwareQuality(SoftwareQuality.MAINTAINABILITY).setSeverity(Severity.MEDIUM));
IndexedIssueDto::getPath, IndexedIssueDto::getProjectUuid, IndexedIssueDto::getQualifier, IndexedIssueDto::getResolution,
IndexedIssueDto::getRuleUuid, IndexedIssueDto::getScope, IndexedIssueDto::getSeverity, IndexedIssueDto::getTags,
IndexedIssueDto::getIssueType,
- IndexedIssueDto::getBranchUuid)
+ IndexedIssueDto::getBranchUuid, IndexedIssueDto::isPrioritizedRule)
.containsExactly("issueKey", "assignee", "authorLogin", "status", true, "cleanCodeAttribute", "ruleCleanCodeAttribute",
"codeVariants", "securityStandards",
"componentUuid", 1L, 2L, 3L, 4L, true, "language", 5, "path", "projectUuid", "qualifier", "resolution", "ruleUuid",
- "scope", "severity", "tags", 6, "branchUuid");
+ "scope", "severity", "tags", 6, "branchUuid", true);
assertThat(indexedIssueDto.getImpacts())
.extracting(ImpactDto::getSoftwareQuality, ImpactDto::getSeverity)
public static final String SUB_FIELD_SEVERITY = "severity";
public static final String FIELD_ISSUE_IMPACT_SOFTWARE_QUALITY = FIELD_ISSUE_IMPACTS + "." + SUB_FIELD_SOFTWARE_QUALITY;
public static final String FIELD_ISSUE_IMPACT_SEVERITY = FIELD_ISSUE_IMPACTS + "." + SUB_FIELD_SEVERITY;
+ public static final String FIELD_PRIORITIZED_RULE = "prioritizedRule";
private final Configuration config;
private final boolean enableSource;
@Override
public void define(IndexDefinitionContext context) {
NewAuthorizedIndex index = context.createWithAuthorization(
- DESCRIPTOR,
- newBuilder(config)
- .setRefreshInterval(MANUAL_REFRESH_INTERVAL)
- .setDefaultNbOfShards(5)
- .build())
+ DESCRIPTOR,
+ newBuilder(config)
+ .setRefreshInterval(MANUAL_REFRESH_INTERVAL)
+ .setDefaultNbOfShards(5)
+ .build())
.setEnableSource(enableSource);
TypeMapping mapping = index.createTypeMapping(TYPE_ISSUE);
mapping.keywordFieldBuilder(FIELD_ISSUE_VULNERABILITY_PROBABILITY).disableNorms().build();
mapping.createBooleanField(FIELD_ISSUE_NEW_CODE_REFERENCE);
mapping.keywordFieldBuilder(FIELD_ISSUE_CODE_VARIANTS).disableNorms().build();
+ mapping.createBooleanField(FIELD_PRIORITIZED_RULE);
}
}