#286: Implement external methods called metric#1285
Conversation
|
Warning Review limit reached
Next review available in: 6 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 Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe external method metric now accepts AST or filepath inputs, derives external names from method invocations minus declared methods, and returns an integer count. Tests cover AST construction, filepath compatibility, local calls, super calls, and test module loading. ChangesExternal method counting
Estimated code review effort: 3 (Moderate) | ~20 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
aibolit/metrics/external_methods_called/external_methods_called.py (1)
15-18: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueWiden the
valueinput type
valueaccepts non-ASTinputs and converts them withbuild_ast, so the signature should reflectAST | str(or similar) instead ofAST.🤖 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 `@aibolit/metrics/external_methods_called/external_methods_called.py` around lines 15 - 18, Update ExternalMethodsCalled.value to annotate its ast parameter as accepting both AST instances and source strings (AST | str or the project’s equivalent input type), matching the existing isinstance conversion and build_ast handling while preserving the current return behavior.
🤖 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 `@aibolit/metrics/external_methods_called/external_methods_called.py`:
- Around line 28-34: Update _external_method_names_called to inspect both
METHOD_INVOCATION and SUPER_METHOD_INVOCATION AST node types, while preserving
the existing local-method filtering and member-name collection behavior.
---
Nitpick comments:
In `@aibolit/metrics/external_methods_called/external_methods_called.py`:
- Around line 15-18: Update ExternalMethodsCalled.value to annotate its ast
parameter as accepting both AST instances and source strings (AST | str or the
project’s equivalent input type), matching the existing isinstance conversion
and build_ast handling while preserving the current return behavior.
🪄 Autofix (Beta)
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
Run ID: 60d4f2cc-0c2a-4452-9daa-110644a1ef6b
📒 Files selected for processing (3)
aibolit/metrics/external_methods_called/external_methods_called.pytest/metrics/external_methods_called/LocalMethodCall.javatest/metrics/external_methods_called/test_external_methods_called.py
|
@yegor256 awaiting approval |
|
@yegor256 awaiting approval |
Summary by CodeRabbit
super) method invocations.supermethod call scenarios.