Preparing for system design interviews?  Try bugzed.com →

Cognitive Complexity

JSON →
library 1.3.0 ·python
verified Jun 28, 2026

Cognitive-complexity is a Python library designed to calculate the cognitive complexity of Python functions by analyzing their Abstract Syntax Trees (ASTs). Unlike cyclomatic complexity, cognitive complexity aims to measure how difficult code is for a human to understand, focusing on flow breaks, nesting, and other structures that increase mental effort. The current version is 1.3.0, released in August 2022, with a relatively low release cadence.

total hits 18
actors 5 distinct systems
last hit 17d ago AhrefsBot
GPTBot
4
ByteDance
4
Script
1
ChatGPT-User
1
Humans
4

top countries 🇸🇬 Singapore · 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · VN