Skip to content

Commit 0db793a

Browse files
authored
Merge pull request #496 from darkspirit510/fix-sonarqube-script
fix sonarqube script @darkspirit510 - I noticed that both the old and new output print out MANY lines like this: 14:40:06.077 WARN Too many duplication references on file src/main/java/org/owasp/benchmark/testcode/BenchmarkTest01318.java for block at line 74. Keep only the first 100 references. 14:40:06.077 WARN Too many duplication references on file src/main/java/org/owasp/benchmark/testcode/BenchmarkTest01318.java for block at line 76. Keep only the first 100 references. Is there any way to suppress/disable those? I tested this PR and it seems to work identically to the existing one, with regard to the score. But I assume there is a reason you wanted to change/update it. So I'm going to go ahead and merge it. if you can figure out how to disable all this WARNings, that would be helpful. Thx
2 parents ba2e3f9 + 7840608 commit 0db793a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scripts/runSonarQube.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,12 @@ echo "Starting scan... (might take some time!)"
6464
container_ip=$(docker inspect "$container_name" | jq -r '.[0].NetworkSettings.Networks.bridge.IPAddress' )
6565
sonar_docker_host="http://$container_ip:$sonar_internal_port"
6666

67-
docker run --env SONAR_SCANNER_OPTS=-Xmx4g --rm -v ~/.m2:/root/.m2 -v "$(pwd)":"$(pwd)" -w "$(pwd)" sonarsource/sonar-scanner-cli \
67+
docker run --env SONAR_SCANNER_OPTS=-Xmx4g --rm -v ~/.m2:/root/.m2 -v "$(pwd)":/benchmark -w "/benchmark" sonarsource/sonar-scanner-cli \
68+
-Dsonar.projectBaseDir="/benchmark" \
6869
-Dsonar.java.binaries="target" \
6970
-Dsonar.projectKey="$sonar_project" \
7071
-Dsonar.host.url="$sonar_docker_host" \
71-
-Dsonar.login="$sonar_token" \
72+
-Dsonar.token="$sonar_token" \
7273
-Dsonar.sources="src" \
7374
-Dsonar.exclusions="results/**,scorecard/**,scripts/**,tools/**,VMs/**,**/*.js"
7475

@@ -82,6 +83,7 @@ done
8283
echo ""
8384
echo "Generating report..."
8485

86+
mvn compile
8587
mvn exec:java -Dexec.mainClass="org.owasp.benchmark.report.sonarqube.SonarReport"
8688

8789
echo "Shutting down SonarQube..."

0 commit comments

Comments
 (0)