{ "info": { "author": "Ilya Lebedev", "author_email": "melevir@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Framework :: Flake8", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Software Development :: Documentation", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Quality Assurance" ], "description": "# flake8-cognitive-complexity\n\n[![Build Status](https://travis-ci.org/Melevir/flake8-cognitive-complexity.svg?branch=master)](https://travis-ci.org/Melevir/flake8-cognitive-complexity)\n[![Maintainability](https://api.codeclimate.com/v1/badges/579738d149e489c631a6/maintainability)](https://codeclimate.com/github/Melevir/flake8-cognitive-complexity/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/579738d149e489c631a6/test_coverage)](https://codeclimate.com/github/Melevir/flake8-cognitive-complexity/test_coverage)\n[![PyPI version](https://badge.fury.io/py/flake8-cognitive-complexity.svg)](https://badge.fury.io/py/flake8-cognitive-complexity)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/flake8-cognitive-complexity)\n\nAn extension for flake8 that validates cognitive functions complexity.\n\nCognitive complexity is analog of cyclomatic complexity, that measure\nhow difficult to understand piece of code. Introduced by [G. Ann Campbell](https://github.com/ganncamp)\nand currently used by SonarSource, CodeClimate and others.\nYou can find more readings about cognitive complexity in\n[cognitive-complexity readme file](https://github.com/Melevir/cognitive_complexity/blob/master/README.md#what-is-cognitive-complexity).\n\nDefault complexity is 7, can be configured via `--max-cognitive-complexity` option.\n\n## Installation\n\n```terminal\npip install flake8-cognitive-complexity\n```\n\n## Example\n\n```python\ndef f(a, b):\n if a:\n for i in range(b):\n if b:\n return 1\n```\n\nUsage:\n\n```terminal\n$ flake8 --max-cognitive-complexity=3 test.py\ntext.py:1:5: CCR001 Cognitive complexity is too high (6 > 3)\n```\n\nTested on Python 3.7.x and flake8 3.7.8.\n\n## Error codes\n\n| Error code | Description |\n|:----------:|:----------------------------------------:|\n| CCR001 | Cognitive complexity is too high (X > Y) |", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Melevir/flake8-cognitive-complexity", "keywords": "flake8", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "flake8-cognitive-complexity", "package_url": "https://pypi.org/project/flake8-cognitive-complexity/", "platform": "", "project_url": "https://pypi.org/project/flake8-cognitive-complexity/", "project_urls": { "Homepage": "https://github.com/Melevir/flake8-cognitive-complexity" }, "release_url": "https://pypi.org/project/flake8-cognitive-complexity/0.1.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "An extension for flake8 that validates cognitive functions complexity", "version": "0.1.0", "yanked": false, "yanked_reason": null }, "last_serial": 7860910, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "69c98dfdf7703b1a4cf05469681ce148", "sha256": "565ffbe4d9329f877d14759e0ce859efeac56dc55ec35aacca4c61b207777fba" }, "downloads": -1, "filename": "flake8_cognitive_complexity-0.0.1.tar.gz", "has_sig": false, "md5_digest": "69c98dfdf7703b1a4cf05469681ce148", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2753, "upload_time": "2019-10-31T07:01:19", "upload_time_iso_8601": "2019-10-31T07:01:19.196087Z", "url": "https://files.pythonhosted.org/packages/f1/56/8cd2f5e55ae6ca4accee9ae352f3ce6255420c1e3ba3aa16f61c3131e7af/flake8_cognitive_complexity-0.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "7e4984b758adc3c9c4c1e2d2299246e9", "sha256": "7fbace212a216e09f0b2bb5aa68857e89c752e06465477b7126ae9fd54bf5fef" }, "downloads": -1, "filename": "flake8_cognitive_complexity-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7e4984b758adc3c9c4c1e2d2299246e9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3042, "upload_time": "2019-11-04T04:18:42", "upload_time_iso_8601": "2019-11-04T04:18:42.380102Z", "url": "https://files.pythonhosted.org/packages/e4/d0/0979bba275bb2332c247cee33f03e40c7f49d16b594cc7978891c62d3842/flake8_cognitive_complexity-0.0.2.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "91508c65384ff2627a81fbacf1b9fe74", "sha256": "f202df054e4f6ff182b659c261922b9c684628a47beb19cb0973c50d6a7831c1" }, "downloads": -1, "filename": "flake8_cognitive_complexity-0.1.0.tar.gz", "has_sig": false, "md5_digest": "91508c65384ff2627a81fbacf1b9fe74", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3061, "upload_time": "2020-08-01T05:49:18", "upload_time_iso_8601": "2020-08-01T05:49:18.353486Z", "url": "https://files.pythonhosted.org/packages/e7/d6/2bb09fab21521424d5afc836aa0057d15a92f5e738e506a3e3cb035be517/flake8_cognitive_complexity-0.1.0.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "91508c65384ff2627a81fbacf1b9fe74", "sha256": "f202df054e4f6ff182b659c261922b9c684628a47beb19cb0973c50d6a7831c1" }, "downloads": -1, "filename": "flake8_cognitive_complexity-0.1.0.tar.gz", "has_sig": false, "md5_digest": "91508c65384ff2627a81fbacf1b9fe74", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 3061, "upload_time": "2020-08-01T05:49:18", "upload_time_iso_8601": "2020-08-01T05:49:18.353486Z", "url": "https://files.pythonhosted.org/packages/e7/d6/2bb09fab21521424d5afc836aa0057d15a92f5e738e506a3e3cb035be517/flake8_cognitive_complexity-0.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }