Showing 44 of 46 total issues
Function get_installed_software
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_installed_software() -> list:
"""
Returns installed windows software found in registry
:return: (list) List of dictionnaries containing name, version and publisher of software
- 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 delete_sub_key
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def delete_sub_key(root_key: int, current_key: str, arch: int = 0) -> None:
"""
:param root_key: winreg registry root key constant
:param current_key:
- 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_acls
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_acls(
Function get_keys
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_keys(
Avoid deeply nested control flow statements. Open
if ver in click_and_run_ident:
return ver
return "2016/2019/O365"
Avoid deeply nested control flow statements. Open
if re.search(virt_product, product_id[key][sub_key], re.IGNORECASE):
# Thanks Microsoft, fuzzy detection
if virt_product == "VRTUAL":
virt_product = "Hyper-V"
return True, virt_product
Function get_values
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_values(
Function get_paths_recursive_and_fix_permissions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_paths_recursive_and_fix_permissions(
Function get_value
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_value(
Function _get_keys
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_keys(
Function get_local_group_members
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_local_group_members(
server: str = "\\\\" + win32api.GetComputerName(), group_sid: str = None
) -> list:
"""
Returns members of local given local group SID
- 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_paths_recursive_and_fix_permissions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_paths_recursive_and_fix_permissions(
path: str,
owner: object = None,
permissions: int = None,
user_list: Union[List[str], List[object]] = 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 get_logical_disks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_logical_disks(
include_fs: list = None,
exclude_unknown_fs: bool = False,
include_network_drives: bool = 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"
Further reading
Function is_rds_server
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def is_rds_server():
"""
Check if current machine has terminal services in RDS or single user mode
We'll first check Win32_OperatingSystem()[0].OSProductSuite
- 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 None
Avoid too many return
statements within this function. Open
return "OEM_COA_SLP"
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return "UNKNOWN"
Avoid too many return
statements within this function. Open
return "VOLUME"
Avoid too many return
statements within this function. Open
return "OEM"