tobi-wan-kenobi/bumblebee-status

View on GitHub

Showing 134 of 263 total issues

Function combined has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def combined(self):
        for device in self.devices:
            if self.display == "combined_singles" and device not in self.drives:
                    continue
            result = self.smart(device)
Severity: Minor
Found in bumblebee_status/modules/contrib/smartstatus.py - About 35 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

Avoid too many return statements within this function.
Open

            return False
Severity: Major
Found in bumblebee_status/modules/contrib/sensors.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return "unknown"
Severity: Major
Found in bumblebee_status/modules/contrib/sensors.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return self._status
Severity: Major
Found in bumblebee_status/modules/contrib/mpd.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return is_psl(module)
Severity: Major
Found in generate-base-tests.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return "Fully charged"
Severity: Major
Found in bumblebee_status/modules/contrib/battery-upower.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                return ["clouds"]
Severity: Major
Found in bumblebee_status/modules/contrib/weather.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return "update"
Severity: Major
Found in bumblebee_status/core/input.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return "n/a"
Severity: Major
Found in bumblebee_status/core/input.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return state
Severity: Major
Found in bumblebee_status/modules/contrib/zpool.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                return ["clear"]
Severity: Major
Found in bumblebee_status/modules/contrib/weather.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return []
Severity: Major
Found in bumblebee_status/modules/contrib/weather.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return "Pending charge"
Severity: Major
Found in bumblebee_status/modules/contrib/battery-upower.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return "wheel-down"
Severity: Major
Found in bumblebee_status/core/input.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                return ["sleet"]
Severity: Major
Found in bumblebee_status/modules/contrib/weather.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

                return int(float(match[self._match_number]))
Severity: Major
Found in bumblebee_status/modules/contrib/sensors.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return 4
Severity: Major
Found in bumblebee_status/util/graph.py - About 30 mins to fix

Avoid too many return statements within this function.
Open

            return "Pending discharge"
Severity: Major
Found in bumblebee_status/modules/contrib/battery-upower.py - About 30 mins to fix

Function __get_tool_temperatures has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def __get_tool_temperatures(self):
        tool_temperatures = []

        printer_info, status_code = self.__get("printer")
        if status_code == 200:
Severity: Minor
Found in bumblebee_status/modules/contrib/octoprint.py - About 25 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 update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def update(self):
        widget = self.widget()
        try:
            widget.set("rtt-unreachable", False)
            res = util.cli.execute(
Severity: Minor
Found in bumblebee_status/modules/core/ping.py - About 25 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

Severity
Category
Status
Source
Language