Showing 67 of 84 total issues
Function process
has a Cognitive Complexity of 12 (exceeds 6 allowed). Consider refactoring. Open
def process(path_glob, variant, out, average):
"""Process single variant"""
safe_variant = variant.replace('-', '')
out.write(CHART1 % (variant, variant, safe_variant, variant, safe_variant,
safe_variant))
- 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, host, name, distro, base_image, smp, mem,
Function get_merged_name
has a Cognitive Complexity of 11 (exceeds 6 allowed). Consider refactoring. Open
def get_merged_name(self, merge):
"""
Report full test name but replace parts specified in "merge" wiht '*'
"""
if not merge:
- 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 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, log, tolerance, stddev_tolerance, models,
Function write_file
has a Cognitive Complexity of 10 (exceeds 6 allowed). Consider refactoring. Open
def write_file(path, content, mode='w'):
"""
Write content to path, create the necessary upper dirs
"""
if not os.path.exists(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 ssh_copy_id
has a Cognitive Complexity of 10 (exceeds 6 allowed). Consider refactoring. Open
def ssh_copy_id(log, addr, passwords, hop=None):
"""
Use "ssh-copy-id" to copy ssh id, try passwords if asked for.
"""
session = 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 add_bad
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_bad(self, suffix, name, details, difference, weight, src=None):
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, parent_log, name, addr, distro, args, hop=None):
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, log, mean_tolerance, stddev_tolerance, models,
Function for_each_host_retry
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def for_each_host_retry(self, attempts, hosts, method, args=tuple(),
Function check_result
has a Cognitive Complexity of 9 (exceeds 6 allowed). Consider refactoring. Open
def check_result(self, test_name, src, dst):
model = self.model.get(test_name)
if model is None:
return []
equation = model["equation"]
- 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 _image_up_to_date
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _image_up_to_date(self, session, pubkey, image, setup_script,
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, distro, arch, pub_key, base_path, session,
Function add
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add(self, suffix, name, difference, weight, src=None):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, host, workers, base_output_path, metadata, extra):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, host, workers, base_output_path, metadata, extra):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, host, workers, base_output_path, metadata, extra):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, host, workers, base_output_path, metadata, extra):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, host, workers, base_output_path, metadata, extra):
Function wait_for
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def wait_for(func, timeout, step=1.0, args=None, kwargs=None):