Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update of plugin to v6.3(build 2862) doesn't report any issues in code. #671

Closed
pyo0723 opened this issue Aug 9, 2017 · 7 comments
Closed
Assignees
Labels
Area: SQ Plugin Java plugin related issues. Status: On Hold Postponed or waiting for an answer. Type: Bug Exceptions and blocking issues during analysis.
Milestone

Comments

@pyo0723
Copy link

pyo0723 commented Aug 9, 2017

Description

We're used SonarQube v6.3.1 and triggering SonarQube analysis from Jenkins' SonarQube plugin.
Few days ago we updated SonarQube v6.5 and Update Code Analyzer for C# plugin (versoin 6.3 (build 2862)).
But there are no issues reported anymore in SonarQube after the update.
The only thing I've done between these two points in time is updating sonar csharp plugin from v5.7.0.612 to v6.3.

Repro steps

Please provide the steps required to reproduce the problem

  1. Install SonarQube v6.3.1
  2. Run analysis on a simple project with Jenkins Server and verify that the issues are reported
  3. Update CSharp SonarQube plugin to newest version (6.3)
  4. Run the analysis again and notice that no more issues are reported.

If possible then please create a git repository with a repro sample or attach a zip to the issue.

Expected behavior

Issues in c# code are still reported after updating plugin.

Actual behavior

Doesn't report any issues in code anymore.

Known workarounds

Reverting version of C# plugin to earlier version. (ex. 5.7.0612)

Related information

  • SonarC# Version - v6.5
  • Visual Studio Version - VS2013, VS2015, VS2017
  • If running through the Scanner for MSBuild, its version - We used SonarQube Scanner 3.0.3.778 (Jenkins plug-in version : SonarQube Scanner for Jenkins v2.6.1)

Error Capture Video Link : https://drive.google.com/open?id=0B93sksebuCQja2RJQnRfOV9sRTA

--
CSharpAnalyzer_v5.7_log.txt
CSharpAnalyzer_v6.5_log.txt

code analyzer for c 5 7 0 612_screenshot_1

code analyzer for c 5 7 0 612_screenshot_2

code analyzer for c 6 3_screenshot_1

code analyzer for c 6 3_screenshot_2

@pyo0723 pyo0723 changed the title Update of plugin to v6.3(build 2862) doesn't report any issues in code anymore. Update of plugin to v6.3(build 2862) doesn't report any issues in code. Aug 9, 2017
@Evangelink
Copy link
Contributor

Hi @pyo0723,

Thanks for this really complete issue.
The problem is actually pretty simple, we have dropped the support for MSBuild 12 starting from SonarC# 6.0. You will have to update your solution to at least VS2015/MSBuild 14 in order to use SonarQube with new version of SonarC#.

FYI, we have been displaying a deprecation message in the log of older version for quite a while:

WARN: ***********************************************************************************
WARN: *                 Use MSBuild 14 to get the best analysis results                 *
WARN: * The use of MSBuild 12 or the sonar-scanner to analyze C# projects is DEPRECATED *
WARN: ***********************************************************************************

Hope it answers your question.

Cheers,
Amaury

@pyo0723
Copy link
Author

pyo0723 commented Aug 10, 2017

Hi @Evangelink ,

Thank you for your answer.
I will attach a full log file of Jenkins.

We have a Jenkins system. (C # project)
We installed SonarQube 6.3.1 (or 6.5) and MSBuild v15 on the build server. (Not MSBuild v12)
After the build server builds the project, it analyzes the project on the SonarQube server.
(Developers are developing a project with VS2015.)
We use automation scripts as cakes.
The build task of the script is shown below.

Task("Build")
    .IsDependentOn("Clean")
    .IsDependentOn("PackageRestore")
    .Does(() =>
{
    MSBuild(solution, new MSBuildSettings()
        .SetConfiguration(configuration)
        .WithProperty("Platform", platform)
        .UseToolVersion(MSBuildToolVersion.VS2015)
        .SetVerbosity(Verbosity.Minimal)
        .SetNodeReuse(false)
        .WithProperty("Windows", "True")
        .WithProperty("TreatWarningsAsErrors", "False")
        .WithProperty("OutputPath", "./bin/Build/")
        .WithTarget("Build"));     
});

Console Output

Executing task: Build
Microsoft (R) Build Engine Version 15.1.1012.6693
Copyright (C) Microsoft Corporation. All rights reserved.

5.7_Full_Log.txt
6.3_Full_Log.txt

Please check the attached log files, 5.7 and 6.3.

I also attach a configuratoin screen for jenkins.

jenkins_setting

And attach sreenshots before and after the plug-in update.

[Before - report issues in code]
code analyzer for c 5 7 0 612_screenshot1

code analyzer for c 5 7 0 612_screenshot2

[After - doesn't report any issues in code]
code analyzer for c 6 3_screenshot1

Please tell me if you need any other confirmation.

@Evangelink Evangelink reopened this Aug 10, 2017
@Evangelink Evangelink added Type: Bug Exceptions and blocking issues during analysis. Area: SQ Plugin Java plugin related issues. labels Aug 11, 2017
@Evangelink
Copy link
Contributor

Hi @pyo0723,
Sorry for this late answer. It seems like you are using the scanner cli and not the scanner for MSBuild (which is the recommended and supported way of analysing a C# solution). Could you update your task following this guide and tell me if you are still having any issue?

@Evangelink Evangelink added this to the 6.4 milestone Aug 15, 2017
@Evangelink Evangelink self-assigned this Aug 15, 2017
@Evangelink Evangelink added the Status: On Hold Postponed or waiting for an answer. label Aug 17, 2017
@StrangeWill
Copy link

StrangeWill commented Sep 22, 2017

@Evangelink I know as of 6.x we're supposed to use the MSBuild scanner, but the CLI scanner was really useful for running analysis on code that cannot be run through MSBuild.

Is there any way to get the scanner CLI working in 6.x? I've basically rolled back to 5.11 for now to work around it.

@Evangelink
Copy link
Contributor

Hi @StrangeWill,
We have no plan to add it back because we don't see the value but I am interested to know what can of

analysis that cannot be run through MSBuild

you are talking about. Because we might have missed some special needs and will be happy to see whether we think we should do something about it.

@jermet
Copy link

jermet commented Oct 12, 2017

Hi @Evangelink
I have a similar problem: I would like to run the analysis on the source code files but do not want to build the project (more infrastructure to put in place when I just want to go through source files)
this does not seem to be possible

@StrangeWill
Copy link

@Evangelink For this case, I literally had a project that could not build due to it being left in an inconsistent state with dependencies (NuGet package availability issues), but I still wanted to run an analysis for the code. It's not uncommon for me to receive software from clients that may take me hours or even days to get running, it would be nice to take a look at the static code analysis first before jumping through poorly documented hoops on getting software running.

I do understand it's pretty edge-case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: SQ Plugin Java plugin related issues. Status: On Hold Postponed or waiting for an answer. Type: Bug Exceptions and blocking issues during analysis.
Projects
None yet
Development

No branches or pull requests

4 participants