skillfed

flake8-functions

A flake8 extension that checks functions

flake8-functions v0.1.0 356.8K downloads/30d#7,278 on PyPI50
Permissive license MIT Active released

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-functions

uv

uv add flake8-functions

poetry

poetry add flake8-functions

Installing 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

Environment :: ConsoleFramework :: Flake8Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: DocumentationTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality AssuranceTyping :: Typed

Tags

flake8 function length checkerenforce function complexity limitsfunction argument count linterflake8 code quality extensionfunction purity checker
flake8-plugincode-qualitylinting

More Python Modules packages

idna

Converts domain names between Unicode and…

permissive · top 100 on PyPI

setuptools

Setuptools is a Python build backend and…

permissive · top 100 on PyPI

PyYAML

PyYAML parses and emits YAML 1.1 data format,…

permissive · top 100 on PyPI

pydantic

Pydantic validates Python data structures…

permissive · top 100 on PyPI

annotated-types

Provides reusable metadata objects for use with…

permissive · top 100 on PyPI

typing-inspection

Provides runtime tools to inspect and…

permissive · top 100 on PyPI

flake8-annotations-complexity

A flake8 plugin that flags type annotations…

permissive · top 15,000 on PyPI

mr-proper

mr. Proper is a static code analyzer that…

permissive · top 15,000 on PyPI

flake8-cognitive-complexity

A flake8 extension that checks Python code for…

permissive · top 15,000 on PyPI

flake8-expression-complexity

A flake8 extension that detects overly complex…

permissive · top 15,000 on PyPI

flake8-class-attributes-order

A flake8 extension that enforces a configurable…

permissive · top 15,000 on PyPI

flake8-variables-names

A flake8 extension that detects poorly named…

permissive · top 15,000 on PyPI

flake8-builtins

A flake8 plugin that detects when Python…

copyleft · top 5,000 on PyPI

flake8-print

A flake8 plugin that detects print statements…

permissive · top 5,000 on PyPI

wemake-python-styleguide

A flake8 plugin that enforces strict,…

permissive · top 15,000 on PyPI

purify

A decorator that makes object-mutating…

permissive · top 15,000 on PyPI