From: Léo Geoffroy Date: Tue, 23 Jul 2024 11:31:31 +0000 (+0200) Subject: SONAR-22542 Fix SonarQube issue X-Git-Tag: 10.7.0.96327~343 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b6b153c18115ebae35f0feb0c2243eae0a62c05b;p=sonarqube.git SONAR-22542 Fix SonarQube issue --- 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 getAndValidateProjectOrApplication(DbSession dbSession, WsRequest wsRequest) {