diff options
author | Léo Geoffroy <leo.geoffroy@sonarsource.com> | 2024-07-23 13:31:31 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-07-24 20:02:47 +0000 |
commit | b6b153c18115ebae35f0feb0c2243eae0a62c05b (patch) | |
tree | 75dc0bad28e1e8d4b05c212a0001a9cf974a4bc8 | |
parent | a3a746153fea0b91dd0cd86307c8092d898bd82c (diff) | |
download | sonarqube-b6b153c18115ebae35f0feb0c2243eae0a62c05b.tar.gz sonarqube-b6b153c18115ebae35f0feb0c2243eae0a62c05b.zip |
SONAR-22542 Fix SonarQube issue
-rw-r--r-- | server/sonar-webserver-webapi/src/main/java/org/sonar/server/hotspot/ws/SearchAction.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/hotspot/ws/SearchAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/hotspot/ws/SearchAction.java index c9e4a331c28..09b0cefe680 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/hotspot/ws/SearchAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/hotspot/ws/SearchAction.java @@ -272,6 +272,16 @@ public class SearchAction implements HotspotsWsAction { .setBooleanPossibleValues() .setDefaultValue("false") .setSince("9.5"); + createSecurityStandardParams(action); + action.createParam(PARAM_FILES) + .setDescription("Comma-separated list of files. Returns only hotspots found in those files") + .setExampleValue("src/main/java/org/sonar/server/Test.java") + .setSince("9.0"); + + action.setResponseExample(getClass().getResource("search-example.json")); + } + + private static void createSecurityStandardParams(WebService.NewAction action) { action.createParam(PARAM_OWASP_ASVS_LEVEL) .setDescription("Filters hotspots with lower or equal OWASP ASVS level to the parameter value. Should be used in combination with the 'owaspAsvs-4.0' parameter.") .setSince("9.7") @@ -319,12 +329,6 @@ public class SearchAction implements HotspotsWsAction { .setDescription("Comma-separated list of CWE numbers") .setExampleValue("89,434,352") .setSince("8.8"); - action.createParam(PARAM_FILES) - .setDescription("Comma-separated list of files. Returns only hotspots found in those files") - .setExampleValue("src/main/java/org/sonar/server/Test.java") - .setSince("9.0"); - - action.setResponseExample(getClass().getResource("search-example.json")); } private Optional<ProjectAndBranch> getAndValidateProjectOrApplication(DbSession dbSession, WsRequest wsRequest) { |