我正在尝试集成sonarcloud和Bitbucket管道。我有一个简单的测试项目,其中包含一个名为index.php的文件,该文件由几行组成。
我完全不确定我应该遵循什么方法。
我已经创建了包含以下行的sonar-project.properties文件。
sonar.sourceEncoding=UTF-8
sonar.host.url=https://sonarcloud.io/dashboard?id=first_ftp
sonar.projectKey=first_ftp这是我的yml文件
image: aariacarterweir/lamp-gitftp:latest
clone:
depth: full # SonarCloud scanner needs the full history to assign issues properly
definitions:
caches:
sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
steps:
- step: &build-test-sonarcloud
name: Build, test and analyze on SonarCloud
caches:
- node
- sonar
script:
- npm install --quiet
- npm run test -- --code-coverage --no-watch --no-progress --browsers=ChromeHeadlessNoSandbox
- pipe: sonarsource/sonarcloud-scan:0.1.5
variables:
SONAR_TOKEN: ${SONAR_TOKEN}
EXTRA_ARGS: '-Dsonar.sources=src -Dsonar.tests=src -Dsonar.test.inclusions="**/testing/**,**/*.spec.ts" -Dsonar.typescript.lcov.reportPaths=coverage/lcov.info'当我登录sonarcloud网站时,它告诉我
The main branch has no lines of code谁能帮我在php项目中使用bitbucket正确配置sonarcloud?
发布于 2019-10-15 19:55:02
我也遇到过同样的问题-在我的例子中是因为项目的名称-它被称为---------Test,显然,默认情况下,Sonar会将其视为测试程序集,并将其排除在分析之外。
发布于 2019-07-17 21:27:38
在bitbucket管道中运行代码分析之前,您必须首先手动运行分析(仅一次)。请按照以下步骤操作。

https://stackoverflow.com/questions/57072578
复制相似问题