Showing 231 of 1,039 total issues
Function compare_platforms
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def compare_platforms(self, old_rule, new_rule, old_benchmark, new_benchmark, identifier):
Function fill_queue
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def fill_queue(benchmarks, benchmark_profile_pairs, input_path, path_base,
Function generate_diff_text
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_diff_text(self, old_r, new_r,
Function add_cpe_item_to_dictionary
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_cpe_item_to_dictionary(
Function print_stats
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def print_stats(status_count, control_list, rules_count, vars_count, args):
Function _process_controls_manager
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _process_controls_manager(controls_manager, env_yaml, product_yaml, profile, rule_dirs):
Function create_playbook
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_playbook(self, snippet_path, rule_id, variables,
Function compare_ovals
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def compare_ovals(self, old_oval_def_doc, old_oval_def_id,
Function _walk_rule
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _walk_rule(args, rule_obj, oval_func, remediation_func, verbose_output):
Function walk_rules_diff
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def walk_rules_diff(args, left_rules, right_rules, oval_func, remediation_func):
Function rewrite_section_value
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def rewrite_section_value(file_contents, yaml_contents, section, keys, transform):
Function handle_rule_yaml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handle_rule_yaml(args, rule_id, rule_dir, guide_dir, env_yaml):
Function _add_cce
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _add_cce(directory, cce_pool, rules, product_yaml, args):
Function handle_rule_yaml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handle_rule_yaml(product_list, product_yamls, rule_id, rule_dir, guide_dir):
Function _check_rule
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _check_rule(self, rule, scenarios, remote_dir, state, remediation_available):
Function find_fix_in_benchmark
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_fix_in_benchmark(datastream, benchmark_id, rule_id, fix_type='bash', logging=None):
Function choose_variable_value
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
def choose_variable_value(self, var_id, variables, refinements):
"""
Determine value of variable based on profile refinements.
"""
if refinements and var_id in refinements:
- 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_affected
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
def parse_affected(oval_contents):
"""
Returns the tuple (start_affected, end_affected, platform_indents) for the passed OVAL file contents.
Args:
- 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 split_remediation_content_and_metadata
has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring. Open
def split_remediation_content_and_metadata(fix_file):
remediation_contents = []
config = defaultdict(lambda: None)
# Assignment automatically escapes shell characters for XML
- 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 9 (exceeds 7 allowed). Consider refactoring. Open
def __init__(self, filepath, product=""):
self.tree = None
try:
with open(filepath, 'r') as xccdf_file:
file_string = xccdf_file.read()
- 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"