--- id: flake8-cognitive-complexity version: "0.1.0" license: MIT license_treatment: permissive maintenance: abandoned --- # flake8-cognitive-complexity — An extension for flake8 that validates cognitive functions complexity License: permissive · Maintenance: abandoned · Downloads: 298.5K/mo ## What it is and what it does flake8-cognitive-complexity is a flake8 linter plugin that measures cognitive complexity—a metric for how difficult a piece of code is to understand—introduced by G. Ann Campbell and used by SonarSource and CodeClimate. It analyzes Python functions and reports violations when complexity exceeds a threshold you set, defaulting to 7. The plugin integrates directly into flake8's workflow and emits error code CCR001 when a function's cognitive complexity is too high. The package has no runtime dependencies and works by analyzing control flow in your code. However, it is abandoned: the last release was 2020-08-01 and the last commit to the repository was 2021-02-24. This means it may not be compatible with recent versions of flake8 or Python versions beyond 3.8, and bugs or incompatibilities will not be fixed. Use it for: - Enforce a maximum cognitive complexity threshold in CI/CD pipelines to catch overly complex functions early. - Identify functions that are hard to understand and maintain as part of code review workflows. - Set project-wide complexity standards using the --max-cognitive-complexity option in flake8 configuration. - Measure code quality improvements over time by tracking cognitive complexity violations in your codebase. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A flake8 extension that checks Python code for cognitive complexity, flagging functions that exceed a configurable threshold (default 7) to help identify overly complex logic. No. The package is abandoned (last update 2021-02-24) and untested with modern Python or flake8 versions. While the idea is sound and the MIT license is permissive, the lack of maintenance means you risk compatibility breakage and unpatched issues. Consider an actively maintained alternative or a more recent cognitive-complexity linter. ## Install pip install flake8-cognitive-complexity uv add flake8-cognitive-complexity poetry add flake8-cognitive-complexity ## Installing flake8-cognitive-complexity Before you install: High install friction due to no runtime dependencies, but the package is abandoned—last release was 2020-08-01 and last commit 2021-02-24. It may not work with recent flake8 or Python versions without maintenance. License in practice: MIT license is permissive and poses no restrictions on use, modification, or distribution. Quickstart: pip install flake8-cognitive-complexity flake8 --max-cognitive-complexity=7 your_file.py Requires flake8 to be installed; tested on flake8 3.7.8 and Python 3.7.x, but package is unmaintained since 2021. Verify before relying: - Compatibility with flake8 versions released after 2021 and modern Python versions (3.9+) - Whether the package still functions as a working flake8 plugin in current environments ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: high - Maintenance: abandoned - Downloads: 298.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags flake8 cognitive complexity checker, code complexity linter plugin, function complexity validation, flake8 extension quality assurance, measure code understandability, cyclomatic complexity alternative, code maintainability analysis, code-quality, linter-plugin, unmaintained [View on SkillFed](https://skillfed.io/packages/flake8-cognitive-complexity) · [View on PyPI](https://pypi.org/project/flake8-cognitive-complexity/)