Giter VIP home page Giter VIP logo

Comments (3)

sigmavirus24 avatar sigmavirus24 commented on May 26, 2024 2

A few things:

  1. McCabe doesn't implement # noqa - Flake8 does
  2. # noqa in Flake8 belongs on the line that's being reported. So in your example, the line number is 2 which corresponds with def complex_function(): so instead this should look like
def complex_function():  # noqa: C901
    ...
  1. Issue trackers are not for Q&A, they're for bug reports. Use stackoverflow for questions.

from mccabe.

raxod502 avatar raxod502 commented on May 26, 2024 1

Note for future visitors --

Moving the noqa line does fix the problem for:

$ flake8 --max-complexity 3 cyclo.py
cyclo.py:2:1: C901 'complex_function' is too complex (4)

However, it does not fix the problem for:

$ python3 -m mccabe --min 3 cyclo.py
1:0: 'complex_function' 4

This is because (as far as I can tell) mccabe does not provide any way to silence warnings, and you must use flake8 with mccabe as a plugin if you want that functionality.

from mccabe.

sigmavirus24 avatar sigmavirus24 commented on May 26, 2024

That's correct @raxod502

from mccabe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.