{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/13"},{"label":"Quality Assurance","url":"https://skillfed.io/packages/category/software-development-quality-assurance/2"},{"label":"Documentation","url":"https://skillfed.io/packages/category/software-development-documentation"}],"enrichment":{"capability":"Calculates cognitive complexity scores for Python functions by analyzing their abstract syntax tree, measuring how difficult code is to understand based on control flow, nesting, recursion, and logical operations.","skillfed_tags":["code-quality","ast-analysis","linting"],"use_cases":["Integrate into a CI/CD pipeline to flag functions exceeding a complexity threshold and enforce code review for high-complexity changes.","Use as a flake8 plugin to get real-time warnings during development when functions become too difficult to understand.","Analyze legacy codebases to identify which functions are candidates for refactoring based on cognitive load.","Build custom linting rules that combine cognitive complexity with other metrics to guide architectural decisions."],"what_it_does":"Cognitive-complexity is a Python library that computes a numeric score representing how cognitively difficult a function is to understand. It works by parsing Python source code into an abstract syntax tree and applying heuristics that award complexity points for control-flow breaks, nesting depth, recursion, and logical operations. The library itself has no runtime dependencies and is typically used either as a standalone API or integrated into flake8 via the flake8-cognitive-complexity extension.\n\nThe package is based on research into cognitive complexity as a measure of code understandability\u2014distinct from traditional cyclomatic complexity. The implementation is acknowledged to be an approximation rather than a precise realization of the original algorithm. The project has been abandoned and receives no active maintenance, though it remains functional for Python 3.6+ codebases.","worth_installing":"Yes, if you need cognitive complexity analysis and are comfortable with an unmaintained library. The package is stable, has no dependencies, and works reliably on Python 3.6+. However, consider it a read-only tool: expect no bug fixes, security patches, or feature updates. If active maintenance is critical for your workflow, investigate whether a maintained alternative exists before committing to this version."},"id":"cognitive-complexity","links":{"html":"https://skillfed.io/packages/cognitive-complexity","md":"https://skillfed.io/packages/cognitive-complexity.md","pypi":"https://pypi.org/project/cognitive-complexity/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2022-08-09","license_spdx":null,"license_treatment":"permissive","name":"cognitive-complexity","python_support":"supports_current","summary":"Library to calculate Python functions cognitive complexity via code"},"popularity":{"monthly_downloads":352807,"position":7308,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.3.0"}
