Showing 33 of 38 total issues
Avoid deeply nested control flow statements. Open
if not isinstance(items, list):
if not ignore_errors:
raise KeyError("Invalid '{}' selector: '{}' is not a list, is: {}"
.format(xpath, key, type(items)))
return default
Function set_node_by_xpath
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_node_by_xpath(mapping, xpath, value, extend=False, setter_attr=None):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, l=None, s=None, h=None, r=False, d=_UNDEFINED):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, fmt=None, datefmt=None, term_width=-1, split=True, log_colors=None):
Function get_node_by_xpath
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_node_by_xpath(mapping, xpath, default=None, ignore_errors=False,
Function _load_cfg_dict
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _load_cfg_dict(self, cfg, xpath=None):
for k, v in cfg.items():
xp = self.mkxpath(xpath, k)
if isinstance(v, dict):
self._load_cfg_dict(v, xp)
- 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
Avoid too many return
statements within this function. Open
return default
Avoid too many return
statements within this function. Open
return default
Avoid too many return
statements within this function. Open
return mapping
Function delete_node_by_xpath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def delete_node_by_xpath(mapping, xpath, ignore_errors=False):
'''Delete the node pointed to by xpath from mapping.
Args:
mapping: nested dictionary.
- 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 _load_cmd_line_arg
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _load_cmd_line_arg(self):
"""
Inject parameters provider by the user in the command line.
"""
argv = sys.argv[1:]
- 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 refresh_from_cfg
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def refresh_from_cfg(self):
"""
Refresh derived values from cfg.
"""
cfg = DopplerrConfig()
- 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 appy_path_mapping
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def appy_path_mapping(self, folder):
if not DopplerrConfig().get_cfg_value("general.mapping"):
return folder
if folder.startswith("/"):
absolute = True
- 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"