netinvent/windows_tools

View on GitHub
windows_tools/updates/__init__.py

Summary

Maintainability
C
1 day
Test Coverage

Function get_windows_updates has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

def get_windows_updates(
    filter_duplicates: bool = True, include_all_states: bool = False
):
    """
    Let's get windows updates from multiple sources
Severity: Minor
Found in windows_tools/updates/__init__.py - About 3 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_windows_updates_reg has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

def get_windows_updates_reg(
    reg_key: str = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages",
    filter_duplicates: bool = True,
    include_all_states: bool = False,
):
Severity: Minor
Found in windows_tools/updates/__init__.py - About 2 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_windows_updates_com has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

def get_windows_updates_com(
    update_path: str = "Microsoft.Update.Session",
    filter_duplicates: bool = False,
    include_all_states: bool = False,
):
Severity: Minor
Found in windows_tools/updates/__init__.py - About 2 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

There are no issues that match your filters.

Category
Status