Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

- Added excludeNames param for function_lines_of_code lint#141

Merged
aderhachev merged 6 commits into
mastersolid-software/solid_lints:masterfrom
Andrii-Derhachev-function_lines_of_code_improvementsolid-software/solid_lints:Andrii-Derhachev-function_lines_of_code_improvementCopy head branch name to clipboard
Mar 15, 2024
Merged

- Added excludeNames param for function_lines_of_code lint#141
aderhachev merged 6 commits into
mastersolid-software/solid_lints:masterfrom
Andrii-Derhachev-function_lines_of_code_improvementsolid-software/solid_lints:Andrii-Derhachev-function_lines_of_code_improvementCopy head branch name to clipboard

Conversation

@aderhachev

Copy link
Copy Markdown
Contributor
  • Added excludeNames param for function_lines_of_code lint

@solid-vovabeloded solid-vovabeloded left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Added a few suggestions here, but looks good overall.

Comment on lines +63 to +73
final name = () {
if (node is FunctionDeclaration) {
return node.name.lexeme;
} else if (node is MethodDeclaration) {
return node.name.lexeme;
} else if (node is FunctionExpression) {
return node.declaredElement?.name;
} else {
return null;
}
}();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please, extract this into a separate private method or just inline it into current method. Do not use inline function declaration since it hurts readability.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

/// exceeding this limit triggers a warning.
final int maxLines;

/// Method names to be excluded from the rule check

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// Method names to be excluded from the rule check
/// Function names to be excluded from the rule check

Does it make sense to be consistent with all the rest documentation/naming?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines +19 to +21
return i;
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would be great to also test that it does not report false positives for both - methods and functions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for changing the file name to a proper one!

@aderhachev aderhachev linked an issue Mar 15, 2024 that may be closed by this pull request
@aderhachev aderhachev merged commit 9adae1f into master Mar 15, 2024
@aderhachev aderhachev deleted the Andrii-Derhachev-function_lines_of_code_improvement branch March 15, 2024 12:24
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.

Add exception list to function_lines_of_code (build method)

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.