How to reduce cyclomatic complexity and make code more readable

Wait... What is cyclomatic complexity?

Happy path coding

Safeguarding with Inverted ifs

  1. Check if the customer is set
  2. Check if the name is not empty otherwise it is ‘Unknown’
  3. Check if the customer has valid age.




Senior Frontend Developer at EazyProject A/S

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

HTTP/2 Client for Scrapy

COS 126 Programming Cheatsheet

Creating Your Own Programming Language

Phases of a compiler

Assigning Roles on Public Folder (Office365)using PowerShell

官方 | 开发者资助计划聚焦:4EVERLAND

Using Jupyter Notebook on AWS EC2 Instance

Credefi’s plans for the near future

That Was Weird

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kasper Due

Kasper Due

Senior Frontend Developer at EazyProject A/S

More from Medium

Lessons learnt from publishing my programming course — Preslav Mihaylov

Your code is disposable, for your own good

Understanding Pair Programming, Why 2 Minds Are Greater Than 1.

An illustration showing how pair programming works in the workplace.

What happens when you run a C++ program?