class MisdesignChecker(BaseChecker): (source)
Checker of potential misdesigns. Checks for sign of poor/misdesign: * number of methods, attributes, local variables... * size, complexity of functions, methods
Method | __init__ |
Checker instances should have the linter as argument. |
Method | leave |
Check number of public methods. |
Method | leave |
Most of the work is done here on close: checks for max returns, branch, return in __init__. |
Method | open |
Initialize visit variables. |
Method | visit |
Check size of inheritance hierarchy and number of instance attributes. |
Method | visit |
Default visit method -> increments the statements counter if necessary. |
Method | visit |
Check function name, docstring, arguments, redefinition, variable names, max locals. |
Method | visit |
Increments the branches counter and checks boolean expressions. |
Method | visit |
Count number of returns. |
Method | visit |
Increments the branches counter. |
Method | visit |
Increments the branches counter. |
Method | visit |
Increments the branches counter. |
Class Variable | name |
Name of the provider. |
Class Variable | options |
Options provided by this provider. |
Method | _check |
Go through "if" node `node` and count its boolean expressions if the 'if' node test is a BoolOp node. |
Method | _inc |
Undocumented |
Method | _inc |
Increments the branches counter. |
Instance Variable | _branches |
Undocumented |
Instance Variable | _exclude |
Undocumented |
Instance Variable | _returns |
Undocumented |
Instance Variable | _stmts |
Undocumented |
Inherited from BaseChecker
:
Method | __eq__ |
Permit to assert Checkers are equal. |
Method | __gt__ |
Sorting of checkers. |
Method | __hash__ |
Make Checker hashable. |
Method | __repr__ |
Undocumented |
Method | __str__ |
This might be incomplete because multiple classes inheriting BaseChecker can have the same name. |
Method | add |
Undocumented |
Method | check |
Check the consistency of msgid. |
Method | close |
Called after visiting project (i.e set of modules). |
Method | create |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | reduce |
Undocumented |
Class Variable | enabled |
Undocumented |
Class Variable | msgs |
Undocumented |
Class Variable | reports |
Undocumented |
Instance Variable | linter |
Undocumented |
Property | messages |
Undocumented |
Inherited from _ArgumentsProvider
(via BaseChecker
):
Method | get |
DEPRECATED: Return the dictionary defining an option given its name. |
Method | level |
Undocumented |
Method | load |
DEPRECATED: Initialize the provider using default values. |
Method | option |
DEPRECATED: Get the config attribute corresponding to opt. |
Method | option |
DEPRECATED: Get the current value for the given option. |
Method | options |
DEPRECATED. |
Method | options |
DEPRECATED: Return an iterator on options grouped by section. |
Method | set |
DEPRECATED: Method called to set an option (registered in the options list). |
Class Variable | option |
Option groups of this provider and their descriptions. |
Property | config |
Undocumented |
Property | level |
Undocumented |
Instance Variable | _arguments |
The manager that will parse and register any options provided. |
Instance Variable | _level |
Undocumented |
pylint.checkers.BaseChecker.__init__
Checker instances should have the linter as argument.
def leave_classdef(self, node:
nodes.ClassDef
):
(source)
¶
Check number of public methods.
def leave_functiondef(self, node:
nodes.FunctionDef
):
(source)
¶
Most of the work is done here on close: checks for max returns, branch, return in __init__.
def visit_classdef(self, node:
nodes.ClassDef
):
(source)
¶
Check size of inheritance hierarchy and number of instance attributes.
def visit_functiondef(self, node:
nodes.FunctionDef
):
(source)
¶
Check function name, docstring, arguments, redefinition, variable names, max locals.
def visit_if(self, node:
nodes.If
):
(source)
¶
Increments the branches counter and checks boolean expressions.
Go through "if" node `node` and count its boolean expressions if the 'if' node test is a BoolOp node.