kalefranz/auxlib

View on GitHub

Showing 193 of 242 total issues

Avoid too many return statements within this function.
Open

                return self._type(val)
Severity: Major
Found in auxlib/entity.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

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

      Avoid too many return statements within this function.
      Open

              return JSONEncoder.default(self, obj)
      Severity: Major
      Found in auxlib/entity.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return instance
        Severity: Major
        Found in auxlib/factory.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

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

            Avoid too many return statements within this function.
            Open

                        return boolify(value, return_string=True)
            Severity: Major
            Found in auxlib/type_coercion.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return text_type(value)
              Severity: Major
              Found in auxlib/type_coercion.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return boolify(value) if type_hint == bool else type_hint(value)
                Severity: Major
                Found in auxlib/type_coercion.py - About 30 mins to fix

                  Function __getitem__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def __getitem__(self, key):
                          key = key.lower()
                          if key in self._registered_env_keys:
                              from_env = os.getenv(make_env_key(self.appname, key))
                              from_sources = self._config_map.get(key)
                  Severity: Minor
                  Found in auxlib/configuration.py - About 25 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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def validate(self, instance, val):
                          """
                  
                          Returns:
                              True: if val is valid
                  Severity: Minor
                  Found in auxlib/entity.py - About 25 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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def __init__(cls, name, bases, attr):
                          super(FactoryType, cls).__init__(name, bases, attr)
                          if 'skip_registration' in cls.__dict__ and cls.skip_registration:
                              pass  # we don't even care  # pragma: no cover
                          elif cls.factory is None:
                  Severity: Minor
                  Found in auxlib/factory.py - About 25 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 attach_stderr has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def attach_stderr(level=INFO):
                      has_stderr_handler = any(handler.name == 'stderr' for handler in root_log.handlers)
                      if not has_stderr_handler:
                          handler = StreamHandler(stderr)
                          handler.name = 'stderr'
                  Severity: Minor
                  Found in auxlib/logz.py - About 25 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 _git_describe_tags has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _git_describe_tags(path):
                      try:
                          call("git update-index --refresh", path, raise_on_error=False)
                      except CalledProcessError as e:
                          # git is probably not installed
                  Severity: Minor
                  Found in auxlib/packaging.py - About 25 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

                  Severity
                  Category
                  Status
                  Source
                  Language