亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

SonarCloud 分支沒有代碼行 - bitbucket 管道

SonarCloud 分支沒有代碼行 - bitbucket 管道

PHP
一只甜甜圈 2021-10-15 10:47:51
我正在嘗試將聲納云與 Bitbucket 管道集成。我有一個簡單的測試項目,其中包含幾行名為 index.php 的單個文件。我完全不確定我應該遵循什么方法。我創建了由以下幾行組成的 sonar-project.properties 文件。sonar.sourceEncoding=UTF-8sonar.host.url=https://sonarcloud.io/dashboard?id=first_ftpsonar.projectKey=first_ftp這是我的 yml 文件image: aariacarterweir/lamp-gitftp:latestclone:  depth: full # SonarCloud scanner needs the full history to assign issues properlydefinitions:  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任何人都可以幫助我如何使用 bitbucket 為 php 項目正確配置聲納云。
查看完整描述

2 回答

?
慕桂英546537

TA貢獻1848條經驗 獲得超10個贊

我遇到了同樣的問題 - 在我的情況下,這是因為項目的名稱 - 它被稱為---------Test,顯然,默認情況下,Sonar 會將其視為測試程序集并將其排除在分析之外。


查看完整回答
反對 回復 2021-10-15
?
天涯盡頭無女友

TA貢獻1831條經驗 獲得超9個贊

在 bitbucket 管道中運行代碼分析之前,您必須首先手動運行分析(僅一次)。按照以下步驟操作。 

http://img1.sycdn.imooc.com//6168ebff0001c7ad17180726.jpg


查看完整回答
反對 回復 2021-10-15
  • 2 回答
  • 0 關注
  • 991 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號