ramonhagenaars/jsons

View on GitHub

Showing 96 of 96 total issues

Function default_namedtuple_deserializer has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

def default_namedtuple_deserializer(
        obj: Union[list, dict],
        cls: type,
        *,
        key_transformer: Optional[Callable[[str], str]] = None,
Severity: Minor
Found in jsons/deserializers/default_tuple.py - About 2 hrs to fix

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

File __init__.py has 288 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
Works with Python3.5+

JSON (de)serialization (jsons) from and to dicts and plain old Python objects.

Severity: Minor
Found in jsons/__init__.py - About 2 hrs to fix

    File default_object.py has 281 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import inspect
    from datetime import datetime, timezone
    from inspect import isfunction
    from typing import Optional, Callable, Union, MutableSequence, Tuple, Dict
    
    
    Severity: Minor
    Found in jsons/serializers/default_object.py - About 2 hrs to fix

      Function default_object_serializer has 13 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def default_object_serializer(
      Severity: Major
      Found in jsons/serializers/default_object.py - About 1 hr to fix

        Function _do_serialize has 12 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def _do_serialize(
        Severity: Major
        Found in jsons/serializers/default_object.py - About 1 hr to fix

          Function _do_serialize has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          def _do_serialize(
                  obj: object,
                  cls: type,
                  attributes: Dict[str, Optional[type]],
                  kwargs: dict,
          Severity: Minor
          Found in jsons/serializers/default_object.py - About 1 hr to fix

          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 default_dict_serializer has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          def default_dict_serializer(
                  obj: dict,
                  cls: Optional[type] = None,
                  *,
                  strict: bool = False,
          Severity: Minor
          Found in jsons/serializers/default_dict.py - About 1 hr to fix

          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 _fill has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def _fill(
          Severity: Major
          Found in jsons/_multitasking.py - About 1 hr to fix

            Function default_list_deserializer has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def default_list_deserializer(
            Severity: Major
            Found in jsons/deserializers/default_list.py - About 1 hr to fix

              Function _get_value_for_attr has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def _get_value_for_attr(
              Severity: Major
              Found in jsons/deserializers/default_object.py - About 1 hr to fix

                Function default_dict_serializer has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def default_dict_serializer(
                Severity: Major
                Found in jsons/serializers/default_dict.py - About 1 hr to fix

                  Function transform has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def transform(
                  Severity: Major
                  Found in jsons/_transform_impl.py - About 1 hr to fix

                    Function default_iterable_serializer has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def default_iterable_serializer(
                    Severity: Major
                    Found in jsons/serializers/default_iterable.py - About 50 mins to fix

                      Function _start_tasks has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def _start_tasks(
                      Severity: Major
                      Found in jsons/_multitasking.py - About 50 mins to fix

                        Function load has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def load(
                        Severity: Major
                        Found in jsons/_load_impl.py - About 50 mins to fix

                          Function _set_remaining_attrs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def _set_remaining_attrs(instance,
                                                   remaining_attrs,
                                                   attr_getters,
                                                   **kwargs):
                              # Set any remaining attributes on the newly created instance.
                          Severity: Minor
                          Found in jsons/deserializers/default_object.py - About 45 mins to fix

                          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 set_serializer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def set_serializer(
                                  func: callable,
                                  cls: Union[type, Sequence[type]],
                                  high_prio: bool = True,
                                  fork_inst: type = StateHolder) -> None:
                          Severity: Minor
                          Found in jsons/_lizers_impl.py - About 45 mins to fix

                          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 multi_task has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def multi_task(
                          Severity: Minor
                          Found in jsons/_multitasking.py - About 45 mins to fix

                            Function _get_async_wrapper has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def _get_async_wrapper(
                            Severity: Minor
                            Found in jsons/decorators.py - About 45 mins to fix

                              Function _run_decorated has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def _run_decorated(decorated, mapper, fork_inst, args, kwargs, mapper_kwargs):
                              Severity: Minor
                              Found in jsons/decorators.py - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language