sonar-gitlab-plugin icon indicating copy to clipboard operation
sonar-gitlab-plugin copied to clipboard

Codeclimate.json is (almost) always empty

Open bjorncarlander opened this issue 6 years ago • 3 comments

Hi. I can't get the code quality report to show in Gitlab, the json file is always empty. I got a result one time, when I merged the master branch into the feature branch to update, but apart from that it's empty. The codeclimate.json file for the master branch has content, and the analysis and upload to SQ works fine apart from that. SQ version: 6.7.1.35068 Gitlab plugin version: 3.0.0 Gitlab version: 10.4.3-ee

.gitlab-ci.yml (relevant parts): sonarqube_analysis: stage: build only: - master script: - nuget restore - SonarScanner.MSBuild begin /k:"$env:PROJECT_KEY" /d:sonar.gitlab.project_id=$env:CI_PROJECT_PATH /d:sonar.gitlab.commit_sha=$env:CI_COMMIT_SHA /d:sonar.gitlab.ref_name=$env:CI_COMMIT_REF_NAME /d:sonar.gitlab.json_mode=CODECLIMATE /d:sonar.cs.vscoveragexml.reportsPaths=**/*.coveragexml - msbuild /p:Configuration=Release - SonarScanner.MSBuild end artifacts: expire_in: 5 day paths: - codeclimate.json

codequality: script: - git config --global user.email "$env:GITLAB_USER_EMAIL" - git config --global user.name "$env:GITLAB_USER_ID" - git checkout origin/master - git merge $env:CI_COMMIT_SHA --no-commit --no-ff - nuget restore - SonarScanner.MSBuild begin /k:"$env:PROJECT_KEY" /d:sonar.analysis.mode=preview /d:sonar.gitlab.project_id=$env:CI_PROJECT_PATH /d:sonar.gitlab.commit_sha=$env:CI_COMMIT_SHA /d:sonar.gitlab.ref_name=$env:CI_COMMIT_REF_NAME /d:sonar.gitlab.json_mode=CODECLIMATE /d:sonar.verbose=true /d:sonar.cs.vscoveragexml.reportsPaths=**/*.coveragexml - msbuild /p:Configuration=Release - SonarScanner.MSBuild end except: - master artifacts: expire_in: 1 day paths: - codeclimate.json

Thankful for help, best regards, Björn

bjorncarlander avatar Apr 24 '18 13:04 bjorncarlander

I too am getting a empty codeclimate.json file as well. If you find a fix for this?

hopenbr avatar May 30 '18 13:05 hopenbr

Same here. Branch build fails on external-sonar because of quality gates but no issues are being reported in codequality file. I get this comment in the MR:

SonarQube analysis indicates that quality gate is failed.

Security Rating on New Code is failed: Actual value 3 > 1
Reliability Rating on New Code is passed: Actual value 1
Maintainability Rating on New Code is failed: Actual value 2 > 1
Duplicated Lines on New Code (%) is passed: Actual value 0.0

SonarQube analysis reported no issues.

I see that the compiler produces proper warnings but do not see these results being reflected in codequality,json file nor in the comments.

alexeyzimarev avatar Jun 18 '18 12:06 alexeyzimarev

I believe this is because of https://github.com/gabrie-allaigre/sonar-gitlab-plugin/issues/182

jnovick avatar Dec 27 '18 19:12 jnovick