Showing 163 of 163 total issues
Function _construct_from_list
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _construct_from_list(obj, as_class):
args = []
if type_field_position_is(as_class, Position.INSIDE):
obj = obj[1:]
for i, f in enumerate(get_class_fields(as_class)):
- 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 _serialize_to_dict
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _serialize_to_dict(cls, obj):
result = {}
fields = get_class_fields(cls)
for f in fields:
name = f.name
- 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 get_type_name_repr
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_type_name_repr(cls):
if is_generic(cls):
typename = getattr(cls, '_name', str(cls.__origin__))
if typename.startswith('typing.'):
typename = typename[len('typing.'):]
- 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 _argspec_to_fields
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _argspec_to_fields(f, arguments, defaults, hints, types_required=True) -> typing.List[Field]:
Function _get_defining_class
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_defining_class(cls, method, method_name=None, mro=None, stop_class=None):
Function _construct_object
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _construct_object(obj, as_class: Type):
if isinstance(as_class, Hashable) and as_class in SERIALIZER_MAPPING:
as_class = SERIALIZER_MAPPING[as_class]
if issubclass(as_class, StaticSerializer):
- 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 _argspec_to_fields
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _argspec_to_fields(f, arguments, defaults, hints, types_required=True) -> typing.List[Field]:
defaults_num = len(defaults) if defaults is not None else 0
non_defaults_num = len(arguments) - defaults_num
fields = []
for i, arg in enumerate(arguments):
- 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
Avoid too many return
statements within this function. Open
return _serialize_as_type(obj, as_class)
Avoid too many return
statements within this function. Open
return seq_type([deserialize(o, seq_int_type) for o in obj])
Function __new__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __new__(cls, **kwargs):
has_init = issubclass(_get_defining_class(cls, cls.__init__), Serializer)
if getattr(cls, '_dynamic', False):
if has_init:
cls.__init__(cls, **kwargs)
- 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
Line too long (93 > 79 characters) Open
new_other_container = deserialize(other_payload, OtherContainer) # OtherContainer([2, 2, 2])
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (83 > 79 characters) Open
""":class:`~pyjackson.generics.StaticSerializer` for :class:`uuid.UUID` type"""
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (84 > 79 characters) Open
args = ','.join('{}={}'.format(key, getattr(self, key)) for key in flds)
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (95 > 79 characters) Open
from pyjackson.generics import SERIALIZER_MAPPING, Serializer, SerializerType, StaticSerializer
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (98 > 79 characters) Open
f'mapping key type must be one of {SERIALIZABLE_DICT_TYPES}, not {key_type}. '
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (110 > 79 characters) Open
return is_generic37(as_class) and any(issubclass(as_class.__origin__, t) for t in _collection_types) and \
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (87 > 79 characters) Open
new_types = tuple(_substitute_nested_type(t, polymorphism) for t in type_.__args__)
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (97 > 79 characters) Open
return cls == typing.Union or (hasattr(cls, '__origin__') and cls.__origin__ == typing.Union)
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (92 > 79 characters) Open
subtype_models: Dict[str, Type[BaseModel]] = namespace.pop('__subtype_models__', {})
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (109 > 79 characters) Open
'type_field_position_is', 'resolve_subtype', 'Comparable', 'get_tuple_internal_types', 'is_tuple',
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.