mccabe icon indicating copy to clipboard operation
mccabe copied to clipboard

McCabe complexity checker for Python

Results 17 mccabe issues
Sort by recently updated
recently updated
newest added

Test results: https://github.com/cclauss/mccabe/actions

0.7.0 was released on 2022-1-23, not 2021-1-23.

Fix test_mccabe not to fail to import if hypothesmith is not available. While the original code seems to attempt to handle missing hypothesmith, the file fails with NameError without it....

When using third party services libraries, or even on your own code, you may find a scenario were a function may return several different types of exceptions each of them...

When running the self tests on the pypi sdist file, I see: ``` # setup.py test running test WARNING: Testing via this command is deprecated and will be removed in...

The current behaviour of `python -m mccabe` (no positional argument provided) is an `IndexError` ``` File "/home/junior/.local/lib/python3.10/site-packages/mccabe.py", line 327, in main code = _read(args[0]) IndexError: list index out of range...

From @sigmavirus24 Actually now that I think of a more complex example ``` def f(): try: function_one(1) function_two(arg) except TypeA: print(2) except TypeB: print(3) else: print(4) finally: if x: print(5.1)...

I was recently fixing a bunch of flake8 violations in a project. Two such failures were `B006` and `B008`, from [PyCQA/flake8-bugbear](https://github.com/PyCQA/flake8-bugbear). The way I like to fix these is to...

Having `asdf.py`: ```python elements = [0, 1, 2, 3, 4] ignore = [1, 2] def loop(): for x in elements: if x in ignore: continue print(x) def comprehension(): filtered =...