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
- 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 _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):
- 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 __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, item_type: Type[ConfigEntry], key_path: [str], example: any = None,
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
- 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 _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
"""
- 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 __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):
"""
- 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 __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.
- 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 _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
- 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 _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
- 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 __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,
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,
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,
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,
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,
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,
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,
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)
- 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 __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,
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):
- 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 _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
- 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"