Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mike8161990 opened this issue Jan 14, 2025 · 3 comments · May be fixed by #430
Open
Labels
bug Something isn't working

Comments

@mike8161990
Copy link

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
@mike8161990 mike8161990 added the bug Something isn't working label Jan 14, 2025
@99orazio
Copy link

To solve this problem, i have modified line 19 of the file "metrics.properties" and i have removed the deprecated metrics which have been removed in the latest release of SonarQube.

@mike8161990
Copy link
Author

See also #429

@gian1200
Copy link

gian1200 commented Feb 6, 2025

To solve this problem, i have modified line 19 of the file "metrics.properties" and i have removed the deprecated metrics which have been removed in the latest release of SonarQube.

If that's the fix, maybe it can be put as a PR

@thomedw thomedw linked a pull request Feb 10, 2025 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants