I installed SonarQube server in docker and analyzed first project.
There is metric named LoC (lines of code) in project.
How can i aggregate it per developer (git author), i want to see the impact of each developer in project?
Related
I've been setting up SonarQube analysis for one of our builds in VSTS, and I've noticed that there's a difference in the code analysis / build warnings if the advanced option "include full analysis report in build summary" is enabled in VSTS.
We have a custom ruleset enabled for our local builds in Visual Studio, which combines Microsoft CodeAnalysis warnings and StyleCop analyzers. When we run the build in VSTS with the full analysis report setting enabled, these warnings don't show up, and only the SonarQube warnings are displayed. I thought this was expected for all builds using SonarQube, as mentioned here in the link below.
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Extension+for+VSTS-TFS#AnalyzingwithSonarQubeExtensionforVSTS-TFS-Note
However, if we disable this setting, we get additional SonarQube warnings, but the Microsoft and StyleCop warnings also show up.
Can anyone explain why the two behaviors are different? Ideally, we'd like warnings from Microsoft, StyleCop and SonarQube to show up, AND for the build to include the full analysis report - is there any way to do this?
I'm using SonarQube v6.7.1.35068, SonarC# v6.7.1 (build 4347), and v3.* of the VSTS SonarQube task.
The Include full analysis report in the build summary setting doesn't change the ruleset or analyzers that are run during the analysis. All it does is cause the End task to poll the SonarQube server until the server-side part of the analysis has completed so that it can show the final analysis results on the VSTS build summary page.
To work out what is different between the builds you could try enabling more verbose logging:
for SonarQube, set the Additional Settings property of the VSTS Begin task /d:sonar.verbose=true
for VSTS, set the system.debug build to true
You're right, the Begin task does limit the analyzers and rules that are run to those that are configured on the SonarQube server.
To have the Microsoft FxCop rules run as past of the analysis run you would install the FxCop plugin for SonarQube and include its rules in your Quality Profile.
To run the StyleCop rules (assuming you're using the new Roslyn-base StyleCop analyzers) you would first have to create a SonarQube plugin for it using the SonarQube Roslyn SDK, then install the plugin and add the rules to Quality Profile.
First, the Include full analysis report in build summary shouldn’t affect the result in Issues section of build summary, it is used to upload the report to build summary and the result will be show in the bottom of build summary (below Work items linked to associated changes section).
Secondly, the Issues section of build summary can’t show all analysis result, just part of it.
You can upload the result files to build through Logging Command (e.g. Write-Host "##vso[task.addattachment type=Distributedtask.Core.Summary;name=testsummaryname;]c:\testsummary.md") and it will show in the bottom of build summary (The sonarqube task uses this way too).
I installed the SonarLint 6.6 for Eclipse (neno) using Eclipse marketplace.
It successful scanned my java project and returned 4725 items found.
I bind the project to SonarQube server which installed at the same PC
After anaylized the project again, I click "update all project bindings" at the SonarQube at Eclipse server to syn the result to SonarQube
My Questions
1) How can I syn the analyzed result to my server?
2) Are there any tool to category the analyzed result such as by severity? as I only interest on the "BUG"?
3) How can I configure the rule of SonarLint in Eclipse Environment?
May I have your help? Many thanks!
1) How can I syn the analyzed result to my server?
To analyze your project and see the result on SonarQube, you need to use one of the scanners. For example, if you build your project with Maven, then you can use the scanner for Maven. Or if you build your project with Ant or Gradle, there is a dedicated scanner for those too (as I linked). If you don't use any build tool, then you can use the scanner for CLI.
2) Are there any tool to category the analyzed result such as by severity? as I only interest on the "BUG"?
I'm not aware of such tool. And, at the time of this writing, the SonarLint On-The-Fly view is not configurable to do this (unlike the "native" Problems view of Eclipse). (This might be a good idea for future improvement, if there's enough interest for it.)
3) How can I configure the rule of SonarLint in Eclipse Environment?
It seems your project is bound to a project on SonarQube.
You can configure this on SonarQube.
In SonarQube, each project is associated with a quality profile.
After you can configure what rules to include,
you can update the bindings in Eclipse to apply the same configuration for SonarLint in Eclipse.
"Lines of Code" is blank in SonarQube's dashboard for my project. This project does not have any bugs and the unit test coverage is 80%.
How can I show the lines of code for this .net project in my SonarQube Dashboard?
I'm using sonar enterprise edition and sonar runner 2.8. I have excluded some folders and used some of this configurations in my jenkins job as well: sonar.sources=Source,sonar.language=cs,sonar.sourceEncoding=UTF-8. I'm using open cover as code coverage.
We are using Team City 9.1.5. Our main application is very old and complex, and over the years we have had to write several utilities to support customers. The utilities need to reference application components, and multiple versions of the utilities are maintained to correspond to different application versions.
To avoid creating a new release of the application every time a utility needs to be updated, we are using the Team City NuGet feed to host versions of our application's dlls. These are then referenced by the utilities in Visual Studio, etc.
The original solution was to create a separate build configuration for NuGet packages for every released version of the application. These are manually triggered to reduce the number of packages for a specific version of the app (i.e. I don't need a package for every build, just stable).
Over time, the number of supported versions of the application has grown, and so has the number of NuGet package build configurations. I am trying to consolidate these separate build configurations into a single build configuration with multiple build steps - one step per version. But when run, Team City will only publish the latest version of a package from a single configuration. Examination of the configuration's artifacts show that all all of the different versions are built and retained, but only the latest is published.
When I break the exact same build steps out into multiple configurations, one build step/configuration per version, the artifacts all show up again.
Is there a way to get Team City to publish all of the artifacts from a single configuration, even if there are multiple versions of the same package?
Per JetBrains, "Unfortunately it's a known bug in TeamCity: https://youtrack.jetbrains.com/issue/TW-40363, please vote for it."
My solution for now is to go ahead with the separate build configurations, although that will add maintenance overhead and "noise" to the TeamCity projects page.
We are also discussing an alternative solution of using one build configuration and pushing to a separate nuget package feed other than Team City's.
Neither of these options is desirable as both will require additional resources to implement.
I get this error:
"TF218027: the following reporting folder could not be created on the server running SQL Reporting Services."
I have no use for sql reporting services in my project, I'm just trying to share a simple project with my partner.
In the group membership section in team explorer it says
"If your deployment utilizes sql server reporting services you must also configure permissions in that software.."
Apart from the fact that I don't know how to do that, my deployment doesn't utilize ssrs
Can anyone please help?
Your setup must have some misconfiguration as the New Team Project wizard should skip Reporting setup. Check on the TFS Console.
You can still reach your goal using TFPT command line tool, e.g.
tfpt createteamproject /collection:DefaultCollection /teamproject:MyNewProject "/processtemplate:Microsoft Visual Studio Scrum 2013.4" /noportal /noreports
The TFPT tool requires the Team Foundation Power Tools.
Also note that to use Git instead of classic TFVC you must use the /sourcecontrol:None option and subsequently create the initial Git repo using a tool like my TfsGitAdmin.