{"id":13734381,"url":"https://github.com/best-doctor/flake8-functions","last_synced_at":"2025-04-13T08:41:10.946Z","repository":{"id":35140990,"uuid":"212029260","full_name":"best-doctor/flake8-functions","owner":"best-doctor","description":"flake8 plugin for validation of function parameters (length, complexity, etc)","archived":false,"fork":false,"pushed_at":"2023-04-10T15:51:56.000Z","size":40,"stargazers_count":50,"open_issues_count":7,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T00:13:50.187Z","etag":null,"topics":["code-standards","flake8","flake8-plugin","styleguide"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/best-doctor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-10-01T06:42:56.000Z","updated_at":"2024-06-26T09:30:18.000Z","dependencies_parsed_at":"2024-01-06T09:58:11.806Z","dependency_job_id":"2610f333-3c3f-4e3b-ae8c-9332d6fedd7d","html_url":"https://github.com/best-doctor/flake8-functions","commit_stats":{"total_commits":36,"total_committers":11,"mean_commits":3.272727272727273,"dds":0.7777777777777778,"last_synced_commit":"7f0ab41b36b808f326783b3fb4035e3b0896fbff"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/best-doctor%2Fflake8-functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/best-doctor%2Fflake8-functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/best-doctor%2Fflake8-functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/best-doctor%2Fflake8-functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/best-doctor","download_url":"https://codeload.github.com/best-doctor/flake8-functions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248686200,"owners_count":21145438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-standards","flake8","flake8-plugin","styleguide"],"created_at":"2024-08-03T03:00:55.180Z","updated_at":"2025-04-13T08:41:10.915Z","avatar_url":"https://github.com/best-doctor.png","language":"Python","funding_links":[],"categories":["Complexity"],"sub_categories":[],"readme":"# flake8-functions\n\n[![Build Status](https://travis-ci.org/best-doctor/flake8-functions.svg?branch=master)](https://travis-ci.org/best-doctor/flake8-functions)\n[![Maintainability](https://api.codeclimate.com/v1/badges/4cdbd67833752665ee79/maintainability)](https://codeclimate.com/github/best-doctor/flake8-functions/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/4cdbd67833752665ee79/test_coverage)](https://codeclimate.com/github/best-doctor/flake8-functions/test_coverage)\n[![PyPI version](https://badge.fury.io/py/flake8-functions.svg?)](https://badge.fury.io/py/flake8-functions)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/flake8-functions)\n\nAn extension for flake8 to report on issues with functions.\n\nWe believe code readability is very important for a team that consists of\nmore than one person. One of the issues we've encountered is functions\nthat are more that two screens long.\n\nThe validator checks for:\n\n* CFQ001 - function length (default max length is 100)\n* CFQ002 - function arguments number (default max arguments amount is 6)\n* CFQ003 - function is not pure.\n* CFQ004 - function returns number (default max returns amount is 3)\n\n## Installation\n\n```terminal\npip install flake8-functions\n```\n\n## Example\n\n```python\ndef some_long_function(\n    first_parameter: int,\n    second_parameter: int,\n    third_parameter: int,\n):\n    first_parameter = (\n        first_parameter +\n        second_parameter +\n        third_parameter\n    )\n\n    first_parameter = (\n        first_parameter +\n        second_parameter +\n        third_parameter\n    )\n\n    first_parameter = (\n        first_parameter +\n        second_parameter +\n        third_parameter\n    )\n\n    first_parameter = (\n        first_parameter +\n        second_parameter +\n        third_parameter\n    )\n\n    return first_parameter\n```\n\nUsage:\n\n```terminal\n$ flake8 --max-function-length=20 test.py\ntest.py:1:0: CFQ001 \"some_long_function\" function has length 25\nthat exceeds max allowed length 20\n```\n\n## Error codes\n\n| Error code |                     Description                                                                    |\n|:----------:|:--------------------------------------------------------------------------------------------------:|\n|   CFQ001   | Function \"some_function\" has length %function_length% that exceeds max allowed length %max_length% |\n|   CFQ002   | Function \"some_function\" has %args_amount% arguments that exceeds max allowed %max_args_amount%    |\n|   CFQ003   | Function \"some_function\" is not pure.                                                              |\n|   CFQ004   | Function \"some_function\" has %returns_amount% returns that exceeds max allowed %max_returns_amount%|\n\n## Code prerequisites\n\n1. Python 3.7+;\n\n## Contributing\n\nWe would love you to contribute to our project. It's simple:\n\n1. Create an issue with bug you found or proposal you have.\n   Wait for approve from maintainer.\n1. Create a pull request. Make sure all checks are green.\n1. Fix review comments if any.\n1. Be awesome.\n\nHere are useful tips:\n\n* You can run all checks and tests with `make check`.\n  Please do it before TravisCI does.\n* We use [BestDoctor python styleguide](https://github.com/best-doctor/guides/blob/master/guides/en/python_styleguide.md).\n* We respect [Django CoC](https://www.djangoproject.com/conduct/).\n  Make soft, not bullshit.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbest-doctor%2Fflake8-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbest-doctor%2Fflake8-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbest-doctor%2Fflake8-functions/lists"}