Showing 229 of 962 total issues
Function preprocess
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
def preprocess(data, lang):
path = data["path"]
name = ssg.utils.escape_id(os.path.basename(path))
data["name"] = name
if lang == "oval":
- 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 is_virtual_oscap_profile
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
def is_virtual_oscap_profile(profile):
""" Test if the profile belongs to the so called category virtual
from OpenSCAP available profiles. It can be (all) or other id we
might come up in the future, it just needs to be encapsulated
with parenthesis for example "(custom_profile)".
- 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 has_empty_identifier
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
def has_empty_identifier(rule_path, rule, rule_lines):
if 'identifiers' in rule and rule['identifiers'] is None:
return True
if 'identifiers' in rule and rule['identifiers'] is not 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 _audit_rules_unsuccessful_file_modification
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
def _audit_rules_unsuccessful_file_modification(data, lang):
if lang == "bash":
if "syscall_grouping" in data:
# Make it easier to tranform the syscall_grouping into a Bash array
data["syscall_grouping"] = " ".join(data["syscall_grouping"])
- 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 preprocess
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
def preprocess(data, lang):
embedded_data = parse_template_boolean_value(data, parameter="embedded_data", default_value=False)
data["embedded_data"] = embedded_data
- 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 preprocess
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
def preprocess(data, lang):
data["check_root_user"] = parse_template_boolean_value(data, parameter="check_root_user", default_value=False)
if lang == "bash":
if "syscall_grouping" in data:
# Make it easier to tranform the syscall_grouping into a Bash array
- 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 _audit_rules_file_deletion_events
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
def _audit_rules_file_deletion_events(data, lang):
if lang == "bash":
if "syscall_grouping" in data:
# Make it easier to tranform the syscall_grouping into a Bash array
data["syscall_grouping"] = " ".join(data["syscall_grouping"])
- 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 _get_platform_cpes
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
def _get_platform_cpes(platform):
ssg_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
if platform.startswith("multi_platform_"):
try:
products = MULTI_PLATFORM_MAPPING[platform]
- 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 set_variables_for_test_scenarios
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
def set_variables_for_test_scenarios(data):
if data["datatype"] == "int":
if not data.get("value"):
# this implies XCCDF variable is used
data["wrong_value"] = 321
- 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"