OpenC3/cosmos

View on GitHub
openc3-cosmos-script-runner-api/scripts/running_script.py

Summary

Maintainability
B
6 hrs
Test Coverage

Function __init__ has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def __init__(self, id, scope, name, disconnect):
        RunningScript.instance = self
        RunningScript.id = id
        self.scope = scope
        self.name = name
Severity: Minor
Found in openc3-cosmos-script-runner-api/scripts/running_script.py - About 1 hr to fix

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

        def run_thread_body(
    Severity: Major
    Found in openc3-cosmos-script-runner-api/scripts/running_script.py - About 50 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if input == "REJECTED":
                              raise RuntimeError("Critical Cmd Rejected")
                          return input
      Severity: Major
      Found in openc3-cosmos-script-runner-api/scripts/running_script.py - About 45 mins to fix

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

            def handle_exception(
        Severity: Minor
        Found in openc3-cosmos-script-runner-api/scripts/running_script.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if method == "open_file_dialog":  # Simply return the only file
                                  files = files[0]
                              return files
          Severity: Major
          Found in openc3-cosmos-script-runner-api/scripts/running_script.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                for theFilename in input:
                                    file = _get_storage_file(
                                        f"tmp/{theFilename}", scope=RunningScript.instance.scope
                                    )
            
            
            Severity: Major
            Found in openc3-cosmos-script-runner-api/scripts/running_script.py - About 45 mins to fix

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

                  def run_text(
              Severity: Minor
              Found in openc3-cosmos-script-runner-api/scripts/running_script.py - About 35 mins to fix

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

                def display_screen(target_name, screen_name, x=None, y=None, scope=OPENC3_SCOPE):
                Severity: Minor
                Found in openc3-cosmos-script-runner-api/scripts/running_script.py - About 35 mins to fix

                  There are no issues that match your filters.

                  Category
                  Status