OpenC3/cosmos

View on GitHub

Showing 842 of 1,379 total issues

Function setHeight has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    setHeight(height, units = 'px', defaultHeight = '20') {
      // Don't set the height if someone has already set it
      let foundSetting = null
      if (this.widgetIndex !== null) {
        foundSetting = this.settings.find(

    Function setWidth has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        setWidth(width, units = 'px', defaultWidth = '120') {
          // Don't set the width if someone has already set it
          // This is important in PacketViewer which uses the value-widget
          // and passes an explicit width setting to use
          let foundSetting = null

      Method update_raw_hour_day_stats has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def update_raw_hour_day_stats(reduced, state)
            # Update statistics for this packet's raw values
            state.raw_max_values.each do |key, value|
              if value
                max_key = "#{key}__X"
      Severity: Minor
      Found in openc3/lib/openc3/microservices/reducer_microservice.rb - About 1 hr to fix

        Method initialize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def initialize(target_name = nil, packet_name = nil, default_endianness = :BIG_ENDIAN, description = nil, buffer = nil, item_class = PacketItem)
                super(default_endianness, buffer, item_class)
                # Explicitly call the defined setter methods
                self.target_name = target_name
                self.packet_name = packet_name
        Severity: Minor
        Found in openc3/lib/openc3/packets/packet.rb - About 1 hr to fix

          Method disconnect has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def disconnect
                @cancel_threads = true
                @read_queue << nil if @read_queue
                @listen_pipes.each do |pipe|
                  pipe.write('.')
          Severity: Minor
          Found in openc3/lib/openc3/interfaces/tcpip_server_interface.rb - About 1 hr to fix

            Method connect has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def connect
                  if @read_port and @write_dest_port and @write_src_port and (@read_port == @write_src_port)
                    @read_socket = UdpReadWriteSocket.new(
                      @read_port,
                      @bind_address,
            Severity: Minor
            Found in openc3/lib/openc3/interfaces/udp_interface.rb - About 1 hr to fix

              Method to_xtce_string has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def to_xtce_string(item, param_or_arg, xml, string_or_binary)
                    # TODO: OpenC3 Variably sized strings are not supported in XTCE
                    attrs = { :name => (item.name + '_Type') }
                    attrs[:characterWidth] = 8 if string_or_binary == 'String'
                    if item.default && !item.array_size
              Severity: Minor
              Found in openc3/lib/openc3/packets/parsers/xtce_converter.rb - About 1 hr to fix

                Method build_target_archive has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def build_target_archive(temp_dir, target_folder)
                      target_files = []
                      Find.find(target_folder) { |file| target_files << file }
                      target_files.sort!
                      @id = OpenC3.hash_files(target_files, nil, 'SHA256').hexdigest
                Severity: Minor
                Found in openc3/lib/openc3/models/target_model.rb - About 1 hr to fix

                  Method process_array_type has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def process_array_type(element, bit_size)
                        array_num_items = 1
                        # Need to determine dimensions
                        xtce_recurse_element(element) do |block_element|
                          if block_element.name == 'Dimension'
                  Severity: Minor
                  Found in openc3/lib/openc3/packets/parsers/xtce_parser.rb - About 1 hr to fix

                    Method normalize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def self.normalize(target_name, packet_name, item_name, type: :ALL, scope: $openc3_scope)
                          hash = Store.hget("#{scope}__override__#{target_name}", packet_name)
                          hash = JSON.parse(hash, :allow_nan => true, :create_additions => true) if hash
                          hash ||= {} # In case the above didn't create anything
                          case type
                    Severity: Minor
                    Found in openc3/lib/openc3/models/cvt_model.rb - About 1 hr to fix

                      Method initialize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def initialize(commands, telemetry, output_dir)
                            FileUtils.mkdir_p(output_dir)
                      
                            # Build target list
                            targets = []
                      Severity: Minor
                      Found in openc3/lib/openc3/packets/parsers/xtce_converter.rb - About 1 hr to fix

                        Method write_data has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def write_data(data, extra = nil)
                              # Intentionally not calling super()
                        
                              need_insert = false
                              result_data = ''
                        Severity: Minor
                        Found in openc3/lib/openc3/interfaces/protocols/cobs_protocol.rb - About 1 hr to fix

                          Method overrides has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def self.overrides(scope: $openc3_scope)
                                overrides = []
                                TargetModel.names(scope: scope).each do |target_name|
                                  all = Store.hgetall("#{scope}__override__#{target_name}")
                                  next if all.nil? or all.empty?
                          Severity: Minor
                          Found in openc3/lib/openc3/models/cvt_model.rb - About 1 hr to fix

                            Method process_ref_entry has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def process_ref_entry(element)
                                  reference_location, bit_offset = xtce_handle_location_in_container_in_bits(element)
                                  object, type, data_type, array_type = get_object_types(element)
                                  bit_size = Integer(type.sizeInBits)
                                  if array_type
                            Severity: Minor
                            Found in openc3/lib/openc3/packets/parsers/xtce_parser.rb - About 1 hr to fix

                              Method convert_to_type has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def self.convert_to_type(value, item)
                                    return value if value.nil?
                                    case item.data_type
                                    when :OBJECT, :ARRAY
                                      # Do nothing for complex object types
                              Severity: Minor
                              Found in openc3/lib/openc3/accessors/accessor.rb - About 1 hr to fix

                                Method create_table has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    def create_table(tables, warnings)
                                      params = @parser.parameters
                                      table_name = params[0].to_s.upcase
                                      endianness = params[1].to_s.upcase.to_sym
                                      if endianness != :BIG_ENDIAN && endianness != :LITTLE_ENDIAN
                                Severity: Minor
                                Found in openc3/lib/openc3/tools/table_manager/table_parser.rb - About 1 hr to fix

                                  Method action has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def action
                                      begin
                                        yield
                                      rescue ArgumentError, TypeError => e
                                        logger.error(e.formatted)
                                  Severity: Minor
                                  Found in openc3-cosmos-cmd-tlm-api/app/controllers/notes_controller.rb - About 1 hr to fix

                                    Function diff_cleanupSplitSurrogates has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    diff_match_patch.prototype.diff_cleanupSplitSurrogates = function (diffs) {
                                      var lastEnd
                                      for (var x = 0; x < diffs.length; x++) {
                                        var thisDiff = diffs[x]
                                        var thisTop = thisDiff[1][0]

                                      Function diff_prettyHtml has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      diff_match_patch.prototype.diff_prettyHtml = function (diffs) {
                                        diffs = this.diff_cleanupSplitSurrogates(diffs)
                                        var html = []
                                        var pattern_amp = /&/g
                                        var pattern_lt = /</g

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

                                            def __init__(
                                                self,
                                                remote_log_directory,
                                                logging_enabled=True,
                                                cycle_time=None,
                                        Severity: Minor
                                        Found in openc3/python/openc3/logs/log_writer.py - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language