I'm trying to ignore warning C901 too complex
for only a single function. I've tried just about ever permutation of # noqa: C901
I can see and still the error appears. I wouldq think the # noqa
comment above the function (method?) be enough. I even tried placing the comment on the same line as the def
declaration like so:
class Klass():
def my_complex_method(self): # noqa: C901
"""
lots of if's and return's
"""
Here is an example of the message I'm getting from flake8
:
src/test/_resource.py:147:5: C901 'Resource.render' is too complex (22)
def render(self, request): # noqa: C901
^
A quick search only yields how to ignore globally or for the entire file. This is not I want because the other functions in the file I do want to catch if it's too complex. Does anyone know how I can resolve my issue?
# noqa
comment on the line that throws the error, which probably isn't thedef
line. – Carbonizationdef
line as far as I can tell. I've updated the question with an example of what I'm getting from flake8. – Genteel# noqa
comment on the line of the decorator instead of the line containingdef
. – Hindward