]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-22542 Fix SonarQube issue
authorLéo Geoffroy <leo.geoffroy@sonarsource.com>
Tue, 23 Jul 2024 11:31:31 +0000 (13:31 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 24 Jul 2024 20:02:47 +0000 (20:02 +0000)
server/sonar-webserver-webapi/src/main/java/org/sonar/server/hotspot/ws/SearchAction.java

index c9e4a331c28d8e6d36a2561ae0d7a6ddeb50a572..09b0cefe680a203b6302b85a0eea53653b476d9b 100644 (file)
@@ -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) {