2015-06-26 43 views
0

我试图显示与Sonarqube JavaScript项目的覆盖面。代码覆盖率的值是正确的,但我看不到源文件。Sonarqube Javascript覆盖范围不显示源文件

Screenshot

目前,我有以下项目结构:

angular-playground 
+- app 
| +- scripts 
| | +- app.js 
+- build 
| +- coverage 
| | +- lcov.info¨ 

这是我sonar-project.properties -File:

# metadata 
sonar.projectKey=angular-playground 
sonar.projectName=angular-playground 
sonar.projectVersion=1.0.0 

# source folders 
sonar.language=js 
sonar.sourceEncoding=UTF-8 
sonar.sources=app 
sonar.tests=test 

# coverage reporting 
sonar.javascript.lcov.reportPath=build/coverage/lcov.info 
sonar.surefire.reportsPath=build/reports/ 
sonar.dynamicAnalysis=reuseReports 

这是我lcov.info -File:

TN: 
SF:app/scripts/app.js 
FNF:0 
FNH:0 
DA:11,1 
LF:1 
LH:1 
BRF:0 
BRH:0 
end_of_record 

和调试日志:

SonarQube Runner 2.4 
Java 1.8.0_40 Oracle Corporation (64-bit) 
Windows 8.1 6.3 amd64 
INFO: Error stacktraces are turned on. 
INFO: Default locale: "de_CH", source code encoding: "UTF-8" 
INFO: SonarQube Server 5.1.1 
21:43:29.687 INFO - Load global repositories 
21:43:29.734 DEBUG - Download: http://<domain>/batch/global (no proxy) 
21:43:30.273 INFO - Load global repositories (done) | time=586ms 
21:43:30.289 INFO - Server id: 20150623160836 
21:43:30.320 INFO - Install plugins 
21:43:30.320 DEBUG - Download index of plugins 
21:43:30.320 DEBUG - Download: http://<domain>/deploy/plugins/index.txt (no proxy) 
21:43:30.945 DEBUG - Loaded 3329 properties from l10n bundles 
21:43:30.945 INFO - Install JDBC driver 
21:43:30.945 DEBUG - Download index of jdbc-driver 
21:43:30.945 DEBUG - Download: http://<domain>/deploy/jdbc-driver.txt (no proxy) 
21:43:31.070 INFO - Create JDBC datasource for jdbc:postgresql://<domain>/sonarqube?useUnicode=true&amp;characterEncoding=utf8 
21:43:32.750 DEBUG - Testing JDBC connection 
21:43:35.255 DEBUG - Download: http://<domain>/api/server (no proxy) 
21:43:35.529 INFO - Initializing Hibernate 
21:43:35.529 DEBUG - hibernate.generate_statistics: false 
21:43:35.529 DEBUG - hibernate.dialect: org.sonar.core.persistence.dialect.PostgreSql$PostgreSQLWithDecimalDialect 
21:43:35.529 DEBUG - hibernate.connection.provider_class: org.sonar.jpa.session.CustomHibernateConnectionProvider 
21:43:39.321 INFO - Load project repositories 
21:43:39.321 DEBUG - Download: http://<domain>/batch/project?key=angular-playground&amp;preview=false (no proxy) 
21:43:41.045 INFO - Load project repositories (done) | time=1724ms 
21:43:41.045 INFO - Load project settings 
21:43:41.730 INFO - Load technical debt model 
21:43:41.871 DEBUG - Load technical debt model (done) | time=141ms 
21:43:41.885 INFO - Apply project exclusions 
21:43:43.195 WARN - 'sonar.dynamicAnalysis' is deprecated since version 4.3 and should no longer be used. 
21:43:43.242 DEBUG - Acquire semaphore on project : [email protected][id=<null>,key=angular-playground,qualifier=TRK], with key batch-angular-playground 
21:43:43.383 INFO - ------------- Scan angular-playground 
21:43:43.398 INFO - Load module settings 
21:43:43.892 DEBUG - Available languages: 
21:43:43.894 DEBUG - * Java => "java" 
21:43:43.894 DEBUG - * JavaScript => "js" 
21:43:44.161 INFO - Language is forced to js 
21:43:44.177 INFO - Load rules 
21:43:53.327 DEBUG - Load rules (done) | time=9150ms 
21:43:53.403 DEBUG - Updating semaphore batch-angular-playground 
21:43:53.533 DEBUG - Code colorizer, supported languages: 
21:43:53.557 DEBUG - Initializers : 
21:43:53.557 INFO - Base dir: C:\<cwd>\angular-playground 
21:43:53.558 INFO - Working dir: C:\<cwd>\angular-playground\.sonar 
21:43:53.560 INFO - Source paths: app 
21:43:53.561 INFO - Test paths: test 
21:43:53.562 INFO - Source encoding: UTF-8, default locale: de_CH 
21:43:53.563 INFO - Index files 
21:43:53.573 DEBUG - Declared extensions of language [email protected] were converted to sonar.lang.patterns.java : **/*.java,**/*.jav 
21:43:53.573 DEBUG - Declared extensions of language [email protected] were converted to sonar.lang.patterns.js : **/*.js 
21:43:53.601 DEBUG - Language of file 'app/scripts/app.js' is detected to be 'js' 
21:43:53.614 DEBUG - Language of file 'app/scripts/controllers/main.js' is detected to be 'js' 
21:43:53.635 DEBUG - Language of file 'test/karma.ci.conf.js' is detected to be 'js' 
21:43:53.642 DEBUG - Language of file 'test/spec/controllers/main.js' is detected to be 'js' 
21:43:53.642 DEBUG - Language of file 'test/karma.conf.js' is detected to be 'js' 
21:43:53.658 INFO - 5 files indexed 
21:43:56.516 INFO - Quality profile for js: Sonar way 
21:43:57.456 INFO - JIRA issues sensor will not run as some parameters are missing. 
21:43:57.476 DEBUG - Sensors : Lines Sensor (wrapped) -> QProfileSensor -> InitialOpenIssuesSensor -> ProjectLinksSensor -> VersionEventsSensor -> JavaScriptSquidSensor -> SCM Sensor (wrapped) -> [email protected] -> [email protected] -> CPD Sensor (wrapped) 
21:43:57.476 INFO - Sensor Lines Sensor (wrapped) 
21:43:57.533 INFO - Sensor Lines Sensor (wrapped) (done) | time=57ms 
21:43:57.534 INFO - Sensor QProfileSensor 
21:43:57.549 INFO - Sensor QProfileSensor (done) | time=15ms 
21:43:57.550 INFO - Sensor InitialOpenIssuesSensor 
21:43:57.655 INFO - Sensor InitialOpenIssuesSensor (done) | time=105ms 
21:43:57.655 INFO - Sensor ProjectLinksSensor 
21:43:57.733 INFO - Sensor ProjectLinksSensor (done) | time=78ms 
21:43:57.733 INFO - Sensor VersionEventsSensor 
21:43:57.920 INFO - Sensor VersionEventsSensor (done) | time=187ms 
21:43:57.921 INFO - Sensor JavaScriptSquidSensor 
21:43:58.952 INFO - 2 source files to be analyzed 
21:43:59.338 INFO - 2/2 source files analyzed 
21:43:59.370 DEBUG - Metric lines is an internal metric computed by SonarQube. Provided value is ignored. 
21:43:59.385 DEBUG - Metric lines is an internal metric computed by SonarQube. Provided value is ignored. 
21:43:59.448 INFO - Sensor JavaScriptSquidSensor (done) | time=1527ms 
21:43:59.448 INFO - Sensor SCM Sensor (wrapped) 
21:43:59.479 INFO - Sensor SCM Sensor (wrapped) (done) | time=31ms 
21:43:59.479 INFO - Sensor [email protected] 
21:43:59.479 INFO - Analysing C:\<cwd>\angular-playground\build\coverage\lcov.info 
21:43:59.495 INFO - Sensor [email protected] (done) | time=16ms 
21:43:59.495 INFO - Sensor [email protected] 
21:43:59.495 INFO - Sensor [email protected] (done) | time=0ms 
21:43:59.495 INFO - Sensor CPD Sensor (wrapped) 
21:43:59.495 INFO - DefaultCpdEngine is used for js 
21:43:59.495 INFO - Cross-project analysis disabled 
21:43:59.510 DEBUG - Populating index from [moduleKey=angular-playground, relative=app/scripts/app.js, basedir=C:\<cwd>\angular-playground] 
21:43:59.526 DEBUG - Populating index from [moduleKey=angular-playground, relative=app/scripts/controllers/main.js, basedir=C:\<cwd>\angular-playground] 
21:43:59.526 DEBUG - Detection of duplications for [moduleKey=angular-playground, relative=app/scripts/app.js, basedir=C:\<cwd>\angular-playground] 
21:43:59.542 DEBUG - Detection of duplications for [moduleKey=angular-playground, relative=app/scripts/controllers/main.js, basedir=C:\<cwd>\angular-playground] 
21:43:59.542 INFO - Sensor CPD Sensor (wrapped) (done) | time=47ms 
21:43:59.542 INFO - No quality gate is configured. 
21:44:00.019 INFO - Compare to previous analysis (2015-06-29) 
21:44:00.066 INFO - Compare over 30 days (2015-05-30, analysis of Fri Jun 26 11:04:54 CEST 2015) 
21:44:00.636 INFO - Execute decorators... 
21:44:00.638 DEBUG - Decorators: ManualMeasureDecorator -> [email protected] -> QProfileEventsDecorator -> [email protected] -> [email protected] -> [email protected] -> FileTangleIndexDecorator -> SumDuplicationsDecorator -> UnitTestDecorator -> [email protected]033 -> [email protected] -> [email protected] -> org.s[email protected]4ba148fb -> [email protected]02e -> [email protected]80c52 -> or[email protected]32144b3c -> [email protected]2 -> f(lines) -> f(generated_lines) -> f(ncloc) -> f(generated_ncloc) -> f(classes) -> f(packages) -> f(functions) -> f(accessors) -> f(statements) -> f(public_api) -> f(comment_lines) -> f(public_undocumented_api) -> f(commented_out_code_lines) -> f(complexity) -> f(complexity_in_classes) -> f(complexity_in_functions) -> f(class_complexity_distribution) -> f(function_complexity_distribution) -> f(file_complexity_distribution) -> f(lines_to_cover) -> f(uncovered_lines) -> f(conditions_to_cover) -> f(uncovered_conditions) -> f(it_lines_to_cover) -> f(it_uncovered_lines) -> f(it_conditions_to_cover) -> f(it_uncovered_conditions) -> f(overall_lines_to_cover) -> f(overall_uncovered_lines) -> f(overall_conditions_to_cover) -> f(overall_uncovered_conditions) -> f(rfc) -> f(rfc_distribution) -> f(lcom4_distribution) -> f(package_cycles) -> f(package_tangles) -> f(package_feedback_edges) -> f(package_edges_weight) -> f(new_lines_to_cover) -> f(new_uncovered_lines) -> f(new_conditions_to_cover) -> f(new_uncovered_conditions) -> f(new_it_lines_to_cover) -> f(new_it_uncovered_lines) -> f(new_it_conditions_to_cover) -> f(new_it_uncovered_conditions) -> f(new_overall_lines_to_cover) -> f(new_overall_uncovered_lines) -> f(new_overall_conditions_to_cover) -> f(new_overall_uncovered_conditions) -> [email protected] -> [email protected] -> [email protected] -> DirectoryTangleIndexDecorator -> [email protected]525 -> CountUnresolvedIssuesDecorator -> CountFalsePositivesDecorator -> CommentDensityDecorator -> f(file_complexity) -> f(class_complexity) -> f(function_complexity) -> [email protected] -> [email protected] -> [email protected] -> [email protected] -> [email protected] -> [email protected]b -> [email protected]50de -> [email protected] -> [email protected]537545 -> [email protected] -> [email protected] -> VariationDecorator 
21:44:03.511 DEBUG - Updating semaphore batch-angular-playground 
21:44:04.137 DEBUG - Decorator time: 
    ManualMeasureDecorator: 289ms 
    [email protected]: 13ms 
    QProfileEventsDecorator: 173ms 
    [email protected]: 1ms 
    [email protected]: 1ms 
    [email protected]: 16ms 
    FileTangleIndexDecorator: 9ms 
    SumDuplicationsDecorator: 1ms 
    UnitTestDecorator: 1ms 
    [email protected]033: 127ms 
    [email protected]: 0ms 
    [email protected]: 1ms 
    org.s[email protected]4ba148fb: 606ms 
    [email protected]02e: 34ms 
    [email protected]80c52: 0ms 
    or[email protected]32144b3c: 0ms 
    [email protected]2: 1ms 
    f(lines): 1ms 
    f(generated_lines): 2ms 
    f(ncloc): 0ms 
    f(generated_ncloc): 1ms 
    f(classes): 0ms 
    f(packages): 0ms 
    f(functions): 0ms 
    f(accessors): 0ms 
    f(statements): 0ms 
    f(public_api): 0ms 
    f(comment_lines): 0ms 
    f(public_undocumented_api): 0ms 
    f(commented_out_code_lines): 0ms 
    f(complexity): 0ms 
    f(complexity_in_classes): 0ms 
    f(complexity_in_functions): 0ms 
    f(class_complexity_distribution): 0ms 
    f(function_complexity_distribution): 1ms 
    f(file_complexity_distribution): 1ms 
    f(lines_to_cover): 1ms 
    f(uncovered_lines): 0ms 
    f(conditions_to_cover): 0ms 
    f(uncovered_conditions): 0ms 
    f(it_lines_to_cover): 1ms 
    f(it_uncovered_lines): 0ms 
    f(it_conditions_to_cover): 0ms 
    f(it_uncovered_conditions): 0ms 
    f(overall_lines_to_cover): 0ms 
    f(overall_uncovered_lines): 0ms 
    f(overall_conditions_to_cover): 0ms 
    f(overall_uncovered_conditions): 0ms 
    f(rfc): 0ms 
    f(rfc_distribution): 0ms 
    f(lcom4_distribution): 0ms 
    f(package_cycles): 0ms 
    f(package_tangles): 0ms 
    f(package_feedback_edges): 0ms 
    f(package_edges_weight): 0ms 
    f(new_lines_to_cover): 0ms 
    f(new_uncovered_lines): 0ms 
    f(new_conditions_to_cover): 0ms 
    f(new_uncovered_conditions): 0ms 
    f(new_it_lines_to_cover): 0ms 
    f(new_it_uncovered_lines): 0ms 
    f(new_it_conditions_to_cover): 0ms 
    f(new_it_uncovered_conditions): 0ms 
    f(new_overall_lines_to_cover): 0ms 
    f(new_overall_uncovered_lines): 0ms 
    f(new_overall_conditions_to_cover): 1ms 
    f(new_overall_uncovered_conditions): 0ms 
    [email protected]: 2ms 
    [email protected]: 11ms 
    [email protected]: 5ms 
    DirectoryTangleIndexDecorator: 0ms 
    [email protected]525: 0ms 
    CountUnresolvedIssuesDecorator: 55ms 
    CountFalsePositivesDecorator: 2ms 
    CommentDensityDecorator: 0ms 
    f(file_complexity): 0ms 
    f(class_complexity): 0ms 
    f(function_complexity): 0ms 
    [email protected]: 8ms 
    [email protected]: 0ms 
    [email protected]: 1ms 
    [email protected]: 0ms 
    [email protected]: 0ms 
    [email protected]b: 0ms 
    [email protected]50de: 0ms 
    [email protected]: 1ms 
    [email protected]537545: 0ms 
    [email protected]: 5ms 
    [email protected]: 1032ms 
    VariationDecorator: 941ms 

21:44:04.138 INFO - Store results in database 
21:44:04.140 DEBUG - Execute org.sonar.batch.phases.GraphPersister 
21:44:04.165 DEBUG - Execute org.sonar.batch.index.SourcePersister 
21:44:04.494 DEBUG - Execute org.sonar.batch.index.ResourcePersister 
21:44:04.494 DEBUG - Execute org.sonar.batch.index.MeasurePersister 
21:44:06.450 DEBUG - Execute org.sonar.batch.index.DuplicationPersister 
21:44:06.600 INFO - Analysis reports generated in 135ms, dir size=767 bytes 
21:44:06.678 INFO - Analysis reports compressed in 63ms, zip size=3 KB 
21:44:06.678 DEBUG - Publish results 
21:44:06.945 INFO - Analysis reports sent to server in 266ms 
21:44:06.945 INFO - ANALYSIS SUCCESSFUL, you can browse http://<domain>/dashboard/index/angular-playground 
21:44:06.945 INFO - Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report. 
21:44:06.947 DEBUG - Post-jobs : 
21:44:06.948 DEBUG - Release semaphore on project : [email protected][id=75,key=angular-playground,qualifier=TRK], with key batch-angular-playground 
INFO: ------------------------------------------------------------------------ 
INFO: EXECUTION SUCCESS 
INFO: ------------------------------------------------------------------------ 
Total time: 39.758s 
Final Memory: 20M/469M 
INFO: ------------------------------------------------------------------------ 

当路径源文件是不正确./app/scripts/app.js然后我看到源文件,但不正确的覆盖值。我使用Sonar 5.1.1和JavaScript插件2.6。

这是一个javascript插件或配置错误的错误?

+0

您能提供分析的调试日志吗? (sonar-runner的输出-X) –

+0

@ Linda-SonarSourceTeam我添加了调试日志 – fabwu

回答

1

你的配置没问题。 UI中的问题:它仅列出具有未覆盖的行的文件。因为你没有他们 - 没有列出。但您仍然可以通过其他指标(文件,行)或“组件”页面浏览您的文件。

+0

好,覆盖范围较低我看到了这些文件。这是预期的行为?你为什么不显示所有文件? – fabwu