SonarQube未使用MSBuild分析来源

时间:2017-02-03 12:09:23

标签: c# jenkins msbuild sonarqube

我正在尝试使用SonarQube& amp;来构建/分析几个C#项目MSBuild但是,即使分析成功完成且没有任何错误,似乎并非所有来源都被分析。

例如,我有一个名为“Filter”的项目,包含6个.cs文件,这些文件在分析过程中被发现并编入索引(AssemblyInfo.cs,FilterApplicationView.cs,FilterFindView.cs,FilterSaveView.cs,FilterView.cs,RegistrationManager.cs)但只有2个出现在SonarQube仪表板的“代码行测量”页面中(AssemblyInfo.cs和RegistrationManager.cs)。

有人可以帮我找到原因以及如何解决这个问题吗?

这是用于分析的Jenkins输出:

11:49:11.954 INFO: -------------  Scan Filter
11:49:12.123 INFO: Load server rules
11:49:12.184 DEBUG: GET 200 http://hostname:port/sonar/api/rules/list.protobuf | time=61ms
11:49:12.194 INFO: Load server rules (done) | time=71ms
11:49:12.255 DEBUG: Initializers : 
11:49:12.255 INFO: Base dir: C:\deliv_jenkins\workspace\workspace\Summit_Sonar_Test_Windows\FT_Front\Filter
11:49:12.255 INFO: Working dir: C:\deliv_jenkins\workspace\workspace\Summit_Sonar_Test_Windows\.sonarqube\out\.sonar\org.misys.summit-CSharp-Temp_org.misys.summit-CSharp-Temp_6E53A807-9ABD-4614-8BBA-F1EA5B310FD8
11:49:12.255 INFO: Source paths: AssemblyInfo.cs, FilterApplicationView.cs, FilterFindView.cs, FilterSaveView.cs, FilterView.cs, RegistrationManager.cs, App.ico, FilterApplicationView.resx, FilterFindView.resx, FilterSaveView.resx, FilterView.resx
11:49:12.256 INFO: Source encoding: UTF-8, default locale: en_US
11:49:12.256 INFO: Index files
11:49:12.268 DEBUG: Declared extensions of language C were converted to sonar.lang.patterns.c : **/*.c,**/*.h
11:49:12.268 DEBUG: Declared extensions of language C++ were converted to sonar.lang.patterns.cpp : **/*.cc,**/*.cpp,**/*.cxx,**/*.c++,**/*.hh,**/*.hpp,**/*.hxx,**/*.h++,**/*.ipp
11:49:12.268 DEBUG: Declared extensions of language Objective-C were converted to sonar.lang.patterns.objc : **/*.m
11:49:12.269 DEBUG: Declared extensions of language RPG were converted to sonar.lang.patterns.rpg : **/*.rpg,**/*.rpgle,**/*.rpg,**/*.rpgle
11:49:12.269 DEBUG: Declared extensions of language JavaScript were converted to sonar.lang.patterns.js : **/*.js
11:49:12.269 DEBUG: Declared extensions of language PL/SQL were converted to sonar.lang.patterns.plsql : **/*.sql,**/*.pks,**/*.pkb
11:49:12.269 DEBUG: Declared extensions of language C# were converted to sonar.lang.patterns.cs : **/*.cs
11:49:12.269 DEBUG: Declared extensions of language JSP were converted to sonar.lang.patterns.jsp : **/*.jsp
11:49:12.270 DEBUG: Declared extensions of language Java were converted to sonar.lang.patterns.java : **/*.java,**/*.jav
11:49:12.270 DEBUG: Declared extensions of language Visual Basic .NET were converted to sonar.lang.patterns.vbnet : **/*.vb
11:49:12.274 DEBUG: Language of file 'FilterApplicationView.cs' is detected to be 'cs'
11:49:12.275 DEBUG: Language of file 'FilterFindView.cs' is detected to be 'cs'
11:49:12.275 DEBUG: Language of file 'AssemblyInfo.cs' is detected to be 'cs'
11:49:12.293 INFO: Analyzer working directory contains 5 .pb file(s)
11:49:12.318 DEBUG: Language of file 'FilterView.cs' is detected to be 'cs'
11:49:12.323 DEBUG: Language of file 'FilterSaveView.cs' is detected to be 'cs'
11:49:12.329 DEBUG: Language of file 'RegistrationManager.cs' is detected to be 'cs'
11:49:12.366 INFO: 6 files indexed
11:49:12.371 INFO: Quality profile for cs: Sonar way
11:49:12.380 WARN: ----------------------------------------------------------------
11:49:12.380 WARN: Sonargraph Integration: Skipping project Filter [org.misys.summit-CSharp-Temp:org.misys.summit-CSharp-Temp:6E53A807-9ABD-4614-8BBA-F1EA5B310FD8], since no Sonargraph rules are activated in current SonarQube quality profile [SonarQube].
11:49:12.380 WARN: ----------------------------------------------------------------
11:49:12.384 DEBUG: Code colorizer, supported languages: jsp
11:49:13.179 DEBUG: 'C' skipped because there is no related file in current project
11:49:13.179 DEBUG: 'CPP' skipped because there is no related file in current project
11:49:13.179 DEBUG: 'Objective-C' skipped because there is no related file in current project
11:49:13.179 DEBUG: 'gcov' skipped because there is no related file in current project
11:49:13.180 DEBUG: 'llvm-cov' skipped because there is no related file     in current project
11:49:13.180 DEBUG: 'cppunit' skipped because there is no related file in current project
11:49:13.180 DEBUG: 'VisualStudioCoverage' skipped because there is no related file in current project
11:49:13.180 DEBUG: 'bullseye' skipped because there is no related file in current project
11:49:13.180 DEBUG: 'RPG sensor' skipped because there is no related file in current project
11:49:13.180 DEBUG: 'JavaScript Squid Sensor' skipped because there is no related file in current project
11:49:13.181 DEBUG: 'PL/SQL Sensor' skipped because there is no related file in current project
11:49:13.181 DEBUG: 'FindBugs Sensor' skipped because there is no related file in current project
11:49:13.181 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
11:49:13.181 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
11:49:13.181 DEBUG: 'JaCoCoItSensor' skipped because there is no related file in current project
11:49:13.181 DEBUG: 'JaCoCoOverallSensor' skipped because there is no related file in current project
11:49:13.181 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
11:49:13.181 DEBUG: 'VB.NET' skipped because there is no related file in current project
11:49:13.184 DEBUG: Sensors : Lines Sensor -> Sonar-Sonargraph-Plugin [3.5] -> SCM Sensor -> C# -> Coverage Report Import -> Coverage Report Import -> Unit Test Results Import -> XmlFileSensor -> Coverage Report Import -> Coverage Report Import -> Unit Test Results Import -> Zero Coverage Sensor -> Code Colorizer Sensor -> CPD Block Indexer
11:49:13.185 INFO: Sensor Lines Sensor
11:49:13.195 INFO: Sensor Lines Sensor (done) | time=10ms
11:49:13.195 INFO: Sensor Sonar-Sonargraph-Plugin [3.5]
11:49:13.197 INFO: ----------------------------------------------------------------
11:49:13.197 INFO: Sonargraph: Skipping project Filter [org.misys.summit-CSharp-Temp:org.misys.summit-CSharp-Temp:6E53A807-9ABD-4614-8BBA-F1EA5B310FD8], since no Sonargraph rules are activated in current SonarQube quality profile.
11:49:13.197 INFO: ----------------------------------------------------------------
11:49:13.197 INFO: Sensor Sonar-Sonargraph-Plugin [3.5] (done) | time=2ms
11:49:13.197 INFO: Sensor SCM Sensor
11:49:13.209 INFO: Sensor SCM Sensor (done) | time=12ms
11:49:13.209 INFO: Sensor C#
11:49:13.214 INFO: SonarAnalyzer.Scanner needs to be executed: false
11:49:13.214 INFO: Importing analysis results from C:\deliv_jenkins\workspace\workspace\Summit_Sonar_Test_Windows\.sonarqube\out\Filter_AnyCPU_Debug_3557\output-cs
11:49:13.259 INFO: Importing Roslyn report
11:49:13.322 INFO: Sensor C# (done) | time=112ms
11:49:13.322 INFO: Sensor Coverage Report Import
11:49:13.322 DEBUG: No coverage property. Skip Sensor
11:49:13.322 INFO: Sensor Coverage Report Import (done) | time=0ms
11:49:13.322 INFO: Sensor Coverage Report Import
11:49:13.322 DEBUG: No coverage property. Skip Sensor
11:49:13.322 INFO: Sensor Coverage Report Import (done) | time=0ms
11:49:13.322 INFO: Sensor Unit Test Results Import
11:49:13.322 DEBUG: No unit test results property. Skip Sensor
11:49:13.323 INFO: Sensor Unit Test Results Import (done) | time=1ms
11:49:13.323 INFO: Sensor XmlFileSensor
11:49:13.323 INFO: Sensor XmlFileSensor (done) | time=0ms
11:49:13.323 INFO: Sensor Coverage Report Import
11:49:13.323 DEBUG: No coverage property. Skip Sensor
11:49:13.323 INFO: Sensor Coverage Report Import (done) | time=0ms
11:49:13.323 INFO: Sensor Coverage Report Import
11:49:13.323 DEBUG: No coverage property. Skip Sensor
11:49:13.323 INFO: Sensor Coverage Report Import (done) | time=0ms
11:49:13.323 INFO: Sensor Unit Test Results Import
11:49:13.324 DEBUG: No unit test results property. Skip Sensor
11:49:13.324 INFO: Sensor Unit Test Results Import (done) | time=1ms
11:49:13.324 INFO: Sensor Zero Coverage Sensor
11:49:13.333 INFO: Sensor Zero Coverage Sensor (done) | time=9ms
11:49:13.333 INFO: Sensor Code Colorizer Sensor
11:49:13.333 INFO: Sensor Code Colorizer Sensor (done) | time=0ms
11:49:13.334 INFO: Sensor CPD Block Indexer
11:49:13.334 INFO: DefaultCpdBlockIndexer is used for cs
11:49:13.334 DEBUG: No CpdMapping for language cs
11:49:13.334 INFO: Sensor CPD Block Indexer (done) | time=0ms

0 个答案:

没有答案