netinvent/windows_tools

View on GitHub
windows_tools/registry/__init__.py

Summary

Maintainability
D
1 day
Test Coverage

Function get_keys has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

def get_keys(
    hive: int,
    key: str,
    arch: int = 0,
    recursion_level: int = 1,
Severity: Minor
Found in windows_tools/registry/__init__.py - About 5 hrs to fix

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_values has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

def get_values(
    hive: int,
    key: str,
    names: List[str],
    arch: int = 0,
Severity: Minor
Found in windows_tools/registry/__init__.py - About 4 hrs to fix

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_value has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def get_value(
    hive: int,
    key: str,
    value: Optional[str],
    arch: int = 0,
Severity: Minor
Found in windows_tools/registry/__init__.py - About 1 hr to fix

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:
Severity: Minor
Found in windows_tools/registry/__init__.py - About 55 mins to fix

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_keys has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def get_keys(
Severity: Major
Found in windows_tools/registry/__init__.py - About 50 mins to fix

    Function get_values has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def get_values(
    Severity: Minor
    Found in windows_tools/registry/__init__.py - About 45 mins to fix

      Function get_value has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def get_value(
      Severity: Minor
      Found in windows_tools/registry/__init__.py - About 35 mins to fix

        Function _get_keys has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _get_keys(
        Severity: Minor
        Found in windows_tools/registry/__init__.py - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status