首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SonarCloud分支没有代码行- bitbucket pipelines sonarsource/sonarcloud-scan

SonarCloud分支没有代码行- bitbucket pipelines sonarsource/sonarcloud-scan
EN

Stack Overflow用户
提问于 2019-07-17 17:22:39
回答 2查看 4.1K关注 0票数 0

我正在尝试集成sonarcloud和Bitbucket管道。我有一个简单的测试项目,其中包含一个名为index.php的文件,该文件由几行组成。

我完全不确定我应该遵循什么方法。

我已经创建了包含以下行的sonar-project.properties文件。

代码语言:javascript
复制
sonar.sourceEncoding=UTF-8
sonar.host.url=https://sonarcloud.io/dashboard?id=first_ftp
sonar.projectKey=first_ftp

这是我的yml文件

代码语言:javascript
复制
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网站时,它告诉我

代码语言:javascript
复制
The main branch has no lines of code

谁能帮我在php项目中使用bitbucket正确配置sonarcloud?

EN

回答 2

Stack Overflow用户

发布于 2019-10-15 19:55:02

我也遇到过同样的问题-在我的例子中是因为项目的名称-它被称为---------Test,显然,默认情况下,Sonar会将其视为测试程序集,并将其排除在分析之外。

票数 1
EN

Stack Overflow用户

发布于 2019-07-17 21:27:38

在bitbucket管道中运行代码分析之前,您必须首先手动运行分析(仅一次)。请按照以下步骤操作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57072578

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档