-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Reduce cognitive complexity lint span #4935
Reduce cognitive complexity lint span #4935
Conversation
Currently the cognitive complexity lint spans the entire function body making it really difficult to read and refactor the code in editors. To fix this we reduce the lint span to the function name.
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.
LGTM, thanks!
@bors r+ |
📌 Commit 91a491e has been approved by |
…ity-lint-span, r=phansch Reduce cognitive complexity lint span Currently the cognitive complexity lint spans the entire function body making it really difficult to read and refactor the code in editors. To fix this we reduce the lint span to the function name. changelog: Reduce cognitive complexity lint span Fixes #4241
if rust_cc > self.limit.limit() { | ||
let fn_span = match kind { | ||
FnKind::ItemFn(ident, _, _, _, _) | FnKind::Method(ident, _, _, _) => ident.span, |
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.
FnKind::ItemFn(ident, _, _, _, _) | FnKind::Method(ident, _, _, _) => ident.span, | |
FnKind::ItemFn(ident, ..) | FnKind::Method(ident, ..) => ident.span, |
☀️ Test successful - checks-travis, status-appveyor |
Currently the cognitive complexity lint spans the entire function body making it really difficult to read and refactor the code in editors. To fix this we reduce the lint span to the function name.
changelog: Reduce cognitive complexity lint span
Fixes #4241