Skip to content

Avoid getters and setters: enable EO007 check#851

Merged
rultor merged 4 commits into
cqfn:masterfrom
AntonProkopyev:enable-eo007-850
Jul 21, 2025
Merged

Avoid getters and setters: enable EO007 check#851
rultor merged 4 commits into
cqfn:masterfrom
AntonProkopyev:enable-eo007-850

Conversation

@AntonProkopyev

@AntonProkopyev AntonProkopyev commented Jul 5, 2025

Copy link
Copy Markdown
Contributor

Closes: #850

Summary by CodeRabbit

  • Refactor

    • Unified and simplified method names across the codebase for AST traversal and node access, improving consistency and readability.
    • Updated internal and public method names to remove legacy prefixes and enhance encapsulation.
    • Streamlined interfaces for working with AST nodes and subtrees in metrics and pattern detection.
    • Refactored pattern detection to operate directly on AST node objects instead of graph node IDs.
  • Bug Fixes

    • Removed an obsolete error code from the linter configuration.
  • Tests

    • Updated tests to use the new method names and interfaces.
    • Removed redundant setup methods in test cases.

@coderabbitai

coderabbitai Bot commented Jul 5, 2025

Copy link
Copy Markdown

Walkthrough

This change refactors the AST API by renaming methods and attributes for consistency, replaces deprecated method calls throughout the codebase and tests, removes the error code EO007 from the .flake8 ignore list, and updates traversal in some patterns to use ASTNode objects directly instead of graph-based traversal. No logic or control flow is altered.

Changes

Files / Patterns Change Summary
.flake8 Removed EO007 from ignored error codes.
aibolit/ast_framework/ast.py, aibolit/ast_framework/computed_fields_registry.py, aibolit/ast_framework/ast_node.py Refactored AST API: renamed methods/attributes (e.g., get_rootroot), made attributes private.
aibolit/ast_framework/ast.py Added with_fields_and_methods method for filtering AST by allowed fields and methods.
aibolit/ast_framework/java_class_decomposition.py Updated to use new AST API method names.
aibolit/ast_framework/scope.py, aibolit/ast_framework/scope_extractors.py Updated calls to new AST API methods (e.g., get_subtreesubtree).
aibolit/metrics/*, aibolit/patterns/*, aibolit/utils/* Replaced deprecated AST method calls with new ones throughout metrics, patterns, and utils.
aibolit/metrics/cognitiveC/cognitive_c.py Updated to use new AST API methods for subtrees and root nodes.
aibolit/patterns/var_middle/var_middle.py Updated traversal to use ASTNode objects and ast.traverse instead of graph-based traversal.
aibolit/__main__.py, scripts/04-find-patterns.py Updated to use new AST API method names.
test/ast_framework/*, test/metrics/hv/test_all_types.py, test/ast_framework/test_java_class_decomposition.py, test/ast_framework/test_scope.py Updated tests to use new AST API; removed redundant test setup in one test file.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant AST
    participant ASTNode

    Client->>AST: ast.subtrees(ASTNodeType.CLASS_DECLARATION)
    loop For each class_ast
        Client->>AST: class_ast.with_fields_and_methods(fields, methods)
        AST->>AST: Validate root is CLASS_DECLARATION
        AST->>AST: Filter and construct new AST with allowed fields/methods
        AST-->>Client: Filtered AST
    end
    Client->>AST: ast.proxy_nodes(ASTNodeType.METHOD_DECLARATION)
    Client->>ASTNode: node.attr, node.children, etc.
Loading

Estimated code review effort

3 (30–60 minutes)

Possibly related PRs

Suggested reviewers

  • ivanovmg
  • yegor256

Poem

In fields of code where ASTs grow,
The rabbits hop, refactor slow.
Getters and setters, now in sight,
With elegant names, their code is light.
EO007 hops away,
Leaving code more bright today!

((_/)
(='.'=)
(")_(")


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1865886 and ecda9ac.

📒 Files selected for processing (65)
  • .flake8 (1 hunks)
  • aibolit/__main__.py (1 hunks)
  • aibolit/ast_framework/ast.py (9 hunks)
  • aibolit/ast_framework/ast_node.py (2 hunks)
  • aibolit/ast_framework/computed_fields_registry.py (1 hunks)
  • aibolit/ast_framework/java_class_decomposition.py (5 hunks)
  • aibolit/ast_framework/scope.py (1 hunks)
  • aibolit/ast_framework/scope_extractors.py (10 hunks)
  • aibolit/metrics/NumberMethods/NumberMethods.py (1 hunks)
  • aibolit/metrics/RFC/rfc.py (2 hunks)
  • aibolit/metrics/cc/main.py (2 hunks)
  • aibolit/metrics/cognitiveC/cognitive_c.py (1 hunks)
  • aibolit/metrics/external_methods_called/external_methods_called.py (1 hunks)
  • aibolit/metrics/fanout/FanOut.py (1 hunks)
  • aibolit/metrics/local_methods_calls/local_methods_calls.py (1 hunks)
  • aibolit/metrics/max_diameter/max_diameter.py (1 hunks)
  • aibolit/metrics/ncss/ncss.py (1 hunks)
  • aibolit/metrics/npath/main.py (1 hunks)
  • aibolit/patterns/array_as_argument/array_as_argument.py (1 hunks)
  • aibolit/patterns/assert_in_code/assert_in_code.py (1 hunks)
  • aibolit/patterns/assign_null_finder/assign_null_finder.py (1 hunks)
  • aibolit/patterns/classic_getter/classic_getter.py (1 hunks)
  • aibolit/patterns/classic_setter/classic_setter.py (1 hunks)
  • aibolit/patterns/empty_rethrow/empty_rethrow.py (2 hunks)
  • aibolit/patterns/er_class/er_class.py (1 hunks)
  • aibolit/patterns/force_type_casting_finder/force_type_casting_finder.py (1 hunks)
  • aibolit/patterns/hybrid_constructor/hybrid_constructor.py (1 hunks)
  • aibolit/patterns/if_return_if_detection/if_detection.py (1 hunks)
  • aibolit/patterns/implements_multi/implements_multi.py (1 hunks)
  • aibolit/patterns/incomplete_for/incomplete_for.py (1 hunks)
  • aibolit/patterns/instanceof/instance_of.py (1 hunks)
  • aibolit/patterns/joined_validation/joined_validation.py (1 hunks)
  • aibolit/patterns/loop_outsider/loop_outsider.py (2 hunks)
  • aibolit/patterns/many_primary_ctors/many_primary_ctors.py (2 hunks)
  • aibolit/patterns/method_chaining/method_chaining.py (1 hunks)
  • aibolit/patterns/method_siblings/method_siblings.py (1 hunks)
  • aibolit/patterns/multiple_try/multiple_try.py (1 hunks)
  • aibolit/patterns/multiple_while/multiple_while.py (1 hunks)
  • aibolit/patterns/mutable_index/mutable_index.py (1 hunks)
  • aibolit/patterns/nested_blocks/nested_blocks.py (1 hunks)
  • aibolit/patterns/non_final_argument/non_final_argument.py (1 hunks)
  • aibolit/patterns/non_final_attribute/non_final_attribute.py (1 hunks)
  • aibolit/patterns/non_final_class/non_final_class.py (1 hunks)
  • aibolit/patterns/null_check/null_check.py (1 hunks)
  • aibolit/patterns/partially_synchronized_methods/partially_synchronized_methods.py (1 hunks)
  • aibolit/patterns/private_static_method/private_static_method.py (1 hunks)
  • aibolit/patterns/protected_method/protected_method.py (1 hunks)
  • aibolit/patterns/public_static_method/public_static_method.py (1 hunks)
  • aibolit/patterns/redundant_catch/redundant_catch.py (1 hunks)
  • aibolit/patterns/return_null/return_null.py (1 hunks)
  • aibolit/patterns/send_null/send_null.py (1 hunks)
  • aibolit/patterns/string_concat/string_concat.py (1 hunks)
  • aibolit/patterns/supermethod/supermethod.py (1 hunks)
  • aibolit/patterns/var_decl_diff/var_decl_diff.py (1 hunks)
  • aibolit/patterns/var_middle/var_middle.py (3 hunks)
  • aibolit/patterns/var_siblings/var_siblings.py (2 hunks)
  • aibolit/utils/java_parser.py (1 hunks)
  • aibolit/utils/scope_status.py (1 hunks)
  • scripts/04-find-patterns.py (2 hunks)
  • test/ast_framework/test_ast.py (3 hunks)
  • test/ast_framework/test_ast_node.py (1 hunks)
  • test/ast_framework/test_java_class_decomposition.py (6 hunks)
  • test/ast_framework/test_scope.py (2 hunks)
  • test/metrics/cc/test_all_types.py (0 hunks)
  • test/metrics/hv/test_all_types.py (0 hunks)
💤 Files with no reviewable changes (2)
  • test/metrics/cc/test_all_types.py
  • test/metrics/hv/test_all_types.py
✅ Files skipped from review due to trivial changes (3)
  • test/ast_framework/test_ast_node.py
  • aibolit/patterns/string_concat/string_concat.py
  • aibolit/patterns/protected_method/protected_method.py
🚧 Files skipped from review as they are similar to previous changes (60)
  • aibolit/metrics/local_methods_calls/local_methods_calls.py
  • aibolit/patterns/non_final_argument/non_final_argument.py
  • aibolit/patterns/var_decl_diff/var_decl_diff.py
  • aibolit/patterns/method_chaining/method_chaining.py
  • aibolit/patterns/er_class/er_class.py
  • .flake8
  • aibolit/patterns/instanceof/instance_of.py
  • aibolit/patterns/joined_validation/joined_validation.py
  • aibolit/patterns/array_as_argument/array_as_argument.py
  • aibolit/ast_framework/ast_node.py
  • aibolit/patterns/method_siblings/method_siblings.py
  • aibolit/patterns/return_null/return_null.py
  • aibolit/patterns/implements_multi/implements_multi.py
  • aibolit/patterns/partially_synchronized_methods/partially_synchronized_methods.py
  • aibolit/patterns/classic_setter/classic_setter.py
  • aibolit/patterns/non_final_class/non_final_class.py
  • aibolit/patterns/null_check/null_check.py
  • aibolit/patterns/var_siblings/var_siblings.py
  • aibolit/metrics/ncss/ncss.py
  • aibolit/patterns/classic_getter/classic_getter.py
  • aibolit/metrics/cc/main.py
  • aibolit/patterns/hybrid_constructor/hybrid_constructor.py
  • aibolit/metrics/cognitiveC/cognitive_c.py
  • aibolit/patterns/multiple_while/multiple_while.py
  • aibolit/patterns/nested_blocks/nested_blocks.py
  • scripts/04-find-patterns.py
  • aibolit/patterns/assign_null_finder/assign_null_finder.py
  • aibolit/patterns/redundant_catch/redundant_catch.py
  • aibolit/patterns/send_null/send_null.py
  • aibolit/metrics/external_methods_called/external_methods_called.py
  • aibolit/patterns/private_static_method/private_static_method.py
  • aibolit/main.py
  • aibolit/metrics/NumberMethods/NumberMethods.py
  • aibolit/patterns/public_static_method/public_static_method.py
  • aibolit/ast_framework/computed_fields_registry.py
  • aibolit/patterns/incomplete_for/incomplete_for.py
  • aibolit/patterns/many_primary_ctors/many_primary_ctors.py
  • aibolit/patterns/empty_rethrow/empty_rethrow.py
  • aibolit/ast_framework/scope.py
  • aibolit/patterns/if_return_if_detection/if_detection.py
  • aibolit/patterns/loop_outsider/loop_outsider.py
  • aibolit/ast_framework/java_class_decomposition.py
  • aibolit/metrics/fanout/FanOut.py
  • aibolit/metrics/RFC/rfc.py
  • aibolit/metrics/npath/main.py
  • test/ast_framework/test_scope.py
  • aibolit/utils/scope_status.py
  • test/ast_framework/test_ast.py
  • test/ast_framework/test_java_class_decomposition.py
  • aibolit/patterns/multiple_try/multiple_try.py
  • aibolit/patterns/non_final_attribute/non_final_attribute.py
  • aibolit/metrics/max_diameter/max_diameter.py
  • aibolit/utils/java_parser.py
  • aibolit/patterns/mutable_index/mutable_index.py
  • aibolit/patterns/supermethod/supermethod.py
  • aibolit/ast_framework/scope_extractors.py
  • aibolit/patterns/force_type_casting_finder/force_type_casting_finder.py
  • aibolit/patterns/var_middle/var_middle.py
  • aibolit/patterns/assert_in_code/assert_in_code.py
  • aibolit/ast_framework/ast.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: make
  • GitHub Check: latexmk
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
test/metrics/cc/test_all_types.py (1)

8-33: Consider if this refactoring belongs in this PR

This test refactoring consolidates the test logic into a single method, which is a valid improvement. However, it appears unrelated to the main PR objective of removing get_ prefixes from method names. Consider whether this change should be in a separate PR for better change tracking.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0df296 and d2b791f.

📒 Files selected for processing (64)
  • .flake8 (1 hunks)
  • aibolit/__main__.py (1 hunks)
  • aibolit/ast_framework/ast.py (7 hunks)
  • aibolit/ast_framework/ast_node.py (2 hunks)
  • aibolit/ast_framework/computed_fields_registry.py (1 hunks)
  • aibolit/ast_framework/java_class_decomposition.py (6 hunks)
  • aibolit/ast_framework/scope.py (1 hunks)
  • aibolit/ast_framework/scope_extractors.py (10 hunks)
  • aibolit/metrics/NumberMethods/NumberMethods.py (1 hunks)
  • aibolit/metrics/RFC/rfc.py (2 hunks)
  • aibolit/metrics/cognitiveC/cognitive_c.py (7 hunks)
  • aibolit/metrics/external_methods_called/external_methods_called.py (1 hunks)
  • aibolit/metrics/fanout/FanOut.py (1 hunks)
  • aibolit/metrics/local_methods_calls/local_methods_calls.py (1 hunks)
  • aibolit/metrics/max_diameter/max_diameter.py (1 hunks)
  • aibolit/metrics/ncss/ncss.py (1 hunks)
  • aibolit/metrics/npath/main.py (1 hunks)
  • aibolit/patterns/array_as_argument/array_as_argument.py (1 hunks)
  • aibolit/patterns/assert_in_code/assert_in_code.py (1 hunks)
  • aibolit/patterns/assign_null_finder/assign_null_finder.py (1 hunks)
  • aibolit/patterns/classic_getter/classic_getter.py (1 hunks)
  • aibolit/patterns/classic_setter/classic_setter.py (1 hunks)
  • aibolit/patterns/empty_rethrow/empty_rethrow.py (2 hunks)
  • aibolit/patterns/er_class/er_class.py (1 hunks)
  • aibolit/patterns/force_type_casting_finder/force_type_casting_finder.py (1 hunks)
  • aibolit/patterns/hybrid_constructor/hybrid_constructor.py (1 hunks)
  • aibolit/patterns/if_return_if_detection/if_detection.py (1 hunks)
  • aibolit/patterns/implements_multi/implements_multi.py (1 hunks)
  • aibolit/patterns/incomplete_for/incomplete_for.py (1 hunks)
  • aibolit/patterns/instanceof/instance_of.py (1 hunks)
  • aibolit/patterns/joined_validation/joined_validation.py (1 hunks)
  • aibolit/patterns/loop_outsider/loop_outsider.py (2 hunks)
  • aibolit/patterns/many_primary_ctors/many_primary_ctors.py (2 hunks)
  • aibolit/patterns/method_chaining/method_chaining.py (1 hunks)
  • aibolit/patterns/method_siblings/method_siblings.py (1 hunks)
  • aibolit/patterns/multiple_try/multiple_try.py (1 hunks)
  • aibolit/patterns/multiple_while/multiple_while.py (1 hunks)
  • aibolit/patterns/mutable_index/mutable_index.py (1 hunks)
  • aibolit/patterns/nested_blocks/nested_blocks.py (1 hunks)
  • aibolit/patterns/non_final_argument/non_final_argument.py (1 hunks)
  • aibolit/patterns/non_final_attribute/non_final_attribute.py (1 hunks)
  • aibolit/patterns/non_final_class/non_final_class.py (1 hunks)
  • aibolit/patterns/null_check/null_check.py (1 hunks)
  • aibolit/patterns/partially_synchronized_methods/partially_synchronized_methods.py (1 hunks)
  • aibolit/patterns/private_static_method/private_static_method.py (1 hunks)
  • aibolit/patterns/protected_method/protected_method.py (1 hunks)
  • aibolit/patterns/public_static_method/public_static_method.py (1 hunks)
  • aibolit/patterns/redundant_catch/redundant_catch.py (1 hunks)
  • aibolit/patterns/return_null/return_null.py (1 hunks)
  • aibolit/patterns/send_null/send_null.py (1 hunks)
  • aibolit/patterns/string_concat/string_concat.py (1 hunks)
  • aibolit/patterns/supermethod/supermethod.py (1 hunks)
  • aibolit/patterns/var_decl_diff/var_decl_diff.py (1 hunks)
  • aibolit/patterns/var_middle/var_middle.py (3 hunks)
  • aibolit/patterns/var_siblings/var_siblings.py (2 hunks)
  • aibolit/utils/java_parser.py (1 hunks)
  • aibolit/utils/scope_status.py (1 hunks)
  • scripts/04-find-patterns.py (2 hunks)
  • test/ast_framework/test_ast.py (3 hunks)
  • test/ast_framework/test_ast_node.py (1 hunks)
  • test/ast_framework/test_java_class_decomposition.py (6 hunks)
  • test/ast_framework/test_scope.py (2 hunks)
  • test/metrics/cc/test_all_types.py (1 hunks)
  • test/metrics/hv/test_all_types.py (0 hunks)
💤 Files with no reviewable changes (1)
  • test/metrics/hv/test_all_types.py
🧰 Additional context used
🧠 Learnings (19)
aibolit/patterns/instanceof/instance_of.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/array_as_argument/array_as_argument.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/assign_null_finder/assign_null_finder.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/joined_validation/joined_validation.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/ast_framework/ast_node.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/non_final_argument/non_final_argument.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/return_null/return_null.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/loop_outsider/loop_outsider.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/mutable_index/mutable_index.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/string_concat/string_concat.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/send_null/send_null.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/ast_framework/scope_extractors.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/var_middle/var_middle.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/force_type_casting_finder/force_type_casting_finder.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/assert_in_code/assert_in_code.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/__main__.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/many_primary_ctors/many_primary_ctors.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/var_siblings/var_siblings.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
aibolit/patterns/empty_rethrow/empty_rethrow.py (1)
Learnt from: SinbadTheSailor2005
PR: cqfn/aibolit#816
File: aibolit/patterns/loop_outsider/loop_outsider.py:0-0
Timestamp: 2025-06-08T11:50:22.673Z
Learning: In the aibolit codebase, ASTNodeType.ASSIGNMENT nodes have an attribute called `expressionl` (with 'l' suffix), not `expression`. This is confirmed in `aibolit/ast_framework/_auxiliary_data.py` and used consistently throughout existing patterns like mutable_index and many_primary_ctors.
🧬 Code Graph Analysis (43)
test/ast_framework/test_ast_node.py (1)
aibolit/ast_framework/ast.py (1)
  • root (65-66)
aibolit/patterns/instanceof/instance_of.py (3)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/ast_framework/ast_node.py (1)
  • line (41-69)
aibolit/ast_framework/scope.py (1)
aibolit/ast_framework/ast.py (1)
  • root (65-66)
aibolit/patterns/assign_null_finder/assign_null_finder.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/method_chaining/method_chaining.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/joined_validation/joined_validation.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/metrics/local_methods_calls/local_methods_calls.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/ast_framework/ast_node.py (1)
aibolit/ast_framework/computed_fields_registry.py (1)
  • fields (36-39)
aibolit/patterns/classic_getter/classic_getter.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/non_final_argument/non_final_argument.py (1)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/patterns/var_decl_diff/var_decl_diff.py (2)
aibolit/ast_framework/ast.py (1)
  • subtrees (72-93)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/return_null/return_null.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/nested_blocks/nested_blocks.py (1)
aibolit/ast_framework/ast.py (2)
  • subtrees (72-93)
  • root (65-66)
aibolit/patterns/implements_multi/implements_multi.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/protected_method/protected_method.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/redundant_catch/redundant_catch.py (2)
aibolit/ast_framework/ast.py (3)
  • subtree (95-98)
  • proxy_nodes (176-179)
  • AST (31-388)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/metrics/external_methods_called/external_methods_called.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/multiple_while/multiple_while.py (3)
aibolit/ast_framework/ast.py (2)
  • subtrees (72-93)
  • root (65-66)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/ast_framework/ast_node.py (1)
  • line (41-69)
aibolit/metrics/RFC/rfc.py (2)
aibolit/ast_framework/ast.py (5)
  • proxy_nodes (176-179)
  • subtree (95-98)
  • AST (31-388)
  • root (65-66)
  • subtrees (72-93)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/string_concat/string_concat.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/if_return_if_detection/if_detection.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
scripts/04-find-patterns.py (1)
aibolit/ast_framework/ast.py (2)
  • subtree (95-98)
  • root (65-66)
aibolit/patterns/null_check/null_check.py (2)
aibolit/ast_framework/ast.py (2)
  • proxy_nodes (176-179)
  • subtree (95-98)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/metrics/ncss/ncss.py (1)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/patterns/private_static_method/private_static_method.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/hybrid_constructor/hybrid_constructor.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/partially_synchronized_methods/partially_synchronized_methods.py (2)
aibolit/ast_framework/ast.py (3)
  • subtrees (72-93)
  • root (65-66)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/metrics/NumberMethods/NumberMethods.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/non_final_attribute/non_final_attribute.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/var_middle/var_middle.py (1)
aibolit/utils/scope_status.py (2)
  • ScopeStatusFlags (9-13)
  • status (26-30)
aibolit/patterns/public_static_method/public_static_method.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/supermethod/supermethod.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/assert_in_code/assert_in_code.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
test/ast_framework/test_java_class_decomposition.py (2)
aibolit/ast_framework/ast.py (3)
  • root (65-66)
  • subtree (95-98)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/__main__.py (1)
aibolit/ast_framework/ast.py (2)
  • subtree (95-98)
  • root (65-66)
aibolit/patterns/var_siblings/var_siblings.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/ast_framework/java_class_decomposition.py (4)
aibolit/ast_framework/ast.py (4)
  • root (65-66)
  • subtree (95-98)
  • proxy_nodes (176-179)
  • AST (31-388)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/ast_framework/scope.py (1)
  • parameters (55-56)
aibolit/ast_framework/ast_node.py (1)
  • node_index (37-38)
aibolit/metrics/npath/main.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/classic_setter/classic_setter.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/empty_rethrow/empty_rethrow.py (2)
aibolit/ast_framework/ast.py (2)
  • subtree (95-98)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/patterns/incomplete_for/incomplete_for.py (2)
aibolit/ast_framework/ast.py (1)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
aibolit/metrics/fanout/FanOut.py (2)
aibolit/ast_framework/ast.py (4)
  • subtrees (72-93)
  • AST (31-388)
  • root (65-66)
  • proxy_nodes (176-179)
aibolit/ast_framework/ast_node_type.py (1)
  • ASTNodeType (7-90)
test/ast_framework/test_scope.py (1)
aibolit/ast_framework/ast.py (2)
  • root (65-66)
  • subtree (95-98)
🪛 GitHub Actions: pylint
aibolit/patterns/var_middle/var_middle.py

[warning] 22-22: Pylint W0212: Access to protected members _tree and _root of a client class (protected-access)


[warning] 24-24: Pylint W0212: Access to a protected member _tree of a client class (protected-access)


[warning] 26-26: Pylint W0212: Access to a protected member _tree of a client class (protected-access)

aibolit/ast_framework/java_class_decomposition.py

[warning] 195-195: Pylint W0212: Access to a protected member _tree of a client class (protected-access)

aibolit/metrics/cognitiveC/cognitive_c.py

[warning] 32-32: Pylint W0212: Access to a protected member _tree of a client class (protected-access)


[warning] 39-39: Pylint W0212: Access to a protected member _tree of a client class (protected-access)


[warning] 46-46: Pylint W0212: Access to a protected member _tree of a client class (protected-access)


[warning] 65-65: Pylint W0212: Access to a protected member _tree of a client class (protected-access)


[warning] 84-84: Pylint W0212: Access to a protected member _tree of a client class (protected-access)


[warning] 95-95: Pylint W0212: Access to a protected member _tree of a client class (protected-access)


[warning] 118-118: Pylint W0212: Access to a protected member _tree of a client class (protected-access)


[warning] 143-143: Pylint W0212: Access to a protected member _tree of a client class (protected-access)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: e2e-test
  • GitHub Check: latexmk
  • GitHub Check: make
🔇 Additional comments (97)
test/ast_framework/test_ast_node.py (1)

18-18: LGTM: Correct API update

The method call has been properly updated from get_root() to root() to align with the new AST interface that removes the get_ prefix.

aibolit/ast_framework/scope.py (1)

21-21: LGTM: Consistent API refactoring

The method call has been correctly updated from get_root() to root() to align with the new AST interface naming conventions.

aibolit/patterns/non_final_class/non_final_class.py (1)

16-16: LGTM: Proper method name update

The method call has been correctly updated from get_proxy_nodes() to proxy_nodes() to align with the new AST interface that removes getter-style naming.

aibolit/patterns/instanceof/instance_of.py (1)

16-16: LGTM: Consistent API updates

Both method calls have been correctly updated from get_proxy_nodes() to proxy_nodes() to align with the new AST interface naming conventions. The functionality remains identical.

Also applies to: 20-20

aibolit/patterns/non_final_argument/non_final_argument.py (1)

26-26: LGTM: Correct method name refactoring

The method call has been properly updated from get_proxy_nodes() to proxy_nodes() to align with the new AST interface that removes getter-style naming conventions.

aibolit/patterns/method_chaining/method_chaining.py (1)

16-18: LGTM: Clean method rename aligns with EO007 refactoring.

The change from get_proxy_nodes to proxy_nodes maintains identical functionality while removing the unnecessary get_ prefix, which aligns with the EO007 check objective.

aibolit/patterns/var_decl_diff/var_decl_diff.py (1)

79-79: LGTM: Clean method rename aligns with EO007 refactoring.

The change from get_subtrees to subtrees maintains identical functionality while removing the unnecessary get_ prefix, which aligns with the EO007 check objective.

aibolit/patterns/implements_multi/implements_multi.py (1)

12-12: LGTM: Clean method rename aligns with EO007 refactoring.

The change from get_proxy_nodes to proxy_nodes maintains identical functionality while removing the unnecessary get_ prefix, which aligns with the EO007 check objective.

aibolit/patterns/assign_null_finder/assign_null_finder.py (1)

14-14: LGTM: Clean method renames align with EO007 refactoring.

The changes from get_proxy_nodes to proxy_nodes maintain identical functionality while removing the unnecessary get_ prefix, which aligns with the EO007 check objective.

Also applies to: 17-17

aibolit/patterns/public_static_method/public_static_method.py (1)

20-20: LGTM: Clean method rename aligns with EO007 refactoring.

The change from get_proxy_nodes to proxy_nodes maintains identical functionality while removing the unnecessary get_ prefix, which aligns with the EO007 check objective.

aibolit/patterns/nested_blocks/nested_blocks.py (1)

22-23: LGTM! Method calls updated to new API.

The method calls have been correctly updated to use the new non-getter naming convention (subtrees() and root() instead of get_subtrees() and get_root()). This aligns with the AST framework refactoring and maintains the same functionality.

aibolit/utils/scope_status.py (1)

26-26: LGTM! Method renamed to follow new naming convention.

The method has been correctly renamed from get_status() to status() to remove the getter-style prefix. The implementation remains unchanged and the functionality is preserved.

aibolit/patterns/joined_validation/joined_validation.py (1)

17-17: LGTM! Method call updated to new API.

The method call has been correctly updated to use proxy_nodes() instead of get_proxy_nodes(). This aligns with the AST framework refactoring and maintains the same functionality for iterating over IF_STATEMENT nodes.

aibolit/patterns/method_siblings/method_siblings.py (1)

21-21: LGTM! Method call updated to new API.

The method call has been correctly updated to use proxy_nodes() instead of get_proxy_nodes(). This aligns with the AST framework refactoring and maintains the same functionality for iterating over METHOD_DECLARATION nodes.

aibolit/metrics/local_methods_calls/local_methods_calls.py (1)

41-41: LGTM! Method calls updated to new API.

Both method calls have been correctly updated to use proxy_nodes() instead of get_proxy_nodes(). This aligns with the AST framework refactoring and maintains the same functionality for iterating over METHOD_INVOCATION and METHOD_DECLARATION nodes respectively.

Also applies to: 47-47

aibolit/patterns/er_class/er_class.py (1)

30-30: LGTM! Getter method refactoring correctly applied.

The change from get_proxy_nodes to proxy_nodes successfully removes the getter-style method prefix, aligning with the EO007 check requirements. The functionality remains identical while improving code consistency.

aibolit/patterns/array_as_argument/array_as_argument.py (1)

16-17: LGTM! Systematic refactoring applied correctly.

The method name change from get_proxy_nodes to proxy_nodes successfully eliminates the getter-style prefix while maintaining the same functionality for multiple node types. This change aligns with the EO007 compliance objective.

aibolit/metrics/external_methods_called/external_methods_called.py (1)

38-38: LGTM! Getter method refactoring correctly implemented.

The change from get_proxy_nodes to proxy_nodes successfully removes the getter-style method prefix while preserving the exact same functionality. This aligns with the EO007 check requirements.

aibolit/patterns/var_siblings/var_siblings.py (2)

18-18: LGTM! Getter method refactoring correctly applied.

The change from get_proxy_nodes to proxy_nodes successfully removes the getter-style method prefix while maintaining identical functionality for local variable declaration nodes.


46-46: LGTM! Consistent refactoring applied.

The method name change from get_proxy_nodes to proxy_nodes correctly implements the systematic refactoring to eliminate getter-style method names, aligning with the EO007 compliance objective.

aibolit/metrics/NumberMethods/NumberMethods.py (1)

10-10: LGTM! Systematic refactoring completed correctly.

The change from get_proxy_nodes to proxy_nodes successfully eliminates the getter-style method prefix while preserving the exact same functionality. This change completes the consistent refactoring pattern across all reviewed files, aligning with the EO007 compliance objective.

aibolit/patterns/return_null/return_null.py (1)

17-17: Method name update looks correct.

The change from get_proxy_nodes to proxy_nodes aligns with the PR objective of removing getter-style method names and is consistent with the updated AST API.

aibolit/patterns/multiple_while/multiple_while.py (1)

16-19: Method name updates are correct and consistent.

The changes from get_subtrees to subtrees and get_root() to root() properly align with the updated AST API and maintain the same functionality.

aibolit/patterns/loop_outsider/loop_outsider.py (6)

30-31: Method name updates are correct.

The changes from get_proxy_nodes to proxy_nodes and get_subtree to subtree are consistent with the updated AST API.


50-50: Method name update is correct.

The change from get_proxy_nodes to proxy_nodes aligns with the updated AST API.


55-56: Method name update is correct.

The change from get_proxy_nodes to proxy_nodes is consistent with the updated AST API. The use of expressionl attribute is correct based on the codebase conventions.


63-63: Method name update is correct.

The change from get_subtree to subtree aligns with the updated AST API.


66-67: Method name update is correct.

The change from get_proxy_nodes to proxy_nodes is consistent with the updated AST API.


72-73: Method name update is correct.

The change from get_proxy_nodes to proxy_nodes aligns with the updated AST API.

aibolit/ast_framework/computed_fields_registry.py (1)

36-39: Method name update is correct.

The change from get_fields to fields is consistent with the PR objective of removing getter-style method names. The method signature and functionality remain unchanged.

aibolit/metrics/max_diameter/max_diameter.py (2)

17-17: Method name update is correct.

The change from get_subtrees to subtrees aligns with the updated AST API and maintains the same functionality.


23-23: Method name update is correct.

The change from get_root() to root() is consistent with the updated AST API.

aibolit/metrics/npath/main.py (1)

96-96: LGTM: Method name updated correctly

The method call has been properly updated from get_proxy_nodes to proxy_nodes, aligning with the broader refactoring effort to remove the get_ prefix from AST methods.

aibolit/patterns/mutable_index/mutable_index.py (5)

24-24: LGTM: Method name updated correctly

The method call has been properly updated from get_proxy_nodes to proxy_nodes.


26-26: LGTM: Method name updated correctly

The method call has been properly updated from get_subtree to subtree.


33-36: LGTM: Method names updated consistently

All method calls have been properly updated to use the new naming convention:

  • get_subtreesubtree
  • get_proxy_nodesproxy_nodes

42-42: LGTM: Method name updated correctly

The method call has been properly updated from get_proxy_nodes to proxy_nodes.


50-50: LGTM: Method name updated correctly

The method call has been properly updated from get_proxy_nodes to proxy_nodes.

scripts/04-find-patterns.py (2)

60-61: LGTM: Method names updated correctly

Both method calls have been properly updated to use the new naming convention:

  • get_subtreesubtree
  • get_rootroot

74-74: LGTM: Method name updated correctly

The method call has been properly updated from get_root to root.

aibolit/patterns/private_static_method/private_static_method.py (1)

14-14: LGTM: Method name updated correctly

The method call has been properly updated from get_proxy_nodes to proxy_nodes, maintaining the same functionality while following the new naming convention.

aibolit/patterns/protected_method/protected_method.py (1)

14-14: LGTM: Method name updated correctly

The method call has been properly updated from get_proxy_nodes to proxy_nodes, maintaining the same functionality while following the new naming convention.

aibolit/ast_framework/ast_node.py (1)

74-74: LGTM! Method name refactoring is consistent.

The changes correctly update calls from get_fields to fields in the computed fields registry, aligning with the broader refactoring to remove get_ prefixes from method names.

Also applies to: 103-103

test/ast_framework/test_java_class_decomposition.py (1)

36-36: LGTM! Test updates align with AST API refactoring.

All method calls have been correctly updated to use the new method names without the get_ prefix:

  • get_root()root()
  • get_subtree()subtree()
  • get_proxy_nodes()proxy_nodes()

The changes maintain the same logic and test coverage while conforming to the new API.

Also applies to: 43-43, 54-55, 64-64, 347-348, 368-368, 377-377

aibolit/patterns/classic_setter/classic_setter.py (1)

35-35: LGTM! Method call updated correctly.

The change from get_proxy_nodes to proxy_nodes aligns with the AST API refactoring to remove get_ prefixes from method names.

aibolit/patterns/classic_getter/classic_getter.py (1)

38-38: LGTM! Method call updated correctly.

The change from get_proxy_nodes to proxy_nodes aligns with the AST API refactoring to remove get_ prefixes from method names.

aibolit/patterns/string_concat/string_concat.py (1)

24-24: LGTM! Method call updated correctly.

The change from get_proxy_nodes to proxy_nodes aligns with the AST API refactoring to remove get_ prefixes from method names.

aibolit/patterns/send_null/send_null.py (2)

30-30: Method name refactoring correctly applied.

The change from get_proxy_nodes to proxy_nodes aligns with the EO007 check requirements and maintains the same functionality.


35-35: Consistent method name update.

The second occurrence of get_proxy_nodes to proxy_nodes is properly updated, maintaining consistency throughout the file.

aibolit/metrics/RFC/rfc.py (4)

26-27: Method name refactoring correctly applied.

The changes from get_proxy_nodes to proxy_nodes and get_subtree to subtree are consistent with the EO007 check requirements and maintain the same functionality for RFC calculation.


32-32: Consistent root method update.

The change from get_root to root is properly applied, maintaining consistency with the new AST interface.


38-39: Subtrees method refactoring correctly applied.

The changes from get_subtrees to subtrees and get_root to root are consistent with the refactoring pattern and preserve the RFC calculation logic.


60-60: Final method name update is correct.

The change from get_proxy_nodes to proxy_nodes in the method invocation parameter extraction is properly applied.

aibolit/patterns/supermethod/supermethod.py (1)

12-12: Method name refactoring correctly applied.

The change from get_proxy_nodes to proxy_nodes is consistent with the EO007 check requirements and maintains the same functionality for detecting super method invocations.

aibolit/patterns/force_type_casting_finder/force_type_casting_finder.py (1)

11-11: Method name refactoring correctly applied.

The change from get_proxy_nodes to proxy_nodes is consistent with the EO007 check requirements and maintains the same functionality for detecting force type casting.

aibolit/metrics/ncss/ncss.py (1)

19-19: Method name refactoring correctly applied.

The change from get_proxy_nodes to proxy_nodes is consistent with the EO007 check requirements and maintains the same functionality for NCSS metric calculation.

aibolit/patterns/redundant_catch/redundant_catch.py (1)

27-27: LGTM: Consistent method name refactoring

The changes correctly update all AST framework method calls to use the new API without the get_ prefix. This aligns with the PR objective of enabling EO007 check to avoid getters and setters pattern.

Also applies to: 33-34, 36-36, 43-43

aibolit/patterns/non_final_attribute/non_final_attribute.py (1)

14-14: LGTM: Consistent method name refactoring

The change correctly updates the AST framework method call to use the new API without the get_ prefix, consistent with the broader refactoring.

aibolit/patterns/assert_in_code/assert_in_code.py (1)

16-16: LGTM: Consistent method name refactoring

The change correctly updates the AST framework method call to remove the get_ prefix, aligning with the PR's objective of avoiding getters and setters pattern.

aibolit/patterns/null_check/null_check.py (1)

17-18: LGTM: Consistent method name refactoring

The changes correctly update AST framework method calls to use the new API without the get_ prefix. Both proxy_nodes and subtree method calls are properly updated.

aibolit/patterns/if_return_if_detection/if_detection.py (1)

16-16: LGTM: Consistent method name refactoring

The change correctly updates the AST framework method call to remove the get_ prefix, maintaining consistency with the broader refactoring effort.

aibolit/patterns/hybrid_constructor/hybrid_constructor.py (1)

81-81: LGTM: Method name updated correctly

The change from get_proxy_nodes to proxy_nodes aligns with the PR objective to remove getter/setter patterns and enable EO007 check.

aibolit/patterns/incomplete_for/incomplete_for.py (1)

17-17: LGTM: Consistent API modernization

The method name change from get_proxy_nodes to proxy_nodes is consistent with the codebase-wide refactoring to remove getter prefixes.

aibolit/patterns/var_middle/var_middle.py (4)

22-22: Note: Protected member access warnings

The change to access _tree and _root private attributes is consistent with the refactoring, but triggers pylint warnings about protected member access. This is expected as part of the API modernization.


24-26: LGTM: Consistent attribute access updates

The updates to use ast._tree instead of ast.tree are consistent with the privatization of internal attributes across the codebase.


38-38: LGTM: Method name modernization

The change from scope_status.get_status() to scope_status.status() follows the same pattern of removing getter prefixes, consistent with the PR objectives.


55-55: LGTM: Consistent method name update

The second instance of status() method usage is correctly updated to match the new API.

aibolit/patterns/partially_synchronized_methods/partially_synchronized_methods.py (3)

18-20: LGTM: Method name updated correctly

The change from get_subtrees to subtrees is consistent with the codebase-wide refactoring to remove getter prefixes.


21-21: LGTM: Root accessor method updated

The change from get_root() to root() follows the same modernization pattern.


26-26: LGTM: Proxy nodes method updated

The change from get_proxy_nodes to proxy_nodes completes the consistent refactoring across all AST method calls in this file.

aibolit/patterns/empty_rethrow/empty_rethrow.py (2)

16-17: LGTM: Method chain updated correctly

The change from get_subtree(catch_clause).get_proxy_nodes(...) to subtree(catch_clause).proxy_nodes(...) correctly updates both methods in the chain to remove getter prefixes.


26-26: LGTM: Consistent method name update

The change from get_proxy_nodes to proxy_nodes is consistent with the codebase-wide refactoring pattern.

test/ast_framework/test_scope.py (1)

90-90: LGTM: Correct API refactoring

The method calls have been properly updated to use the new AST API without the get_ prefix. The functionality remains identical.

Also applies to: 99-99

aibolit/__main__.py (1)

275-276: LGTM: Consistent API refactoring

The method calls have been correctly updated to use the new AST API methods subtree() and root() without altering the underlying logic.

aibolit/ast_framework/java_class_decomposition.py (1)

25-26: LGTM: Correct API refactoring

The method calls have been properly updated to use the new AST API without the get_ prefix. All changes maintain the same functionality while following the new naming conventions.

Also applies to: 111-111, 130-130, 150-150, 159-164, 169-169, 182-182, 187-187, 192-192

aibolit/ast_framework/scope_extractors.py (1)

28-28: LGTM: Comprehensive API refactoring

All method calls have been correctly updated to use the new AST API methods. The scope extraction logic remains intact while following the new naming conventions consistently across all extractor functions.

Also applies to: 47-47, 54-54, 68-68, 81-81, 106-106, 123-123, 145-145, 160-160, 183-183, 202-203

aibolit/patterns/many_primary_ctors/many_primary_ctors.py (1)

17-17: LGTM: Correct API method updates

The method calls have been properly updated to use the new AST API methods proxy_nodes() and subtree(). The pattern detection logic for primary constructors remains unchanged.

Also applies to: 32-32

aibolit/metrics/fanout/FanOut.py (3)

16-16: LGTM: Method name updated to remove get_ prefix

The change from get_subtrees to subtrees is consistent with the refactoring to avoid getter/setter naming conventions.


22-22: LGTM: Method name updated to remove get_ prefix

The change from get_root() to root() is consistent with the refactoring to avoid getter/setter naming conventions.


27-27: LGTM: Method name updated to remove get_ prefix

The change from get_proxy_nodes to proxy_nodes is consistent with the refactoring to avoid getter/setter naming conventions.

test/ast_framework/test_ast.py (6)

22-22: LGTM: Method name updated to remove get_ prefix

The change from get_subtrees to subtrees is consistent with the refactoring.


31-31: LGTM: Method name updated to remove get_ prefix

The change from get_root() to root() is consistent with the refactoring.


43-43: LGTM: Method name updated to remove get_ prefix

The change from get_nodes to nodes is consistent with the refactoring.


45-45: LGTM: Method name updated to remove get_ prefix

The change from get_member_reference_params to member_reference_params is consistent with the refactoring.


50-50: LGTM: Method name updated to remove get_ prefix

The change from get_nodes to nodes is consistent with the refactoring.


52-52: LGTM: Method name updated to remove get_ prefix

The change from get_method_invocation_params to method_invocation_params is consistent with the refactoring.

aibolit/utils/java_parser.py (3)

140-140: LGTM: Method name updated to remove get_ prefix

The change from get_empty_lines to empty_lines is consistent with the refactoring.


142-142: LGTM: Internal method call updated correctly

The internal call was correctly updated from get_non_empty_lines to non_empty_lines.


146-146: LGTM: Method name updated to remove get_ prefix

The change from get_non_empty_lines to non_empty_lines is consistent with the refactoring.

aibolit/metrics/cognitiveC/cognitive_c.py (1)

158-159: LGTM: Method names updated to remove get_ prefix

The changes from get_subtrees to subtrees and get_root() to root() are consistent with the refactoring.

aibolit/patterns/multiple_try/multiple_try.py (1)

14-16: LGTM! API usage updated correctly.

The method calls have been correctly updated to use the new AST API without the get_ prefix. The logic remains unchanged and functional.

aibolit/ast_framework/ast.py (6)

33-34: Good encapsulation improvement.

Making the tree and root attributes private with the underscore prefix improves encapsulation and follows Python conventions for internal attributes.


65-66: API method renaming executed correctly.

The get_root() method has been correctly renamed to root() and properly uses the private _root attribute.


72-72: Method name updated consistently.

The get_subtrees() method has been correctly renamed to subtrees() following the pattern of removing the get_ prefix.


95-95: Method name updated consistently.

The get_subtree() method has been correctly renamed to subtree() following the pattern of removing the get_ prefix.


176-176: Method name updated consistently.

The get_proxy_nodes() method has been correctly renamed to proxy_nodes() following the pattern of removing the get_ prefix.


48-179: No remaining deprecated AST API usages detected

All legacy calls to get_root(), get_subtree(), get_subtrees(), and get_proxy_nodes() have been removed, and there are no direct accesses to .tree or .root in your codebase. The public-API changes are applied consistently.

Comment thread .flake8
@@ -1,4 +1,4 @@
[flake8]
ignore = W504,EO001,EO002,EO003,EO004,EO005,EO007,EO008,EO009,EO01,EO02
ignore = W504,EO001,EO002,EO003,EO004,EO005,EO008,EO009,EO01,EO02

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Clean-up the ignore list – stray/typo codes EO01, EO02 remain

While EO007 has been correctly dropped, the list still contains EO01 and EO02, which do not match the 3-digit pattern used by the rest of the elegant-objects plugin (EO0xx). They are likely typos or forgotten remnants (perhaps EO010, EO020, or duplicates of codes already present). Keeping unknown codes silently disables nothing and clutters the config.

Proposed fix:

-ignore = W504,EO001,EO002,EO003,EO004,EO005,EO008,EO009,EO01,EO02
+ignore = W504,EO001,EO002,EO003,EO004,EO005,EO008,EO009

After cleaning, run flake8 locally to ensure no unintended violations surface.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ignore = W504,EO001,EO002,EO003,EO004,EO005,EO008,EO009,EO01,EO02
# .flake8
ignore = W504,EO001,EO002,EO003,EO004,EO005,EO008,EO009
🤖 Prompt for AI Agents
In the .flake8 file at line 2, the ignore list contains invalid or typo error
codes EO01 and EO02 that do not match the expected 3-digit pattern for
elegant-objects plugin codes. Remove these stray codes from the ignore list to
clean up the configuration. After making this change, run flake8 locally to
verify that no new linting errors appear.

Comment thread aibolit/ast_framework/java_class_decomposition.py Outdated
Comment thread aibolit/metrics/cognitiveC/cognitive_c.py Outdated
@yegor256

yegor256 commented Jul 7, 2025

Copy link
Copy Markdown
Member

@ivanovmg what's your take on this?

@ivanovmg ivanovmg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AntonProkopyev I think it is a good idea to get rid of these getters and setters in AST!

I suppose that the changes in the cognitive complexity metric can probably be extracted into a separate PR dedicated to its refactoring, to make this particular PR more focused.

Anyway, it looks good to me.
@yegor256

Comment thread aibolit/ast_framework/ast.py
Comment thread aibolit/ast_framework/java_class_decomposition.py Outdated
Comment thread aibolit/metrics/cognitiveC/cognitive_c.py Outdated
Comment thread aibolit/metrics/cognitiveC/cognitive_c.py Outdated
Comment thread aibolit/metrics/cognitiveC/cognitive_c.py
@yegor256

yegor256 commented Jul 7, 2025

Copy link
Copy Markdown
Member

@AntonProkopyev I believe, all suggestions of @ivanovmg above do make sense. Please, take them into account and then we merge.

@AntonProkopyev

Copy link
Copy Markdown
Contributor Author

@ivanovmg Just rebased the PR. Could you please take a look?

@AntonProkopyev
AntonProkopyev requested a review from ivanovmg July 21, 2025 08:48

@ivanovmg ivanovmg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AntonProkopyev this is perfect! Yet another step towards the Zen of Elegant Objects :)

@yegor256, approved from my side.

@yegor256

Copy link
Copy Markdown
Member

@rultor merge

@rultor

rultor commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here.

@rultor
rultor merged commit 041e508 into cqfn:master Jul 21, 2025
19 checks passed
@rultor

rultor commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

@rultor merge

@yegor256 Done! FYI, the full log is here (took me 20min).

@0crat

0crat commented Jul 21, 2025

Copy link
Copy Markdown
Collaborator

@AntonProkopyev Thanks for your substantial contribution of 460 hits-of-code! You've earned +8 points: +16 base, +16 for code volume (capped), -16 for exceeding 200 HOC, and -8 for exceeding 800 HOC. While we appreciate the effort, remember that concise code is often more valuable. Keep the contributions coming! Your balance now stands at +134. 🚀

@AntonProkopyev
AntonProkopyev deleted the enable-eo007-850 branch July 23, 2025 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code violates Elegant Objects principle with usage of getters and setters

5 participants