Conquering Complexity: Refactoring JavaScript Projects
summary
Shows how to find and shrink real complexity using cognitive complexity scores (example: a function rated 34 flagged to cut to 15), using SonarLint and its ESLint plugin to pinpoint the worst nesting. Demonstrates concrete refactors: invert conditions and early return, structural collapse, extract helper methods, add unit tests before refactoring, and use language features like optional chaining and the nullish coalescing assignment (??=). The result is smaller scores, clearer functions, and safer changes.
AI-written summary · about
chapters (8)
- 0:00Introduction and speaker background
- 3:13Understanding complexity in code
- 8:55Measuring cognitive complexity
- 13:12Identifying complexity in projects
- 18:30When to refactor complex code
- 22:20Reducing nesting in JavaScript
- 34:24Writing code for others
- 35:06Recap and tools for complexity
related talks
45mConquering complexity: refactoring JavaScript projects
34mMass Frontend Refactors: Less Stress; More Success
35mRefactoring Client-Side Code
58mFrom Zero to Live with Functional JavaScript Applications (Part 2)
01h 04mRefactoring Is Not Just Clickbait
44mDistributing complexity in huge python projects.
46mCompilers, User Interfaces & the Rest of Us
48mHow to Start Refactoring Someone Else's Code Without Getting Fired in a Month
