Skip to content

refactor: migrate function_lines_of_code rule#296

Open
solid-illiaaihistov wants to merge 5 commits into
solid-software:analysis_server_migrationfrom
solid-illiaaihistov:251-migrate-function_lines_of_code
Open

refactor: migrate function_lines_of_code rule#296
solid-illiaaihistov wants to merge 5 commits into
solid-software:analysis_server_migrationfrom
solid-illiaaihistov:251-migrate-function_lines_of_code

Conversation

@solid-illiaaihistov

Copy link
Copy Markdown
Collaborator

Closes #251

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors the function_lines_of_code lint rule to use the updated analyzer APIs, introducing a dedicated FunctionLinesOfCodeRuleVisitor for AST traversal and adding comprehensive unit tests. The feedback suggests refactoring visitFunctionExpression in the new visitor to check the node before recursing, aligning its behavior with other visitor methods and improving readability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@solid-illiaaihistov solid-illiaaihistov changed the title refactor: migrate function_lines_of_code rule (#251) refactor: migrate function_lines_of_code rule Jun 18, 2026
@solid-illiaaihistov

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors the function_lines_of_code lint rule to use the updated analyzer APIs, introducing FunctionLinesOfCodeRuleVisitor for AST traversal and migrating the tests to a reflective test suite. Feedback on the changes suggests extracting _context.currentUnit into a local variable within _checkNode to eliminate redundant null-checks and improve code readability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@solid-illiaaihistov

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors the function_lines_of_code lint rule to utilize the new RuleVisitorRegistry and RuleContext APIs, extracting the AST traversal logic into a dedicated FunctionLinesOfCodeRuleVisitor class. It also introduces a comprehensive set of unit tests for the rule. Feedback is provided regarding the rule's description, where using _code.problemMessage directly can expose raw placeholder templates (like {0}) in IDEs and documentation; a static, user-friendly description is recommended instead.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread lib/src/lints/function_lines_of_code/function_lines_of_code_rule.dart Outdated
@solid-illiaaihistov

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors the function_lines_of_code lint rule to use the new analyzer API, migrating from custom lint builders to RuleContext and RuleVisitorRegistry. It introduces FunctionLinesOfCodeRuleVisitor to handle AST traversal, adds an empty() factory constructor to FunctionLinesOfCodeParameters, and includes a comprehensive suite of unit tests to verify the rule's behavior. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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.

1 participant