module documentation

Check for signs of poor design.

Class MisdesignChecker Checker of potential misdesigns.
Function register Undocumented
Constant DATACLASS_IMPORT Undocumented
Constant DATACLASSES_DECORATORS Undocumented
Constant MSGS Undocumented
Constant SPECIAL_OBJ Undocumented
Constant STDLIB_CLASSES_IGNORE_ANCESTOR Undocumented
Constant TYPING_NAMEDTUPLE Undocumented
Constant TYPING_TYPEDDICT Undocumented
Function _count_boolean_expressions Counts the number of boolean expressions in BoolOp `bool_op` (recursive).
Function _count_methods_in_class Undocumented
Function _get_parents Undocumented
Function _get_parents_iter Get parents of ``node``, excluding ancestors of ``ignored_parents``.
Function _is_exempt_from_public_methods Check if a class is exempt from too-few-public-methods.
def register(linter: PyLinter): (source)

Undocumented

DATACLASS_IMPORT: str = (source)

Undocumented

Value
'dataclasses'
DATACLASSES_DECORATORS = (source)

Undocumented

Value
frozenset(set(['dataclass', 'attrs']))

Undocumented

Value
{'R0901': ('Too many ancestors (%s/%s)',
           'too-many-ancestors',
           'Used when class has too many parent classes, try to reduce this to g
et a simpler (and so easier to use) class.'),
 'R0902': ('Too many instance attributes (%s/%s)',
           'too-many-instance-attributes',
           'Used when class has too many instance attributes, try to reduce this
...
SPECIAL_OBJ = (source)

Undocumented

Value
re.compile(r'^_{2}[a-z]+_{2}$')
STDLIB_CLASSES_IGNORE_ANCESTOR = (source)

Undocumented

Value
frozenset(('builtins.object',
           'builtins.tuple',
           'builtins.dict',
           'builtins.list',
           'builtins.set',
           'bulitins.frozenset',
           'collections.ChainMap',
...
TYPING_NAMEDTUPLE: str = (source)

Undocumented

Value
'typing.NamedTuple'
TYPING_TYPEDDICT: str = (source)

Undocumented

Value
'typing.TypedDict'
def _count_boolean_expressions(bool_op: nodes.BoolOp) -> int: (source)

Counts the number of boolean expressions in BoolOp `bool_op` (recursive). example: a and (b or c or (d and e)) ==> 5 boolean expressions

def _count_methods_in_class(node: nodes.ClassDef) -> int: (source)

Undocumented

def _get_parents(node: nodes.ClassDef, ignored_parents: frozenset[str]) -> set[nodes.ClassDef]: (source)

Undocumented

def _get_parents_iter(node: nodes.ClassDef, ignored_parents: frozenset[str]) -> Iterator[nodes.ClassDef]: (source)

Get parents of ``node``, excluding ancestors of ``ignored_parents``. If we have the following inheritance diagram: F / D E \/ B C \/ A # class A(B, C): ... And ``ignored_parents`` is ``{"E"}``, then this function will return ``{A, B, C, D}`` -- both ``E`` and its ancestors are excluded.

def _is_exempt_from_public_methods(node: astroid.ClassDef) -> bool: (source)

Check if a class is exempt from too-few-public-methods.