无法加载代码气候报告,但报告存在

问题描述

在 gitlab 中,我有一个生成代码气候报告的管道,应该显示在 gitlab 小部件中。

报告已成功生成(我添加cat code-quality.json 但我收到消息“无法加载代码气候报告”。

当我查看 gitlab 页面的源代码时,我看到一个字符串,其中似乎包含了导致问题的代码

window.gl.mrWidgetData = { …,"codeclimate":{"head_path":"/needhelp/needhelp-web/-/jobs/123456789/artifacts/download?file_type=codequality\u0026proxy=true","base_path":"/needhelp/needhelp-web/-/jobs/987654321/artifacts/download?file_type=codequality\u0026proxy=true"},"…

当我在没有 \u0026proxy=true 的情况下复制/粘贴网址栏中的路径时,文件已成功下载。

此处是生成文件.gitlab-ci.yml 配置。

static analysis:
    stage: test
    interruptible: true
    image:
        name: $CI_QA_IMAGE
        entrypoint: [""]
    script:
        - composer install --prefer-dist --no-progress --classmap-authoritative --quiet
        - PHP bin/console --env=test cache:warmup
        - |
            ./vendor/bin/PHPstan analyze -c PHPstan.neon --no-progress --memory-limit 1G --error-format=gitlab > code-quality.json && PHPstan_error=0 || PHPstan_error=1
            if [[ -n $PHPstan_error ]]; then
                echo -e '\e[103;1mPHPstan detected errors.\e[0m'
                ls -lh code-quality.json
                cat code-quality.json
                ./vendor/bin/PHPstan analyze -c PHPstan.ci.neon --no-progress --memory-limit 1G
            else
                echo -e '\e[92;1mPHPstan detected no error with levelmax configuration.\e[0m'
            fi
        - bin/console lint:twig --env=test
        - bin/console lint:container --env=test
        - bin/console lint:xliff translations/ --env=test
    artifacts:
        when: always
        reports:
            codequality: ./code-quality.json

你知道这段代码有什么问题吗?或者如果没问题,我应该去哪里解决这个问题?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)