sonarqube

Sonarqube: line out of range since file shrinks after merge with master

孤街浪徒 提交于 2020-06-01 06:18:42
问题 There is a fileA on master (say it consists of 1000 lines) We are on feature_branch , where fileA has length of say 1050 lines. On our CI pipeline, we are running coverage (it is a Python project) and it produces coverage.xml , to be used as cov input to SQ. Our SQ preview stage is as follows: - git config --global user.name "SonarQube" - git config --global user.email "sonarqube@somedomain.com" - git checkout origin/master - git merge $CI_BUILD_REF --no-commit --no-ff - sonar-scanner -Dsonar

Ignoring a line with Sonar

依然范特西╮ 提交于 2020-05-29 02:30:40
问题 Sonar complains about a line. Thread.sleep(SLEEP_TIME); // NOSONAR Its problem is that "Thread.sleep" should not be used in tests Using Thread.sleep in a test is just generally a bad idea. It creates brittle tests that can fail unpredictably depending on environment ("Passes on my machine!") or load. And it makes sense, this should be fixed. But my problem is: why doesn't the NOSONAR part has any effect here? It seems to work in other parts of the code where it's used, e.g. with public static

Display Sonar Code Coverage with jacoco.exec file in Sonar LTS 7.9.2

感情迁移 提交于 2020-05-15 19:11:48
问题 Recently I have updated SonarQube 7.9.2 in which sonar.jacoco.reportPaths property has been deprecated and need to use sonar.coverage.jacoco.xmlReportPaths . I don't have JaCoCo xml report generated and I am using ant for build and JUnit. Please help me to view the coverage on SonarQube with exec file. 来源: https://stackoverflow.com/questions/59527088/display-sonar-code-coverage-with-jacoco-exec-file-in-sonar-lts-7-9-2

Property 'sonar.jacoco.reportPath' is deprecated. Please use 'sonar.jacoco.reportPaths' instead

主宰稳场 提交于 2020-05-12 11:36:25
问题 Property 'sonar.jacoco.reportPath' is deprecated. Please use 'sonar.jacoco.reportPaths' instead. I keep getting this message when running SonarQube through Gradle and the phrase "reportPath" does not even appear even once in the entire multi-module project. I even put the sonarqube property under allprojects to override any defaults that may be there. Any tips on how I can get rid of this error? I am using: allprojects { sonarqube { properties { property "sonar.jacoco.reportPaths", "${project

Property 'sonar.jacoco.reportPath' is deprecated. Please use 'sonar.jacoco.reportPaths' instead

萝らか妹 提交于 2020-05-12 11:36:13
问题 Property 'sonar.jacoco.reportPath' is deprecated. Please use 'sonar.jacoco.reportPaths' instead. I keep getting this message when running SonarQube through Gradle and the phrase "reportPath" does not even appear even once in the entire multi-module project. I even put the sonarqube property under allprojects to override any defaults that may be there. Any tips on how I can get rid of this error? I am using: allprojects { sonarqube { properties { property "sonar.jacoco.reportPaths", "${project

SonarQube + Maven + JaCoCo + GitLab CI: Sonar started to show 0% code coverage after upgrading to SonarQube 7.9.2

无人久伴 提交于 2020-04-17 22:07:46
问题 After we upgraded our SonarQube to Version 7.9.2 (build 30863), Community Edition , running the GitLab CI Pipeline results in showing 0.0% coverage (dropping from about 86.2% ), although Sonar is showing all unit tests. Maven build executed in .gitlab-ci.yml looks like this: - mvn test sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONAR_TOKEN} Obviosuly this has something to deal with notorious sonar.coverage.jacoco.xmlReportPaths and sonar.jacoco.reportPaths Sonar-JaCoCo

SonarQube + Maven + JaCoCo + GitLab CI: Sonar started to show 0% code coverage after upgrading to SonarQube 7.9.2

无人久伴 提交于 2020-04-17 22:05:53
问题 After we upgraded our SonarQube to Version 7.9.2 (build 30863), Community Edition , running the GitLab CI Pipeline results in showing 0.0% coverage (dropping from about 86.2% ), although Sonar is showing all unit tests. Maven build executed in .gitlab-ci.yml looks like this: - mvn test sonar:sonar -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONAR_TOKEN} Obviosuly this has something to deal with notorious sonar.coverage.jacoco.xmlReportPaths and sonar.jacoco.reportPaths Sonar-JaCoCo

How to upload a report to SonarQube properly using SonarQube API

给你一囗甜甜゛ 提交于 2020-04-16 02:52:50
问题 I want to upload a json report made in R using lintr package to my SonarQube server. I'm making a POST taking advantage of the api/ce/submit command (You can find it in https://next.sonarqube.com/sonarqube/web_api/api/ce?internal=true). To do this i'm using Postman with this params: projectKey: XX projectName: XXname report: lintr_out.json projectBranch: testing-1.0 This command create the Project in Sonar but it's not able to show the information of the report. Anybody knows how can i see

How to upload a report to SonarQube properly using SonarQube API

老子叫甜甜 提交于 2020-04-16 02:52:09
问题 I want to upload a json report made in R using lintr package to my SonarQube server. I'm making a POST taking advantage of the api/ce/submit command (You can find it in https://next.sonarqube.com/sonarqube/web_api/api/ce?internal=true). To do this i'm using Postman with this params: projectKey: XX projectName: XXname report: lintr_out.json projectBranch: testing-1.0 This command create the Project in Sonar but it's not able to show the information of the report. Anybody knows how can i see

Modify default parameter rule in SonarQube

一世执手 提交于 2020-04-14 04:09:38
问题 I am using sonarqube to check the quality of my code and I would like to override a rule but I don't manage to do it even by following the documentation. The rule I want to modify is about the exceeding code length in C# which by default uses the maximumLineLength parameter. I would like to modify and increase the value of this parameter but I don't find anywhere the chance to do it. Any help please? 回答1: Try setting the attribute in your sonar-project.properties file. That way the default