Improve cognitive_complexity lint's warning.
Adds the value of complexity limit set for the lint to the warning. Fixes #4466 Signed-off-by: Victor Polevoy <fx@thefx.co>
This commit is contained in:
@@ -100,7 +100,11 @@ impl CognitiveComplexity {
|
||||
cx,
|
||||
COGNITIVE_COMPLEXITY,
|
||||
span,
|
||||
&format!("the function has a cognitive complexity of {}", rust_cc),
|
||||
&format!(
|
||||
"the function has a cognitive complexity of ({}/{})",
|
||||
rust_cc,
|
||||
self.limit.limit()
|
||||
),
|
||||
"you could split it up into multiple smaller functions",
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user