METADATA 4.2 KB

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