flake8-functions
A flake8 extension that checks functions
What it is and what it does
flake8-functions is a linter plugin that adds four new rule categories to flake8, targeting functions that may harm code readability or maintainability. It checks for functions exceeding a configurable line length (CFQ001, default 100), functions with too many parameters (CFQ002, default 6), functions that are not pure (CFQ003), and functions with excessive return statements (CFQ004, default 3). The tool integrates directly into flake8's reporting pipeline, so violations appear alongside standard flake8 output.
The package is designed for teams where code readability across multiple developers is a priority. It has no runtime dependencies beyond flake8 itself, installs cleanly, and supports Python 3.10 through 3.14. Configuration is done via flake8's standard command-line flags (e.g., --max-function-length). The project is actively maintained and carries an MIT license.
Use it for:
- Enforce maximum function length in team codebases to prevent functions spanning multiple screens
- Limit function parameter counts to catch overly complex function signatures during code review
- Detect functions with multiple return statements that may indicate unclear control flow
- Identify impure functions (those with side effects) in codebases targeting functional programming patterns
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A flake8 extension that enforces function-level code quality rules: function length, argument count, return statement count, and function purity.
Yes, if your team values function-level code quality enforcement and uses flake8. The plugin is lightweight, actively maintained, carries no licensing restrictions, and has no external dependencies. Install it if you want automated checks for function complexity; skip it if your team prefers manual review or uses a different linter.
Install
flake8-functions on PyPI
pip
pip install flake8-functionsuv
uv add flake8-functionspoetry
poetry add flake8-functionsInstalling flake8-functions
Before you install
Low friction install with no runtime dependencies. Active maintenance as of 2026-08-14 with recent release history since 2019.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install flake8-functions
flake8 --max-function-length=100 your_code.py
Requires Python 3.10 or later; flake8 must be installed and configured.
Verify before relying
- Whether CFQ003 (purity check) correctly identifies side effects in all Python patterns
- How configurable thresholds interact with existing flake8 configuration files
- Performance impact on large codebases with many functions
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 356,801/month — #7,278 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flake8_functions-0.1.0-py3-none-any.whl
Keywords: flake8, linter, functions
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
flake8-annotations-complexityA flake8 plugin that flags type annotations…
permissive · top 15,000 on PyPI
mr-propermr. Proper is a static code analyzer that…
permissive · top 15,000 on PyPI
flake8-cognitive-complexityA flake8 extension that checks Python code for…
permissive · top 15,000 on PyPI
flake8-expression-complexityA flake8 extension that detects overly complex…
permissive · top 15,000 on PyPI
flake8-class-attributes-orderA flake8 extension that enforces a configurable…
permissive · top 15,000 on PyPI
flake8-variables-namesA flake8 extension that detects poorly named…
permissive · top 15,000 on PyPI
flake8-builtinsA flake8 plugin that detects when Python…
copyleft · top 5,000 on PyPI
flake8-printA flake8 plugin that detects print statements…
permissive · top 5,000 on PyPI
wemake-python-styleguideA flake8 plugin that enforces strict,…
permissive · top 15,000 on PyPI
purifyA decorator that makes object-mutating…
permissive · top 15,000 on PyPI