markusressel/container-app-conf

View on GitHub

Showing 26 of 26 total issues

Function config_entries_to_dict has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def config_entries_to_dict(config_entries: List[ConfigEntry], hide_secrets: bool = False,
                           use_examples: bool = False) -> {}:
    """
    Converts a list of config entries to a dictionary
    :return: a dictionary containing the expected config tree
Severity: Minor
Found in container_app_conf/util.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 _value_to_type has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def _value_to_type(self, value: any) -> Pattern or None:
        if value is None and self._required:
            return None

        if isinstance(value, Pattern):
Severity: Minor
Found in container_app_conf/entry/regex.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 __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, item_type: Type[ConfigEntry], key_path: [str], example: any = None,
Severity: Major
Found in container_app_conf/entry/list.py - About 1 hr to fix

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

        def __init__(self, key_path: [str], example: any = None, description: str or None = None, default: any = None,
                     required: bool = None, secret: bool = None):
            """
            Creates a config entry
            :param key_path: list of strings representing f.ex. the yaml tree path
    Severity: Minor
    Found in container_app_conf/entry/__init__.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 _find_config_file has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def _find_config_file(self) -> str or None:
            """
            Tries to find a usable config file
            :return: file path or None
            """
    Severity: Minor
    Found in container_app_conf/source/__init__.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 __init__ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, file_name: str or List[str],
                     path: str or List[str] = None,
                     file_extension: str or List[str] = None,
                     ignore_case_in_keys: bool = False):
            """
    Severity: Minor
    Found in container_app_conf/source/__init__.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 __new__ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def __new__(cls, data_sources: List[DataSource] = None,
                    validate: bool = True,
                    singleton: bool = True):
            """
            Creates a config object and reads configuration.
    Severity: Minor
    Found in container_app_conf/__init__.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 _convert_keys_to_lower has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def _convert_keys_to_lower(self, dictionary: dict) -> dict:
            """
            Recursively converts all dictionary keys to lowercase.
            This is used for case insensitive key search.
            :param dictionary: the dictionary to convert
    Severity: Minor
    Found in container_app_conf/source/__init__.py - About 55 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 _parse_value has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def _parse_value(self, value: any) -> any or None:
            """
            Tries to permissively convert the given value to the expected value type.
            :param value: the value to parse
            :return: the parsed value
    Severity: Minor
    Found in container_app_conf/entry/__init__.py - About 55 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 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, key_path: [str], example: any = None, description: str or None = None, default: any = None,
    Severity: Major
    Found in container_app_conf/entry/file.py - About 50 mins to fix

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

          def __init__(self, key_path: [str], example: any = None, description: str or None = None, default: any = None,
      Severity: Major
      Found in container_app_conf/entry/file.py - About 50 mins to fix

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

            def __init__(self, key_path: [str], example: any = None, description: str or None = None, default: any = None,
        Severity: Major
        Found in container_app_conf/entry/dict.py - About 50 mins to fix

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

              def __init__(self, key_path: [str], example: any = None, description: str or None = None, default: any = None,
          Severity: Major
          Found in container_app_conf/entry/regex.py - About 50 mins to fix

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

                def __init__(self, key_path: [str], example: any = None, description: str or None = None, default: any = None,
            Severity: Major
            Found in container_app_conf/entry/string.py - About 50 mins to fix

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

                  def __init__(self, key_path: [str], example: any = None, description: str or None = None, default: any = None,
              Severity: Major
              Found in container_app_conf/entry/int.py - About 50 mins to fix

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

                    def __init__(self, key_path: [str], example: any = None, description: str or None = None, default: any = None,
                Severity: Major
                Found in container_app_conf/entry/float.py - About 50 mins to fix

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

                  def find_duplicates(l: list) -> []:
                      """
                      Finds duplicate entries in the given list
                      :param l: the list to check
                      :return: map of (value -> list of indexes)
                  Severity: Minor
                  Found in container_app_conf/util.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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(self, key_path: [str], example: any = None, description: str or None = None, default: any = None,
                  Severity: Minor
                  Found in container_app_conf/entry/__init__.py - About 45 mins to fix

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

                        def load_config(self, validate: bool):
                            """
                            Loads the configuration from all available sources
                            """
                            for source in reversed(self.data_sources):
                    Severity: Minor
                    Found in container_app_conf/__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

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

                        def _value_to_type(self, value: any) -> bool or None:
                            """
                            Tries to permissively convert the given value to a boolean.
                            :param value: the value to parse
                            :return: the parsed boolean value
                    Severity: Minor
                    Found in container_app_conf/entry/bool.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

                    Severity
                    Category
                    Status
                    Source
                    Language