AngellusMortis/game_server_manager

View on GitHub

Showing 74 of 74 total issues

Cyclomatic complexity is too high in method _z_unpack. (6)
Open

    def _z_unpack(self, from_path, to_path):
        """
        unpacks .z files downloaded from Steam workshop

        adapted from https://github.com/TheCherry/ark-server-manager/blob/master/src/z_unpack.py
Severity: Minor
Found in gs_manager/servers/specific/ark.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Cyclomatic complexity is too high in method server. (6)
Open

    @property
    def server(self):
        if self._server is None:
            ip = self.config.mc.get("server-ip")
            port = self.config.mc.get("server-port")

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Cyclomatic complexity is too high in function main. (6)
Open

@click.group(
    cls=ConfigCommandClass,
    chain=True,
    invoke_without_command=True,
    add_help_option=False,
Severity: Minor
Found in gs_manager/cli.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Cyclomatic complexity is too high in method _start_servers. (6)
Open

    def _start_servers(self, restart, was_running):
        if not restart:
            return

        if not was_running:
Severity: Minor
Found in gs_manager/servers/generic/steam.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Cyclomatic complexity is too high in method load_config. (6)
Open

    def load_config(self, ignore_unknown: bool = False) -> None:
        if not os.path.isfile(self._file_path):
            raise ValueError("Invalid config path")

        config_dict = {}
Severity: Minor
Found in gs_manager/command/config.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Cyclomatic complexity is too high in method mc. (6)
Open

    @property
    def mc(self) -> Dict[str, str]:
        if self._mc_config is None:
            self._mc_config = {}

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Cyclomatic complexity is too high in class StarboundServerConfig. (6)
Open

class StarboundServerConfig(RconServerConfig):
    app_id: int = 533830
    rcon_port: int = 21026
    spawn_process: bool = True
    start_command: str = "./starbound_server"

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Cyclomatic complexity is too high in method _stop_servers. (6)
Open

    def _stop_servers(self, was_running, reason: Optional[str] = None):
        current_instance = self.config.instance_name
        multi_instance = self.config.multi_instance

        if reason is None:
Severity: Minor
Found in gs_manager/servers/generic/steam.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Function install has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def install(
Severity: Major
Found in gs_manager/servers/generic/steam.py - About 1 hr to fix

    Function main has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def main(
    Severity: Major
    Found in gs_manager/cli.py - About 1 hr to fix

      Function start has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def start(
      Severity: Major
      Found in gs_manager/servers/specific/minecraft.py - About 1 hr to fix

        Function install has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def install(
        Severity: Major
        Found in gs_manager/servers/specific/minecraft.py - About 1 hr to fix

          Function workshop_download has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def workshop_download(
          Severity: Major
          Found in gs_manager/servers/generic/steam.py - About 50 mins to fix

            Function install has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def install(
            Severity: Major
            Found in gs_manager/servers/specific/ark.py - About 50 mins to fix

              Function versions has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def versions(
              Severity: Major
              Found in gs_manager/servers/specific/minecraft.py - About 50 mins to fix

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

                    def restart(
                Severity: Minor
                Found in gs_manager/servers/base.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if last_update_time > last_extract_time:
                                              mods_to_update.append(workshop_item)
                              else:
                  Severity: Major
                  Found in gs_manager/servers/specific/ark.py - About 45 mins to fix

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

                        def stop(
                    Severity: Minor
                    Found in gs_manager/servers/base.py - About 45 mins to fix

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

                          def restore(
                      Severity: Minor
                      Found in gs_manager/servers/base.py - About 45 mins to fix

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

                            def workshop_download(
                        Severity: Minor
                        Found in gs_manager/servers/specific/ark.py - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language