-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
- Added excludeNames
param for function_lines_of_code
lint
#141
- Added excludeNames
param for function_lines_of_code
lint
#141
Conversation
- Refactored tests for function_lines_of_code
There was a problem hiding this comment.
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.
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; | ||
} | ||
}(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -5,16 +5,22 @@ class FunctionLinesOfCodeParameters { | |||
/// exceeding this limit triggers a warning. | |||
final int maxLines; | |||
|
|||
/// Method names to be excluded from the rule check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return i; | ||
} | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
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!
excludeNames
param forfunction_lines_of_code
lint