-
Notifications
You must be signed in to change notification settings - Fork 2k
Improve the cognitive_complexity lint to show what lines are causing the complexity #4470
Copy link
Copy link
Open
Labels
C-an-interesting-projectCategory: Interesting projects, that usually are more involved design/code wise.Category: Interesting projects, that usually are more involved design/code wise.C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.L-nurseryLint: Currently in the nursery groupLint: Currently in the nursery group
Metadata
Metadata
Assignees
Labels
C-an-interesting-projectCategory: Interesting projects, that usually are more involved design/code wise.Category: Interesting projects, that usually are more involved design/code wise.C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.L-nurseryLint: Currently in the nursery groupLint: Currently in the nursery group
Type
Fields
Give feedbackNo fields configured for issues without a type.
We could improve the
cognitive_complexitylint further by showing the^sign under tokens which cause the increment of cognitive complexity. Doing so would let users know what actually was causing the complexity and so they would spend their time more effectively fixing the issue.Right now, for people unfamiliar with the cognitive complexity, it is impossible to know for sure what is causing problems in their code, they have to study the paper. Also, even people who had it known before the problem appeared, could simply have forgotten it. This explicit show will not only help them understand what causes a problem here but also will teach them.