Code Complexity and the Quiet Helpers in Our IDEs
“Code is like a joke. If you have to explain it, it’s too complex.” — Unknown
Photo by Joshua Hoehne on Unsplash
Code Complexity and the Quiet Helpers in Our IDEs
“Code is like a joke. If you have to explain it, it’s too complex.” — Unknown
Have you ever looked at a method and felt your brain hit a wall before you reached the final closing brace?
Yeah… me too.
Recently, while chasing a refactor down a rabbit hole, I stumbled on something I wish I’d embraced years ago: code complexity analysis tools right inside the IDE. For Rider users (like me), there’s a plugin that makes this beautifully visual — but good news! If you’re using Visual Studio or even Visual Studio Code, there are ways to get similar insights.
So, if you’ve ever squinted at a method wondering, “Should this be two methods? Or five?” — read on.
What is Code Complexity?
In a nutshell, code complexity refers to how complicated and tangled your logic is — not necessarily how long your code is, but how many branches, conditions, and logical pathways your poor CPU (and fellow devs) have to reason through.
One of the most popular measures is Cyclomatic Complexity, which essentially counts the number of linearly independent paths through a block of code. Think:
if,else iffor,whileswitch,case&&,||
The more branches, the higher the complexity — and the harder it is to test, debug, and maintain.
Discovering the Plugin in Rider
In JetBrains Rider, I came across a plugin called Cognitive Complexity, and it’s now a permanent resident in my toolbox.
Once enabled, it adds a small cognitive complexity indicator next to the method/class and only displays once the method or class becomes moderately complex. There are other plugins too - have a browse and pick your favourite.
In this screenshot it counts the nested if statements(‘+3’, ‘+4', ‘+5’) and the indicator shows the cognitive complexity percentage of threshold.

Screenshot of Rider plugin showing complexity indicators
The first time I ran it on one of my larger components, I may have winced. But that’s the point, right? It surfaces the things we quietly know need attention.
What About Visual Studio?
Visual Studio Enterprise has built-in code metrics under Analyze > Calculate Code Metrics. This article explains what it entails and how to activate it.
Visual Studio Code doesn’t natively provide code metrics, there are a lot of extensions for JS/TS but I found [Codalyze](https://marketplace.visualstudio.com/items?itemName=selcuk-usta.code-complexity-report-generator). To run it press Ctrl + Shift+ P(Windows) / Shift + Command+ P(MacOS) shortcut and write Codalyze and run it!:

“Programs must be written for people to read, and only incidentally for machines to execute.” — Harold Abelson
A Few Personal Lessons
- It’s not about perfection. Not every method has to be under 10 complexity points. But wildly spiky metrics are a good nudge.
- Use complexity to spark conversation. I’ve started flagging gnarly methods in code reviews with, “Hey, this has a complexity of 24 — worth discussing?”
- Refactor early if you can. High complexity is a smell. But just like real smells, it’s best dealt with before it sets in.
Final Thoughts
If you’re like me, you care about writing clean, maintainable code — but sometimes, you need a little nudge. These tools aren’t the boss of us, but they can be a second set of eyes when fatigue sets in or tunnel vision creeps up.
Also: there’s something satisfying about watching a complexity score drop after a good refactor. Like giving your code a deep breath.
Let me know if you’ve used these tools — or if you’ve found a better one!
메타데이터
- post_id
- d9142b032fd0
- slug
- code-complexity-and-the-quiet-helpers-in-our-ides-d9142b032fd0
- url
- https://medium.com/@mariekie/code-complexity-and-the-quiet-helpers-in-our-ides-d9142b032fd0
- canonical_url
- https://medium.com/@mariekie/code-complexity-and-the-quiet-helpers-in-our-ides-d9142b032fd0
- author_url
- https://medium.com/@mariekie
- status
- ok
- fetched_at
- 2026-07-17 16:42:39