eric6.Plugins.CheckerPlugins.CodeStyleChecker.McCabeChecker

Module implementing a checker for code complexity.

Global Attributes

None

Classes

McCabeChecker Class implementing a checker for code complexity iaw.

Functions

None


McCabeChecker

Class implementing a checker for code complexity iaw. McCabe.

Derived from

object

Class Attributes

Codes

Class Methods

None

Methods

McCabeChecker Constructor
__error Private method to record an issue.
__ignoreCode Private method to check if the error code should be ignored.
__reportInvalidSyntax Private method to report a syntax error.
run Public method to check the given source for code complexity.

Static Methods

None

McCabeChecker (Constructor)

McCabeChecker(source, filename, select, ignore, maxComplexity=10)

Constructor

source (list of str)
source code to be checked
filename (str)
name of the source file
select (list of str)
list of selected codes
ignore (list of str)
list of codes to be ignored
maxComplexity (int)
maximum allowed complexity value

McCabeChecker.__error

__error(lineNumber, offset, code, *args)

Private method to record an issue.

lineNumber (int)
line number of the issue
offset (int)
position within line of the issue
code (str)
message code
args (list)
arguments for the message

McCabeChecker.__ignoreCode

__ignoreCode(code)

Private method to check if the error code should be ignored.

code
message code to check for (string)
Returns:
flag indicating to ignore the given code (boolean)

McCabeChecker.__reportInvalidSyntax

__reportInvalidSyntax()

Private method to report a syntax error.

McCabeChecker.run

run()

Public method to check the given source for code complexity.

Up