No issues detected in C# analysis #152
-
Jenkins and plugins versions reportJenkinss Version: 2.426.1 What Operating System are you using (both controller, and any agents involved in the problem)?Windows on controller and agent Reproduction steps
Expected ResultsThe issues that are detected during the analysis and that are shown in the SonarQube pull request UI should be reported to Gerrit. Actual ResultsNo issues are detected:
Anything else?This is not a permission problem, the user running the analysis has browse permissions on the project and can see the issues. This has been verified in the SonarQube access.log The reporting is working in other projects with e.g. C++. My guess is that the problem lies in the file paths that SonarQube reports ( Calling "issues": [
{
"key": "...",
"rule": "csharpsquid:S112",
"severity": "MAJOR",
"component": "test_project:App/Services/CredentialItemProvider.cs",
"project": "test-project", However, the full file path from the root of the git repo is Could this be why the plugin does not detect any issues? Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The issue was resolved. There were two misconfigurations: First was to get the file path of the SonarQube to match the folder structure of the actual git repo. Providing the full qualified path name of the Visual Studio Solution to msbuild resulted in correct SonarQube paths. Second issue that got the plugin working for the .NET analysis was using a full git clone instead of shallow clone. The working build script looks like: Also remember to set the MSBuild SonarScanner property for the projectBaseDir to project root. This is the Jenkins Workspace in this case.
|
Beta Was this translation helpful? Give feedback.
The issue was resolved. There were two misconfigurations:
First was to get the file path of the SonarQube to match the folder structure of the actual git repo. Providing the full qualified path name of the Visual Studio Solution to msbuild resulted in correct SonarQube paths.
Second issue that got the plugin working for the .NET analysis was using a full git clone instead of shallow clone.
The working build script looks like:
MSBuild.exe %~dp0test_project.sln -t:rebuild
Also remember to set the MSBuild SonarScanner property for the projectBaseDir to project root. This is the Jenkins Workspace in this case.
/d:sonar.projectBaseDir=%WORKSPACE%