You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and understand.
Large functions with lots of branching results in greater cognitive complexity. Refactoring on the biggest of these culprits will help with maintainability of Parcels and the ability to make new changes.
Thanks @VeckoTheGecko, very interesting analysis! Now the question: is do we make our code less complex? Just start with the top-ranking methods int he complexipy output? What are the types of overly-complex syntax that can/need to be changed?
What are the types of overly-complex syntax that can/need to be changed?
I don't think there's a single answer, and I think there are lots of ways that we can make our code less complex. Refactoring Guru is a great resource that goes over the different approaches to address different pain points.
Having this measure is nice as a quick birds eye view of the codebase that can inform refactoring efforts.
Large functions with lots of branching results in greater cognitive complexity. Refactoring on the biggest of these culprits will help with maintainability of Parcels and the ability to make new changes.
Output from complexipy
complexipy
complexipy --sort=desc parcels
The text was updated successfully, but these errors were encountered: