Repository navigation
chore(sonar): add XOOPS-convention exclusions to the baseline template - #12
Conversation
Ship the sonar.issue.ignore.multicriteria block in the DevOps baseline so every module that adopts it inherits the suppression for the SonarPHP rules that clash with mandated XOOPS conventions and with test doubles: S115 (constants start with '_'), S100 (snake_case lifecycle hooks), S1172/S1186 (a stub matches a signature it does not use), and S1142 (guard-clause early returns). Binds only under the CI scanner; SonarCloud Automatic Analysis must be off for it to take effect.
Reviewer's GuideAdds a SonarPHP multi-criteria ignore block to the shared sonar-project.properties baseline so all modules inherit explicit exclusions for rules that conflict with XOOPS conventions and test-double patterns, effective only when using the CI scanner instead of SonarCloud Automatic Analysis. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Review limit reached
Next review available in: 23 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe SonarCloud configuration adds documented exclusions for selected XOOPS naming rules, test-double patterns, and intentional guard-clause returns. The exclusions apply to PHP files and test paths. ChangesSonarCloud issue exclusions
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider narrowing some of the broader
resourceKeypatterns (e.g.**/*.phpfor S115, S100, S1142) to the specific XOOPS modules or language/installer directories where these conventions are required, so that you don’t hide genuine issues in unrelated PHP files. - It may be worth adding a brief inline comment mapping each
xNID to its rule (e.g.x1 -> S115) directly besidesonar.issue.ignore.multicriteria=x1,x2,...to make it easier to keep the list in sync if rules are added or removed in future.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider narrowing some of the broader `resourceKey` patterns (e.g. `**/*.php` for S115, S100, S1142) to the specific XOOPS modules or language/installer directories where these conventions are required, so that you don’t hide genuine issues in unrelated PHP files.
- It may be worth adding a brief inline comment mapping each `xN` ID to its rule (e.g. `x1 -> S115`) directly beside `sonar.issue.ignore.multicriteria=x1,x2,...` to make it easier to keep the list in sync if rules are added or removed in future.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@sonar-project.properties`:
- Around line 44-49: Restrict the x3 (php:S1172) and x4 (php:S1186) Sonar
exclusions from the broad tests/** pattern to the specific test-double files or
dedicated test-double directory containing the intentional unused parameters and
empty methods. Keep real test files covered by these rules.
- Around line 34-42: Narrow the resourceKey patterns for Sonar exclusions x1,
x2, and x5 from **/*.php to the exact files or smallest directories containing
the documented XOOPS constants, lifecycle hooks, and provider/install guard
clauses; preserve each ruleKey while ensuring unrelated PHP files remain subject
to S115, S100, and S1142.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: cd02d18c-f6f1-4dda-9bef-6fc96f9ab9bd
📒 Files selected for processing (1)
sonar-project.properties
…ar sources Bring the DevOps baseline template in line with the xtracy PR-review fixes so modules that adopt it inherit the corrected scaffolding: - .gitattributes: do not export-ignore CHANGELOG.md (docs already ship), so release archives keep the user-facing changelog. - .gitignore: anchor phpstan.neon / phpunit.xml / psalm.xml with a leading slash, so only the root local-override copies are ignored. - sonar-project.properties: add tests/** to sonar.exclusions so tests are not indexed as analysis sources; sonar.tests still exposes them for test analysis.
Answer PR XoopsModules27x#12 review on the ignore scopes: - S115: narrowed to language/**/*.php -- the mandated home of _MI_/_MA_/_AM_ constants; every other PHP file keeps the rule. - S100: narrowed to include/**/*.php and blocks/**/*.php, where XOOPS mandates snake_case entry points (lifecycle hooks, block callbacks); class code stays camelCase-checked. Split into two entries since a multicriteria item takes a single resourceKey. - S1172/S1186 stay on tests/**: after tests were source-excluded, only tests/**/*Test.php is indexed at all, so a dedicated doubles directory would be invisible to the analyzer; doubles reach it as inline classes in *Test.php files, which path patterns cannot separate from the tests beside them. Documented in the comment instead. - S1142 stays repo-wide: guard-clause early returns are the house style across module entry points, not a per-file exception; the comment now says so instead of implying a narrower scope.
Ship the sonar.issue.ignore.multicriteria block in the DevOps baseline so every module that adopts it inherits the suppression for the SonarPHP rules that clash with mandated XOOPS conventions and with test doubles: S115 (constants start with '_'), S100 (snake_case lifecycle hooks), S1172/S1186 (a stub matches a signature it does not use), and S1142 (guard-clause early returns).
Binds only under the CI scanner; SonarCloud Automatic Analysis must be off for it to take effect.
Summary by Sourcery
Chores:
Summary by CodeRabbit