perf: minor render and file-collection optimizations - #156
Conversation
|
Warning Review limit reached
Next review available in: 23 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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 (1)
📝 WalkthroughWalkthroughThe changes extract file exclusion matching into a short-circuiting helper and memoize current working-directory resolution in validation result renderers. ChangesFile exclusion matching
Working-directory resolution
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/FileDetector/Collector.php (1)
164-180: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMissing
@paramannotation for$basename.The docblock annotates
@param string[] $patternsbut omits@param string $basename.📝 Suggested fix
/** * Returns true as soon as the basename matches any exclude pattern, * short-circuiting instead of evaluating every pattern. * + * `@param` string $basename * `@param` string[] $patterns */🤖 Prompt for 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. In `@src/FileDetector/Collector.php` around lines 164 - 180, Add the missing `@param string $basename` annotation to the docblock for `matchesAnyPattern`, alongside the existing `$patterns` annotation.
🤖 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.
Nitpick comments:
In `@src/FileDetector/Collector.php`:
- Around line 164-180: Add the missing `@param string $basename` annotation to
the docblock for `matchesAnyPattern`, alongside the existing `$patterns`
annotation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1fb91296-a3c6-4dc6-95bc-4f7315bf88b5
📒 Files selected for processing (2)
src/FileDetector/Collector.phpsrc/Result/AbstractValidationResultRenderer.php
# Conflicts: # src/FileDetector/Collector.php
Summary
Two small, safe optimizations from the performance review:
getcwd()+realpath()) for every path while grouping issues. It now resolves it once per renderer instance.Changes
src/FileDetector/Collector.php—matchesAnyPattern()helper with early returnsrc/Result/AbstractValidationResultRenderer.php— cache the resolved working directory per instanceSummary by CodeRabbit