.transition(Transition.builder(DefaultTransitions.OPEN_AS_VULNERABILITY)
.from(STATUS_REVIEWED).to(STATUS_OPEN)
.conditions(new HasType(RuleType.SECURITY_HOTSPOT))
- .functions(new SetResolution(null))
- .functions(new SetType(RuleType.VULNERABILITY))
+ .functions(new SetResolution(null), new SetType(RuleType.VULNERABILITY))
.requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN)
.build())
.transition(Transition.builder(DefaultTransitions.OPEN_AS_VULNERABILITY)
.requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN)
.build())
- // all transitions below have to be removed by the end of the MMF-1635
- .transition(Transition.builder(DefaultTransitions.DETECT)
- .from(STATUS_TO_REVIEW).to(STATUS_OPEN)
+ .transition(Transition.builder(DefaultTransitions.RESET_AS_TO_REVIEW)
+ .from(STATUS_IN_REVIEW).to(STATUS_TO_REVIEW)
.conditions(new HasType(RuleType.SECURITY_HOTSPOT))
- .functions(new SetType(RuleType.VULNERABILITY))
+ .functions(new SetResolution(null))
.requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN)
.build())
- .transition(Transition.builder(DefaultTransitions.DETECT)
- .from(STATUS_RESOLVED).to(STATUS_OPEN)
- .conditions(new HasType(RuleType.SECURITY_HOTSPOT), new HasResolution(RESOLUTION_WONT_FIX))
- .functions(new SetType(RuleType.VULNERABILITY), new SetResolution(null))
+ .transition(Transition.builder(DefaultTransitions.RESET_AS_TO_REVIEW)
+ .from(STATUS_REVIEWED).to(STATUS_TO_REVIEW)
+ .conditions(new HasType(RuleType.SECURITY_HOTSPOT))
+ .functions(new SetResolution(null))
.requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN)
.build())
- .transition(Transition.builder(DefaultTransitions.DISMISS)
+ .transition(Transition.builder(DefaultTransitions.RESET_AS_TO_REVIEW)
.from(STATUS_OPEN).to(STATUS_TO_REVIEW)
- .conditions(IsManualVulnerability.INSTANCE)
- .functions(new SetType(RuleType.SECURITY_HOTSPOT))
- .requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN)
- .build())
- .transition(Transition.builder(DefaultTransitions.REJECT)
- .from(STATUS_RESOLVED).to(STATUS_REOPENED)
- .conditions(new HasType(RuleType.SECURITY_HOTSPOT), new HasResolution(RESOLUTION_FIXED))
- .functions(new SetType(RuleType.VULNERABILITY), new SetResolution(null))
- .requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN)
- .build())
- .transition(Transition.builder(DefaultTransitions.ACCEPT)
- .from(STATUS_RESOLVED).to(STATUS_RESOLVED)
- .conditions(new HasType(RuleType.SECURITY_HOTSPOT), new HasResolution(RESOLUTION_FIXED))
- .functions(new SetResolution(RESOLUTION_WONT_FIX))
- .requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN)
- .build())
- .transition(Transition.builder(DefaultTransitions.CLEAR)
- .from(STATUS_TO_REVIEW).to(STATUS_RESOLVED)
- .conditions(new HasType(RuleType.SECURITY_HOTSPOT))
- .functions(new SetResolution(RESOLUTION_WONT_FIX))
+ .conditions(new HasType(RuleType.VULNERABILITY), IsManualVulnerability.INSTANCE)
+ .functions(new SetType(RuleType.SECURITY_HOTSPOT), new SetResolution(null))
.requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN)
.build())
- .transition(Transition.builder(DefaultTransitions.REOPEN_HOTSPOT)
- .from(STATUS_RESOLVED).to(STATUS_TO_REVIEW)
- .conditions(new HasType(RuleType.SECURITY_HOTSPOT))
- .functions(new SetResolution(null))
- .requiredProjectPermission(UserRole.SECURITYHOTSPOT_ADMIN)
- .build());
+ ;
}
private static void buildAutomaticTransitions(StateMachine.Builder builder) {
*/
package org.sonar.server.issue.workflow;
-import com.google.common.base.Function;
-import com.google.common.collect.Collections2;
import com.tngtech.java.junit.dataprovider.DataProvider;
import com.tngtech.java.junit.dataprovider.DataProviderRunner;
import com.tngtech.java.junit.dataprovider.UseDataProvider;
import java.util.Collection;
import java.util.Date;
import java.util.List;
-import javax.annotation.Nullable;
import org.apache.commons.lang.time.DateUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.sonar.core.issue.DefaultIssue;
import org.sonar.core.issue.FieldDiffs;
import org.sonar.core.issue.IssueChangeContext;
+import org.sonar.core.util.stream.MoreCollectors;
import org.sonar.server.issue.IssueFieldsSetter;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.api.issue.Issue.RESOLUTION_FIXED;
import static org.sonar.api.issue.Issue.RESOLUTION_REMOVED;
-import static org.sonar.api.issue.Issue.RESOLUTION_WONT_FIX;
import static org.sonar.api.issue.Issue.STATUS_CLOSED;
import static org.sonar.api.issue.Issue.STATUS_IN_REVIEW;
import static org.sonar.api.issue.Issue.STATUS_OPEN;
private IssueWorkflow underTest = new IssueWorkflow(new FunctionExecutor(updater), updater);
+ @DataProvider
+ public static Object[][] allStatusesLeadingToClosed() {
+ return Arrays.stream(ALL_STATUSES_LEADING_TO_CLOSED)
+ .map(t -> new Object[] {t})
+ .toArray(Object[][]::new);
+ }
+
+ private static DefaultIssue newClosedIssue(String resolution) {
+ return new DefaultIssue()
+ .setKey("ABCDE")
+ .setRuleKey(RuleKey.of("js", "S001"))
+ .setResolution(resolution)
+ .setStatus(STATUS_CLOSED)
+ .setNew(false)
+ .setCloseDate(new Date(5_999_999L));
+ }
+
+ private static void setStatusPreviousToClosed(DefaultIssue issue, String previousStatus) {
+ addStatusChange(issue, new Date(), previousStatus, STATUS_CLOSED);
+ }
+
+ private static void addStatusChange(DefaultIssue issue, Date date, String previousStatus, String newStatus) {
+ issue.addChange(new FieldDiffs().setCreationDate(date).setDiff("status", previousStatus, newStatus));
+ }
+
@Test
public void list_out_transitions_in_status_to_review() {
underTest.start();
List<Transition> transitions = underTest.outTransitions(issue);
- assertThat(keys(transitions)).containsOnly("setinreview", "detect", "clear", "resolveasreviewed", "openasvulnerability");
+ assertThat(keys(transitions)).containsExactlyInAnyOrder("setinreview", "resolveasreviewed", "openasvulnerability");
}
@Test
List<Transition> transitions = underTest.outTransitions(issue);
- assertThat(keys(transitions)).containsOnly("resolveasreviewed", "openasvulnerability");
+ assertThat(keys(transitions)).containsExactlyInAnyOrder("resolveasreviewed", "openasvulnerability", "resetastoreview");
}
@Test
- public void list_out_transitions_in_status_reviwed() {
+ public void list_out_transitions_in_status_reviewed() {
underTest.start();
DefaultIssue issue = new DefaultIssue().setType(RuleType.SECURITY_HOTSPOT).setStatus(STATUS_REVIEWED);
List<Transition> transitions = underTest.outTransitions(issue);
- assertThat(keys(transitions)).containsOnly("openasvulnerability");
+ assertThat(keys(transitions)).containsExactlyInAnyOrder("openasvulnerability", "resetastoreview");
}
@Test
- public void list_out_transitions_in_status_open() {
+ public void list_out_vulnerability_transitions_in_status_open() {
underTest.start();
- DefaultIssue issue = new DefaultIssue().setType(RuleType.VULNERABILITY).setStatus(STATUS_OPEN).setResolution(RESOLUTION_FIXED).setIsFromHotspot(true);
+ DefaultIssue issue = new DefaultIssue().setType(RuleType.VULNERABILITY).setResolution(RESOLUTION_FIXED).setStatus(STATUS_OPEN).setIsFromHotspot(true);
List<Transition> transitions = underTest.outTransitions(issue);
- assertThat(keys(transitions)).containsOnly("resolveasreviewed", "dismiss"); // dismiss to be remove by the end of the MMF-1635
+ assertThat(keys(transitions)).containsExactlyInAnyOrder("resolveasreviewed", "resetastoreview");
}
@Test
assertThat(issue.resolution()).isNull();
}
+ @Test
+ public void reset_as_to_review_from_reviewed() {
+ underTest.start();
+ DefaultIssue issue = new DefaultIssue()
+ .setType(RuleType.SECURITY_HOTSPOT)
+ .setIsFromHotspot(true)
+ .setStatus(STATUS_REVIEWED)
+ .setResolution(RESOLUTION_FIXED);
+
+ boolean result = underTest.doManualTransition(issue, DefaultTransitions.RESET_AS_TO_REVIEW, IssueChangeContext.createUser(new Date(), "USER1"));
+ assertThat(result).isTrue();
+ assertThat(issue.type()).isEqualTo(RuleType.SECURITY_HOTSPOT);
+ assertThat(issue.getStatus()).isEqualTo(STATUS_TO_REVIEW);
+ assertThat(issue.resolution()).isNull();
+ }
+
+ @Test
+ public void reset_as_to_review_from_in_review() {
+ underTest.start();
+ DefaultIssue issue = new DefaultIssue()
+ .setType(RuleType.SECURITY_HOTSPOT)
+ .setIsFromHotspot(true)
+ .setStatus(STATUS_IN_REVIEW)
+ .setResolution(null);
+
+ boolean result = underTest.doManualTransition(issue, DefaultTransitions.RESET_AS_TO_REVIEW, IssueChangeContext.createUser(new Date(), "USER1"));
+ assertThat(result).isTrue();
+ assertThat(issue.type()).isEqualTo(RuleType.SECURITY_HOTSPOT);
+ assertThat(issue.getStatus()).isEqualTo(STATUS_TO_REVIEW);
+ assertThat(issue.resolution()).isNull();
+ }
+
+ @Test
+ public void reset_as_to_review_from_opened_as_vulnerability() {
+ underTest.start();
+ DefaultIssue issue = new DefaultIssue()
+ .setType(RuleType.VULNERABILITY)
+ .setIsFromHotspot(true)
+ .setStatus(STATUS_OPEN)
+ .setResolution(null);
+
+ boolean result = underTest.doManualTransition(issue, DefaultTransitions.RESET_AS_TO_REVIEW, IssueChangeContext.createUser(new Date(), "USER1"));
+ assertThat(result).isTrue();
+ assertThat(issue.type()).isEqualTo(RuleType.SECURITY_HOTSPOT);
+ assertThat(issue.getStatus()).isEqualTo(STATUS_TO_REVIEW);
+ assertThat(issue.resolution()).isNull();
+ }
+
@Test
public void automatically_close_resolved_security_hotspots_in_status_to_review() {
underTest.start();
assertThat(issue.updateDate()).isEqualTo(DateUtils.truncate(now, Calendar.SECOND));
}
+ @Test
+ public void automatically_close_hotspots_opened_as_vulnerability() {
+ underTest.start();
+ DefaultIssue issue = new DefaultIssue()
+ .setType(RuleType.VULNERABILITY)
+ .setResolution(null)
+ .setStatus(STATUS_OPEN)
+ .setIsFromHotspot(true)
+ .setNew(false)
+ .setBeingClosed(true);
+ Date now = new Date();
+
+ underTest.doAutomaticTransition(issue, IssueChangeContext.createScan(now));
+
+ assertThat(issue.resolution()).isEqualTo(RESOLUTION_FIXED);
+ assertThat(issue.status()).isEqualTo(STATUS_CLOSED);
+ assertThat(issue.closeDate()).isNotNull();
+ assertThat(issue.updateDate()).isEqualTo(DateUtils.truncate(now, Calendar.SECOND));
+ }
+
@Test
@UseDataProvider("allStatusesLeadingToClosed")
public void do_not_automatically_reopen_closed_issues_of_security_hotspots(String previousStatus) {
});
}
- @DataProvider
- public static Object[][] allStatusesLeadingToClosed() {
- return Arrays.stream(ALL_STATUSES_LEADING_TO_CLOSED)
- .map(t -> new Object[] {t})
- .toArray(Object[][]::new);
- }
-
@Test
public void do_not_allow_to_doManualTransition_when_condition_fails() {
underTest.start();
.setKey("ABCDE")
// Detect is only available on hotspot
.setType(RuleType.VULNERABILITY)
- .setIsFromHotspot(true)
- .setStatus(STATUS_RESOLVED)
- .setResolution(RESOLUTION_WONT_FIX)
+ .setIsFromHotspot(false)
+ .setStatus(STATUS_OPEN)
+ .setResolution(null)
.setRuleKey(XOO_X1);
- assertThat(underTest.doManualTransition(issue, DefaultTransitions.DETECT, IssueChangeContext.createScan(new Date()))).isFalse();
- }
-
- private static DefaultIssue newClosedIssue(String resolution) {
- return new DefaultIssue()
- .setKey("ABCDE")
- .setRuleKey(RuleKey.of("js", "S001"))
- .setResolution(resolution)
- .setStatus(STATUS_CLOSED)
- .setNew(false)
- .setCloseDate(new Date(5_999_999L));
- }
-
- private static void setStatusPreviousToClosed(DefaultIssue issue, String previousStatus) {
- addStatusChange(issue, new Date(), previousStatus, STATUS_CLOSED);
- }
-
- private static void addStatusChange(DefaultIssue issue, Date date, String previousStatus, String newStatus) {
- issue.addChange(new FieldDiffs().setCreationDate(date).setDiff("status", previousStatus, newStatus));
+ assertThat(underTest.doManualTransition(issue, DefaultTransitions.RESET_AS_TO_REVIEW, IssueChangeContext.createScan(new Date()))).isFalse();
}
private Collection<String> keys(List<Transition> transitions) {
- return Collections2.transform(transitions, new Function<Transition, String>() {
- @Override
- public String apply(@Nullable Transition transition) {
- return transition.key();
- }
- });
+ return transitions.stream().map(Transition::key).collect(MoreCollectors.toList());
}
}
import static java.lang.String.format;
import static org.sonar.api.issue.DefaultTransitions.OPEN_AS_VULNERABILITY;
+import static org.sonar.api.issue.DefaultTransitions.RESET_AS_TO_REVIEW;
import static org.sonar.api.issue.DefaultTransitions.RESOLVE_AS_REVIEWED;
import static org.sonar.api.issue.DefaultTransitions.SET_AS_IN_REVIEW;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.ACTION_DO_TRANSITION;
"The transitions involving security hotspots require the permission 'Administer Security Hotspot'.")
.setSince("3.6")
.setChangelog(
- new Change("7.8", format("added '%s', %s and %s transitions for security hotspots ", SET_AS_IN_REVIEW, RESOLVE_AS_REVIEWED, OPEN_AS_VULNERABILITY)),
+ new Change("7.8", format("added '%s', %s, %s and %s transitions for security hotspots ", SET_AS_IN_REVIEW, RESOLVE_AS_REVIEWED, OPEN_AS_VULNERABILITY, RESET_AS_TO_REVIEW)),
new Change("7.3", "added transitions for security hotspots"),
new Change("6.5", "the database ids of the components are removed from the response"),
new Change("6.5", "the response field components.uuid is deprecated. Use components.key instead."))
BulkChangeWsResponse response = call(builder()
.setIssues(singletonList(issue.getKey()))
- .setDoTransition("dismiss")
+ .setDoTransition("resetastoreview")
.setSendNotifications(true)
.build());
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 1,
"totalRules": 1
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 1,
"totalRules": 1
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 1
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 1,
"totalRules": 2
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 1,
"totalRules": 1
"vulnerabilityRating": 3,
"inReviewSecurityHotspots": 1,
"toReviewSecurityHotspots": 1,
- "resolvedSecurityHotspots": 1,
+ "reviewedSecurityHotspots": 1,
"distribution": [],
"activeRules": 1,
"totalRules": 1
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 1
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 1,
"totalRules": 2
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 1
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 1,
"totalRules": 1
"vulnerabilityRating": 3,
"inReviewSecurityHotspots": 1,
"toReviewSecurityHotspots": 1,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [
{
"cwe": "89",
"vulnerabilityRating": 3,
"inReviewSecurityHotspots": 1,
"toReviewSecurityHotspots": 1,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"activeRules": 1,
"totalRules": 1
}
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilityRating": 3,
"inReviewSecurityHotspots": 1,
"toReviewSecurityHotspots": 1,
- "resolvedSecurityHotspots": 1,
+ "reviewedSecurityHotspots": 1,
"distribution": [],
"activeRules": 1,
"totalRules": 1
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 1,
"totalRules": 1
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 1,
"totalRules": 1
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilityRating": 3,
"inReviewSecurityHotspots": 1,
"toReviewSecurityHotspots": 1,
- "resolvedSecurityHotspots": 1,
+ "reviewedSecurityHotspots": 1,
"distribution": [
{
"cwe": "89",
"vulnerabilityRating": 3,
"inReviewSecurityHotspots": 1,
"toReviewSecurityHotspots": 1,
- "resolvedSecurityHotspots": 1
+ "reviewedSecurityHotspots": 1
}
]
},
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
},
{
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": []
}
]
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilityRating": 3,
"inReviewSecurityHotspots": 1,
"toReviewSecurityHotspots": 1,
- "resolvedSecurityHotspots": 1,
+ "reviewedSecurityHotspots": 1,
"distribution": [
{
"cwe": "89",
"vulnerabilityRating": 3,
"inReviewSecurityHotspots": 1,
"toReviewSecurityHotspots": 1,
- "resolvedSecurityHotspots": 1,
+ "reviewedSecurityHotspots": 1,
"activeRules": 1,
"totalRules": 1
}
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 1,
"totalRules": 1
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 1,
"totalRules": 1
"vulnerabilities": 0,
"inReviewSecurityHotspots": 0,
"toReviewSecurityHotspots": 0,
- "resolvedSecurityHotspots": 0,
+ "reviewedSecurityHotspots": 0,
"distribution": [],
"activeRules": 0,
"totalRules": 0
issue.transition.close.description=
issue.transition.wontfix=Resolve as won't fix
issue.transition.wontfix.description=This issue can be ignored because the rule is irrelevant in this context. Its effort won't be counted.
-issue.transition.detect=Detect
-issue.transition.detect.description=A Vulnerability exists here and must be fixed.
-issue.transition.dismiss=Dismiss
-issue.transition.dismiss.description=This vulnerability can't be fixed as is and needs more details from a security expert.
-issue.transition.reject=Reject
-issue.transition.reject.description=The fix has been reviewed by a security expert and the vulnerability is still there. Code must be fixed again.
-issue.transition.requestreview=Request review
-issue.transition.requestreview.description=The code has been fixed and a review by a security expert is required to confirm it.
-issue.transition.accept=Accept
-issue.transition.accept.description=The code has been fixed and the vulnerability has been removed. The issue can be closed.
-issue.transition.clear=Clear
-issue.transition.clear.description=There is no vulnerability in the code. The issue can be closed.
-issue.transition.reopenhotspot=Reopen
-issue.transition.reopenhotspot.description=This security hotspot should be analyzed again by a security expert.
+issue.transition.setinreview = Set as In Review
+issue.transition.setinreview.description = A review is required to check for a vulnerability
+issue.transition.resolveasreviewed = Resolve as Reviewed
+issue.transition.resolveasreviewed.description = There is no vulnerability in the code
+issue.transition.openasvulnerability = Open as Vulnerability
+issue.transition.openasvulnerability.description = There's a vulnerability in the code that must be fixed
+issue.transition.resetastoreview = Reset as security hotspot To Review
+issue.transition.resetastoreview.description = The security hotspot should be analyzed again
issue.set_severity=Change Severity
issue.set_type=Change Type
*/
String WONT_FIX = "wontfix";
- /**
- * @since 7.3
- */
- String DETECT = "detect";
- String DISMISS = "dismiss";
- String REJECT = "reject";
- String ACCEPT = "accept";
- String CLEAR = "clear";
- String REOPEN_HOTSPOT = "reopenhotspot";
-
/**
* @since 7.8
*/
*/
String OPEN_AS_VULNERABILITY = "openasvulnerability";
+ /**
+ * @since 7.8
+ */
+ String RESET_AS_TO_REVIEW = "resetastoreview";
+
/**
* @since 4.4
*/
List<String> ALL = unmodifiableList(asList(CONFIRM, UNCONFIRM, REOPEN, RESOLVE, FALSE_POSITIVE, WONT_FIX, CLOSE,
- DETECT, DISMISS, REJECT, SET_AS_IN_REVIEW, ACCEPT, CLEAR, REOPEN_HOTSPOT, RESOLVE_AS_REVIEWED, OPEN_AS_VULNERABILITY));
+ SET_AS_IN_REVIEW, RESOLVE_AS_REVIEWED, OPEN_AS_VULNERABILITY,RESET_AS_TO_REVIEW));
}
optional int64 vulnerabilityRating = 3;
optional int64 inReviewSecurityHotspots = 4;
optional int64 toReviewSecurityHotspots = 5;
- optional int64 resolvedSecurityHotspots = 6;
+ optional int64 reviewedSecurityHotspots = 6;
repeated CweStatistics distribution = 7;
optional int64 activeRules = 8;
optional int64 totalRules = 9;
optional int64 vulnerabilityRating = 3;
optional int64 inReviewSecurityHotspots = 4;
optional int64 toReviewSecurityHotspots = 5;
- optional int64 resolvedSecurityHotspots = 6;
+ optional int64 reviewedSecurityHotspots = 6;
optional int64 activeRules = 7;
optional int64 totalRules = 8;
}