tadashi-aikawa/owlmixin

View on GitHub
owlmixin/__init__.py

Summary

Maintainability
F
5 days
Test Coverage

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

# coding: utf-8
# pylint: disable=too-many-lines

import inspect
import sys
Severity: Major
Found in owlmixin/__init__.py - About 2 days to fix

    Function traverse has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

    def traverse(
        type_, name, value, cls, force_snake_case: bool, force_cast: bool, restrict: bool
    ) -> Any:
        # pylint: disable=too-many-return-statements,too-many-branches,too-many-arguments
        if isinstance(type_, str):
    Severity: Minor
    Found in owlmixin/__init__.py - About 4 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

    OwlMixin has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class OwlMixin(DictTransformer, JsonTransformer, YamlTransformer, metaclass=OwlMeta):
        @classmethod
        def from_dict(
            cls,
            d: dict,
    Severity: Minor
    Found in owlmixin/__init__.py - About 2 hrs to fix

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

      def traverse(
      Severity: Major
      Found in owlmixin/__init__.py - About 50 mins to fix

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

            def from_csvf_to_iterator(
        Severity: Minor
        Found in owlmixin/__init__.py - About 45 mins to fix

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

              def from_yamlf_to_list(
          Severity: Minor
          Found in owlmixin/__init__.py - About 45 mins to fix

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

                def from_yamlf_to_iterator(
            Severity: Minor
            Found in owlmixin/__init__.py - About 45 mins to fix

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

                  def from_csvf_to_list(
              Severity: Minor
              Found in owlmixin/__init__.py - About 45 mins to fix

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

                    def from_yamlf(
                Severity: Minor
                Found in owlmixin/__init__.py - About 45 mins to fix

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

                      def from_jsonf_to_list(
                  Severity: Minor
                  Found in owlmixin/__init__.py - About 45 mins to fix

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

                        def from_jsonf(
                    Severity: Minor
                    Found in owlmixin/__init__.py - About 45 mins to fix

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

                          def from_jsonf_to_iterator(
                      Severity: Minor
                      Found in owlmixin/__init__.py - About 45 mins to fix

                        Function from_yaml_to_list has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def from_yaml_to_list(
                        Severity: Minor
                        Found in owlmixin/__init__.py - About 35 mins to fix

                          Function from_iterable_dicts has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def from_iterable_dicts(
                          Severity: Minor
                          Found in owlmixin/__init__.py - About 35 mins to fix

                            Function from_dicts_by_key has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def from_dicts_by_key(
                            Severity: Minor
                            Found in owlmixin/__init__.py - About 35 mins to fix

                              Function from_optional_dicts_by_key has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def from_optional_dicts_by_key(
                              Severity: Minor
                              Found in owlmixin/__init__.py - About 35 mins to fix

                                Function from_json_to_iterator has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def from_json_to_iterator(
                                Severity: Minor
                                Found in owlmixin/__init__.py - About 35 mins to fix

                                  Function from_json has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def from_json(
                                  Severity: Minor
                                  Found in owlmixin/__init__.py - About 35 mins to fix

                                    Function from_optional_dicts has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def from_optional_dicts(
                                    Severity: Minor
                                    Found in owlmixin/__init__.py - About 35 mins to fix

                                      Function from_json_to_list has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          def from_json_to_list(
                                      Severity: Minor
                                      Found in owlmixin/__init__.py - About 35 mins to fix

                                        Function from_dict has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            def from_dict(
                                        Severity: Minor
                                        Found in owlmixin/__init__.py - About 35 mins to fix

                                          Function from_optional_dict has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                              def from_optional_dict(
                                          Severity: Minor
                                          Found in owlmixin/__init__.py - About 35 mins to fix

                                            Function from_optional_iterable_dicts has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                                def from_optional_iterable_dicts(
                                            Severity: Minor
                                            Found in owlmixin/__init__.py - About 35 mins to fix

                                              Function from_json_url has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                  def from_json_url(
                                              Severity: Minor
                                              Found in owlmixin/__init__.py - About 35 mins to fix

                                                Function from_yaml has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                    def from_yaml(
                                                Severity: Minor
                                                Found in owlmixin/__init__.py - About 35 mins to fix

                                                  Function from_yaml_to_iterator has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                      def from_yaml_to_iterator(
                                                  Severity: Minor
                                                  Found in owlmixin/__init__.py - About 35 mins to fix

                                                    Function from_dicts has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                        def from_dicts(
                                                    Severity: Minor
                                                    Found in owlmixin/__init__.py - About 35 mins to fix

                                                      Function from_dict has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          def from_dict(
                                                              cls,
                                                              d: dict,
                                                              *,
                                                              force_snake_case: bool = True,
                                                      Severity: Minor
                                                      Found in owlmixin/__init__.py - About 35 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

                                                      Avoid too many return statements within this function.
                                                      Open

                                                              return TDict(
                                                      Severity: Major
                                                      Found in owlmixin/__init__.py - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                    return type_.from_value(value)
                                                        Severity: Major
                                                        Found in owlmixin/__init__.py - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                  return TList(
                                                          Severity: Major
                                                          Found in owlmixin/__init__.py - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                    return TOption(None)
                                                            Severity: Major
                                                            Found in owlmixin/__init__.py - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                          return type_(value)
                                                              Severity: Major
                                                              Found in owlmixin/__init__.py - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                        return TIterator(
                                                                Severity: Major
                                                                Found in owlmixin/__init__.py - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                              return TOption(
                                                                  Severity: Major
                                                                  Found in owlmixin/__init__.py - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                            return value
                                                                    Severity: Major
                                                                    Found in owlmixin/__init__.py - About 30 mins to fix

                                                                      There are no issues that match your filters.

                                                                      Category
                                                                      Status