Function new_record_type
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def new_record_type(
Function define
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def define(
self,
name: str,
fields: list,
bases=(),
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function define
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def define(
Function clean_field
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def clean_field(field, use_invalid=False):
"""
Coerce argument to a Field instance.
"""
tt = object
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function normalize_field_mapping
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def normalize_field_mapping(fields):
"""
Normalize each declaration in a field mapping.
"""
for name, value in fields.items():
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __new__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __new__(mcs, name, bases, ns, use_invalid=False, **kwargs):
Function __init__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(*args, **extra):
self, *args = args
cls = type(self)
args = dict(zip(self._meta.fields, args))
kwargs = dict(self._meta.defaults)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function extract_fields_from_annotations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extract_fields_from_annotations(bases, ns):
annotations = {}
annotations.update(ns.get("__annotations__", ()))
for base in bases:
if isinstance(base, RecordMeta):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function make_init_function_code
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def make_init_function_code(names_map: dict, defaults: Mapping) -> str:
"""
Return a string with source code for the init function.
"""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"