OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

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

                    Avoid deeply nested control flow statements.
                    Open

                                if endianness == :LITTLE_ENDIAN
                                  buffer[lower_bound..upper_bound] = temp_array.pack(PACK_8_BIT_UINT_ARRAY).reverse
                                else
                                  buffer[lower_bound..upper_bound] = temp_array.pack(PACK_8_BIT_UINT_ARRAY)
                                end
                    Severity: Major
                    Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                    if endianness == HOST_ENDIANNESS
                                      packed = values.pack(PACK_NATIVE_64_BIT_INT_ARRAY)
                                    else # endianness != HOST_ENDIANNESS
                                      packed = values.pack(PACK_NATIVE_64_BIT_INT_ARRAY)
                                      self.byte_swap_buffer!(packed, 8)
                      Severity: Major
                      Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 45 mins to fix

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

                            def self.read_array(bit_offset, bit_size, data_type, array_size, buffer, endianness)
                        Severity: Minor
                        Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                      if data_type == :INT
                                        ###########################################################
                                        # Handle byte-aligned 8, 16, 32, and 64 bit :INT
                                        ###########################################################
                          
                          
                          Severity: Major
                          Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                          if old_upper_bound < lower_bound
                                            # String was completely empty
                                            if end_bytes > 0
                                              # Preserve bytes at end of buffer
                                              buffer << ("\000" * value.length)
                            Severity: Major
                            Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                            if value.length < byte_size
                                              # Pad the requested size with zeros
                                              temp = value.ljust(byte_size, "\000")
                                            elsif value.length > byte_size
                                              if overflow == :TRUNCATE
                              Severity: Major
                              Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                              if endianness == :BIG_ENDIAN
                                                packed = values.pack(PACK_BIG_ENDIAN_16_BIT_UINT_ARRAY)
                                              else # endianness == :LITTLE_ENDIAN
                                                packed = values.pack(PACK_LITTLE_ENDIAN_16_BIT_UINT_ARRAY)
                                              end
                                Severity: Major
                                Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                if endianness == HOST_ENDIANNESS
                                                  value = buffer[lower_bound..upper_bound].unpack(PACK_NATIVE_16_BIT_INT_ARRAY)
                                                else # endianness != HOST_ENDIANNESS
                                                  temp = self.byte_swap_buffer(buffer[lower_bound..upper_bound], 2)
                                                  value = temp.to_s.unpack(PACK_NATIVE_16_BIT_INT_ARRAY)
                                  Severity: Major
                                  Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                  if endianness == HOST_ENDIANNESS
                                                    value = buffer[lower_bound..upper_bound].unpack(PACK_NATIVE_32_BIT_INT_ARRAY)
                                                  else # endianness != HOST_ENDIANNESS
                                                    temp = self.byte_swap_buffer(buffer[lower_bound..upper_bound], 4)
                                                    value = temp.to_s.unpack(PACK_NATIVE_32_BIT_INT_ARRAY)
                                    Severity: Major
                                    Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                    if endianness == :BIG_ENDIAN
                                                      packed = values.pack(PACK_BIG_ENDIAN_32_BIT_UINT_ARRAY)
                                                    else # endianness == :LITTLE_ENDIAN
                                                      packed = values.pack(PACK_LITTLE_ENDIAN_32_BIT_UINT_ARRAY)
                                                    end
                                      Severity: Major
                                      Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                if id
                                                  id = entry[(packet_name_length + 4)..-1]
                                                  @packet_ids << id
                                                end
                                        Severity: Major
                                        Found in openc3/lib/openc3/logs/packet_log_reader.rb - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language