Skip to content

DOCX report generation fails on latest community build because of dropped complexity metrics #426

@mike8161990

Description

@mike8161990

Describe the bug

Report generation fails on latest community release of SonarQube server (25.1.0.102122-community) because it attempts to pull deprecated metrics which were deleted in this latest release.

See release notes here: https://docs.sonarsource.com/sonarqube-community-build/server-upgrade-and-maintenance/release-notes-and-notices/deprecations-and-removals-by-version/#sonarqube-community-build-25.1.0.102122

SonarQube Community Build 25.1.0.102122
Removed complexity metrics
The following complexity metrics, which were deprecated in SonarQube Server 6.7, have now been removed:
file_complexity
complexity_in_classes
class_complexity
complexity_in_functions
function_complexity
function_complexity_distribution
file_complexity_distribution

To reproduce

From the UI:

  1. Open CNES Report plugin in server UI
  2. Select export options as needed, in particular the DOCX generation
  3. Click Generate
  4. See error

From the CLI:

java -jar sonar-cnes-report-5.0.0.jar \
    -t "secret_here \
    -s "https://sonarqube.example.com" \
    -p "example-project" \
    -o "analysis-reports" \
    -e -f -m -c

Expected behavior

Expected the DOCX report to generate

Screenshots & log

error 13-Jan-2025 14:49:57 SonarQube URL: https://sonarqube.example.com
error 13-Jan-2025 14:49:57 SonarQube online: true
error 13-Jan-2025 14:49:57 Detected SonarQube version: 25.1.0.102122
error 13-Jan-2025 14:49:57 [WARNING] This SonarQube version is not supported by this cnesreport version.
error 13-Jan-2025 14:49:57 [WARNING] For further information, please refer to the compatibility matrix on the project GitHub page.
error 13-Jan-2025 14:49:57 [ERROR] Not found error sent by SonarQube server (code 404, URL https://sonarqube.example.com/api/measures/component?component=example-project&metricKeys=ncloc,violations,ncloc_language_distribution,duplicated_lines_density,comment_lines_density,coverage,sqale_rating,reliability_rating,security_rating,alert_status,security_review_rating,complexity,function_complexity,file_complexity,class_complexity,blocker_violations,critical_violations,major_violations,minor_violations,info_violations,new_violations,bugs,vulnerabilities,code_smells,reliability_remediation_effort,security_remediation_effort,sqale_index,tests,test_errors,test_failures,skipped_tests,test_success_density&branch=%, Error {"errors":[{"msg":"The following metric keys are not found: function_complexity, file_complexity, class_complexity"}]}), please check cnesreport compatibility with your SonarQube server version.

User environment

  • OS: Docker image (sonarqube:25.1.0.102122-community) running on CentOS Stream 9
  • Project version: sonar-cnes-report-5.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions