Skip to content

[Misc] Record the deliberate SonarQube complexity and parameter-count findings in the code - #441

Open
vmassol wants to merge 1 commit into
masterfrom
claude/happy-ride-3ieye7
Open

vmassol wants to merge 1 commit into
masterfrom
claude/happy-ride-3ieye7

Conversation

@vmassol

@vmassol vmassol commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Jira URL

None — this is a [Misc] SonarQube cleanup commit.

Changes

Description

The 2 SonarCloud findings of this repo that the code deliberately keeps, recorded in the code with
@SuppressWarnings and the reason, as
okf/sonarqube
prescribes for a finding with no compliant form. Additive only; @SuppressWarnings has SOURCE
retention, so the compiled bytecode is byte-for-byte identical.

  • java:S3776 (cognitive complexity) on
    XWikiSyntaxEscapeWikiPrinter#printVerbatimContent — the method already carries
    @SuppressWarnings({"checkstyle:CyclomaticComplexity", "checkstyle:NPathComplexity", "checkstyle:JavaNCSS", "checkstyle:ExecutableStatementCount", "checkstyle:MultipleStringLiterals"}). XWiki runs Checkstyle as well as SonarQube and the
    project's own complexity checks are suppressed here, so the decision has already been taken and
    recorded; SonarQube reports it under a different metric and stayed open only because the
    annotation lacked its rule key. The edit adds exactly one string to that annotation.
    (AWgjJiip1_eUtAp8ETOa)
  • java:S107 (8 parameters) on AbstractInternalRenderingTest's constructor — a published
    constructor of the rendering test framework, taking one parameter per field of the test case being
    run. Shortening it changes a signature the integration tests of other modules depend on, so there
    is no compliant form; this one gets a new annotation and its reason in a comment.
    (AZNziSnUEcK0YeraNzE0)

Clarifications

  • Everything else open in this repo is either a documented whole-rule drop (java:S1135 TODO
    comments, java:S112, java:S3776 on methods with no recorded decision, javabugs:S2259) or
    needs a per-site design decision, so nothing else is included.
  • Related (same sweep): xwiki-platform #6407 (mechanical) and #6408 (judgement), xwiki-commons #1983, xwiki-rendering #441.

Screenshots & Video

N/A

Executed Tests

cd /home/user/xwiki-rendering && mvn clean install -Plegacy,quality -fae -pl \
  xwiki-rendering-syntaxes/xwiki-rendering-syntax-xwiki20,xwiki-rendering-test,xwiki-rendering-integration-tests

BUILD SUCCESS in 1:30, 1003 tests green (Syntax - XWiki 234, Test Framework 2, Integration
Tests 767 — the latter is what actually exercises the test framework class touched here),
revapi:check and checkstyle:check passing.

Expected merging strategy

Squash and merge. No backport needed.


🤖 Generated with Claude Code

https://claude.ai/code/session_01QXAHRgsiQVFddpUmhcQ47r


Generated by Claude Code

… findings in the code

* java:S3776: XWikiSyntaxEscapeWikiPrinter#printVerbatimContent already carries a @SuppressWarnings
  for the project's own Checkstyle complexity checks, so only the SonarQube rule key was missing.
* java:S107: AbstractInternalRenderingTest's constructor is a published signature of the rendering
  test framework, taking one parameter per field of the test case being run.

Co-Authored-By: xwikiorg-llm-bot <llm-bot@xwiki.org>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QXAHRgsiQVFddpUmhcQ47r
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants