【问题标题】:Sonar Scanner Sonarqube: The main branch has no lines of codeSonar Scanner Sonarqube:主分支没有代码行
【发布时间】:2022-11-23 04:51:16
【问题描述】:

我的 SonarScanner 运行“成功”完成,但随后组件显示“主分支没有代码行”。

在谷歌搜索之后,这似乎是一个非常深入的问题,有很多可能的原因,所以也许更像是冰雹,我的SONAR_SCANNER_OPTS 有什么明显的问题吗?或者对于从哪里开始挖掘有什么建议吗?

这个包使用 python,如果有什么不同的话,整个过程都在 AWS Lambda 函数中运行。

SONAR_SCANNER_OPTS=
-Dsonar.host.url=https://internal.integ.sonarqube.adninfra.net
-Dsonar.login=<VALID_LOGIN_CHARS>
-Dsonar.projectBaseDir=/tmp/tmp_static_analysis_xywpac41/tmpo0eyrv2a/generic-flavor/src   
-Dsonar.projectName=VALID_PROJECT_NAME  
-Dsonar.projectKey=VALID_PROJECT_KEY 
-Dsonar.projectVersion=1.0.29043.0 
-Dsonar.externalIssuesReportPaths= 
-Dsonar.coverage.exclusions=build/**/*,**/tst/**/*,**/test/**/*,**/examples/**/*,**/doc/**/*,**/documentation/**/*,**/third-party-src/**/*,**/generated/**/* 
-Dsonar.coverage.jacoco.xmlReportPaths=- 
-Dsonar.lang.patterns.c=- 
-Dsonar.cpp.file.suffixes=- 
-Dsonar.objc.file.suffixes=- 
-Dsonar.css.file.suffixes=- 
-Dsonar.sourceEncoding=UTF-8 
-Dsonar.scm.disabled=true 
-Dsonar.sonar.python.coverage.reportPaths=/tmp/tmp_static_analysis_xywpac41/gtd-no-branch-wv98cchq.xml 
-Dsonar.python.file.suffixes=.cc,.cpp,.cxx,.h,.hpp,.hxx,.c 
-Dsonar.inclusions=**/* 
-Dsonar.branch.name=VALID_BRANCH/NAME

非常感激!

【问题讨论】:

    标签: sonarqube sonarscanner


    【解决方案1】:

    原来问题出在 -Dsonar.python.file.suffixes 参数上。

    将其设置为此解决了问题:-Dsonar.python.file.suffixes=.py,.pyc,.pyo,pyd

    【讨论】:

      猜你喜欢
      • 2018-07-27
      • 2017-09-01
      • 2017-09-18
      • 2019-11-13
      • 2020-09-09
      • 1970-01-01
      • 2018-11-15
      • 2019-11-08
      • 2018-10-26
      相关资源
      最近更新 更多