-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Suggestion for new lint: Cognitive Complexity #3793
Copy link
Copy link
Closed
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-hardCall for participation: This a hard problem and requires more experience or effort to work onCall for participation: This a hard problem and requires more experience or effort to work onL-complexityLint: Belongs in the complexity lint groupLint: Belongs in the complexity lint groupS-needs-discussionStatus: Needs further discussion before merging or work can be startedStatus: Needs further discussion before merging or work can be started
Description
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-hardCall for participation: This a hard problem and requires more experience or effort to work onCall for participation: This a hard problem and requires more experience or effort to work onL-complexityLint: Belongs in the complexity lint groupLint: Belongs in the complexity lint groupS-needs-discussionStatus: Needs further discussion before merging or work can be startedStatus: Needs further discussion before merging or work can be started
Type
Fields
No fields configured for issues without a type.
Hi all, I'd like to propose (and implement, if someone can mentor me a bit!) a lint for Cognitive Complexity. It's a way to measure the cognitive load that a particular function puts on the reader.
I think that having an upper bound on the allowed cognitive complexity of functions would help ensure that complex functions are split into simpler, more maintainable ones. It would also help to complement the role that the Cyclomatic Complexity lint currently has.