OpenC3/cosmos

View on GitHub

Showing 842 of 1,379 total issues

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

    Avoid deeply nested control flow statements.
    Open

                  if type == 'reject_subscription'
                    raise "Subscription Rejected"
                  end
    Severity: Major
    Found in openc3/lib/openc3/script/web_socket_api.rb - About 45 mins to fix

      Method raise_critical_cmd_error has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def self.raise_critical_cmd_error(msg_hash, username, target_name, cmd_name, cmd_params, cmd_string)
      Severity: Minor
      Found in openc3/lib/openc3/topics/command_topic.rb - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                          if @interface_or_router == 'INTERFACE'
                            @metric.set(name: 'interface_tlm_total', value: @count, type: 'counter')
                          else
                            @metric.set(name: 'router_cmd_total', value: @count, type: 'counter')
                          end
        Severity: Major
        Found in openc3/lib/openc3/microservices/interface_microservice.rb - About 45 mins to fix

          Method set_comm_timeouts has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def self.set_comm_timeouts(handle, read_interval_timeout = 4294967295, read_total_timeout_multiplier = 0, read_total_timeout_constant = 0, write_total_timeout_multiplier = 0, write_total_timeout_constant = 0)
          Severity: Minor
          Found in openc3/lib/openc3/win32/win32.rb - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                              break if @cancel_thread
            Severity: Major
            Found in openc3/lib/openc3/microservices/interface_microservice.rb - About 45 mins to fix

              Method write_all_entries has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def write_all_entries(reducer_state, plw, type, target_name, stored, throttle = nil)
              Severity: Minor
              Found in openc3/lib/openc3/microservices/reducer_microservice.rb - About 45 mins to fix

                Method write_entry has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def write_entry(state, plw, type, target_name, packet_name, stored)
                Severity: Minor
                Found in openc3/lib/openc3/microservices/reducer_microservice.rb - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                if value > green_low
                                  limits_state = :BLUE
                                else
                                  limits_state = :GREEN_LOW
                                end
                  Severity: Major
                  Found in openc3/lib/openc3/packets/packet.rb - About 45 mins to fix

                    Method _log_cmd has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def _log_cmd(target_name, cmd_name, cmd_params, raw, no_range, no_hazardous)
                    Severity: Minor
                    Found in openc3/lib/openc3/script/commands.rb - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                    if timeout
                                      end_time = Time.now
                                      if (start_time - end_time) > timeout
                                        raise Timeout::Error, "No Data Timeout"
                                      end
                      Severity: Major
                      Found in openc3/lib/openc3/script/web_socket_api.rb - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                      if defined? RunningScript and RunningScript.instance
                                        raise StopScript if RunningScript.instance.stop?
                                      end
                        Severity: Major
                        Found in openc3/lib/openc3/script/web_socket_api.rb - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                        raise ArgumentError, "#{@name}: minimum must be a Float but is a #{@range.first.class}" unless Float === @range.first or Integer === @range.first
                          Severity: Major
                          Found in openc3/lib/openc3/packets/packet_item.rb - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                            if sync_index != 0
                                              log_discard(sync_index, true)
                                              # Delete Data Before Sync Pattern
                                              @data.replace(@data[sync_index..-1])
                                            end
                            Severity: Major
                            Found in openc3/lib/openc3/interfaces/protocols/burst_protocol.rb - About 45 mins to fix

                              Method initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def initialize(write_port,
                                                 read_port,
                                                 write_timeout,
                                                 read_timeout,
                                                 protocol_type = nil,
                              Severity: Minor
                              Found in openc3/lib/openc3/interfaces/tcpip_server_interface.rb - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                              if not other.variable_bit_size
                                                return -1
                                              end
                                Severity: Major
                                Found in openc3/lib/openc3/packets/structure_item.rb - About 45 mins to fix

                                  Method deploy_decom_microservice has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def deploy_decom_microservice(target, gem_path, variables, topics, instance = nil, parent = nil)
                                  Severity: Minor
                                  Found in openc3/lib/openc3/models/target_model.rb - About 45 mins to fix

                                    Method append_item has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def append_item(name, bit_size, data_type, array_size = nil, endianness = @default_endianness, overflow = :ERROR)
                                    Severity: Minor
                                    Found in openc3/lib/openc3/packets/structure.rb - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                  if type.initialValue.upcase.start_with?("0X")
                                                    item.default = type.initialValue.hex_to_byte_string
                                                  else
                                                    # Strip quotes from strings
                                                    if type.initialValue[0] == '"' && type.initialValue[-1] == '"'
                                      Severity: Major
                                      Found in openc3/lib/openc3/packets/parsers/xtce_parser.rb - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                    elsif other.variable_bit_size
                                                      return 1
                                        Severity: Major
                                        Found in openc3/lib/openc3/packets/structure_item.rb - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language