METADATA 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. Metadata-Version: 2.1
  2. Name: mccabe
  3. Version: 0.7.0
  4. Summary: McCabe checker, plugin for flake8
  5. Home-page: https://github.com/pycqa/mccabe
  6. Author: Tarek Ziade
  7. Author-email: tarek@ziade.org
  8. Maintainer: Ian Stapleton Cordasco
  9. Maintainer-email: graffatcolmingov@gmail.com
  10. License: Expat license
  11. Keywords: flake8 mccabe
  12. Platform: UNKNOWN
  13. Classifier: Development Status :: 5 - Production/Stable
  14. Classifier: Environment :: Console
  15. Classifier: Intended Audience :: Developers
  16. Classifier: License :: OSI Approved :: MIT License
  17. Classifier: Operating System :: OS Independent
  18. Classifier: Programming Language :: Python
  19. Classifier: Programming Language :: Python :: 3.6
  20. Classifier: Programming Language :: Python :: 3.7
  21. Classifier: Programming Language :: Python :: 3.8
  22. Classifier: Programming Language :: Python :: 3.9
  23. Classifier: Programming Language :: Python :: 3.10
  24. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  25. Classifier: Topic :: Software Development :: Quality Assurance
  26. Requires-Python: >=3.6
  27. License-File: LICENSE
  28. McCabe complexity checker
  29. =========================
  30. Ned's script to check McCabe complexity.
  31. This module provides a plugin for ``flake8``, the Python code checker.
  32. Installation
  33. ------------
  34. You can install, upgrade, or uninstall ``mccabe`` with these commands::
  35. $ pip install mccabe
  36. $ pip install --upgrade mccabe
  37. $ pip uninstall mccabe
  38. Standalone script
  39. -----------------
  40. The complexity checker can be used directly::
  41. $ python -m mccabe --min 5 mccabe.py
  42. ("185:1: 'PathGraphingAstVisitor.visitIf'", 5)
  43. ("71:1: 'PathGraph.to_dot'", 5)
  44. ("245:1: 'McCabeChecker.run'", 5)
  45. ("283:1: 'main'", 7)
  46. ("203:1: 'PathGraphingAstVisitor.visitTryExcept'", 5)
  47. ("257:1: 'get_code_complexity'", 5)
  48. Plugin for Flake8
  49. -----------------
  50. When both ``flake8 2+`` and ``mccabe`` are installed, the plugin is
  51. available in ``flake8``::
  52. $ flake8 --version
  53. 2.0 (pep8: 1.4.2, pyflakes: 0.6.1, mccabe: 0.2)
  54. By default the plugin is disabled. Use the ``--max-complexity`` switch to
  55. enable it. It will emit a warning if the McCabe complexity of a function is
  56. higher than the provided value::
  57. $ flake8 --max-complexity 10 coolproject
  58. ...
  59. coolproject/mod.py:1204:1: C901 'CoolFactory.prepare' is too complex (14)
  60. This feature is quite useful for detecting over-complex code. According to McCabe,
  61. anything that goes beyond 10 is too complex.
  62. Flake8 has many features that mccabe does not provide. Flake8 allows users to
  63. ignore violations reported by plugins with ``# noqa``. Read more about this in
  64. `their documentation
  65. <http://flake8.pycqa.org/en/latest/user/violations.html#in-line-ignoring-errors>`__.
  66. To silence violations reported by ``mccabe``, place your ``# noqa: C901`` on
  67. the function definition line, where the error is reported for (possibly a
  68. decorator).
  69. Links
  70. -----
  71. * Feedback and ideas: http://mail.python.org/mailman/listinfo/code-quality
  72. * Cyclomatic complexity: http://en.wikipedia.org/wiki/Cyclomatic_complexity
  73. * Ned Batchelder's script:
  74. http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html
  75. * McCabe complexity: http://en.wikipedia.org/wiki/Cyclomatic_complexity
  76. Changes
  77. -------
  78. 0.7.0 - 2021-01-23
  79. ``````````````````
  80. * Drop support for all versions of Python lower than 3.6
  81. * Add support for Python 3.8, 3.9, and 3.10
  82. * Fix option declaration for Flake8
  83. 0.6.1 - 2017-01-26
  84. ``````````````````
  85. * Fix signature for ``PathGraphingAstVisitor.default`` to match the signature
  86. for ``ASTVisitor``
  87. 0.6.0 - 2017-01-23
  88. ``````````````````
  89. * Add support for Python 3.6
  90. * Fix handling for missing statement types
  91. 0.5.3 - 2016-12-14
  92. ``````````````````
  93. * Report actual column number of violation instead of the start of the line
  94. 0.5.2 - 2016-07-31
  95. ``````````````````
  96. * When opening files ourselves, make sure we always name the file variable
  97. 0.5.1 - 2016-07-28
  98. ``````````````````
  99. * Set default maximum complexity to -1 on the class itself
  100. 0.5.0 - 2016-05-30
  101. ``````````````````
  102. * PyCon 2016 PDX release
  103. * Add support for Flake8 3.0
  104. 0.4.0 - 2016-01-27
  105. ``````````````````
  106. * Stop testing on Python 3.2
  107. * Add support for async/await keywords on Python 3.5 from PEP 0492
  108. 0.3.1 - 2015-06-14
  109. ``````````````````
  110. * Include ``test_mccabe.py`` in releases.
  111. * Always coerce the ``max_complexity`` value from Flake8's entry-point to an
  112. integer.
  113. 0.3 - 2014-12-17
  114. ````````````````
  115. * Computation was wrong: the mccabe complexity starts at 1, not 2.
  116. * The ``max-complexity`` value is now inclusive. E.g.: if the
  117. value is 10 and the reported complexity is 10, then it passes.
  118. * Add tests.
  119. 0.2.1 - 2013-04-03
  120. ``````````````````
  121. * Do not require ``setuptools`` in setup.py. It works around an issue
  122. with ``pip`` and Python 3.
  123. 0.2 - 2013-02-22
  124. ````````````````
  125. * Rename project to ``mccabe``.
  126. * Provide ``flake8.extension`` setuptools entry point.
  127. * Read ``max-complexity`` from the configuration file.
  128. * Rename argument ``min_complexity`` to ``threshold``.
  129. 0.1 - 2013-02-11
  130. ````````````````
  131. * First release