OpenC3/cosmos

View on GitHub

Showing 842 of 1,379 total issues

Method xtce_process_element has 267 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def xtce_process_element(element)
      if XTCE_IGNORED_ELEMENTS.include?(element.name)
        return false
      end

Severity: Major
Found in openc3/lib/openc3/packets/parsers/xtce_parser.rb - About 1 day to fix

    Method run has 216 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def run
          InterfaceTopic.receive_commands(@interface, scope: @scope) do |topic, msg_id, msg_hash, _redis|
            OpenC3.with_context(msg_hash) do
              release_critical = false
              msgid_seconds_from_epoch = msg_id.split('-')[0].to_i / 1000.0
    Severity: Major
    Found in openc3/lib/openc3/microservices/interface_microservice.rb - About 1 day to fix

      Method write has 163 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def self.write(value, bit_offset, bit_size, data_type, buffer, endianness, overflow)
              given_bit_offset = bit_offset
              given_bit_size = bit_size
      
              bit_offset = check_bit_offset_and_size(:write, given_bit_offset, given_bit_size, data_type, buffer)
      Severity: Major
      Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 6 hrs to fix

        Method write_array has 152 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def self.write_array(values, bit_offset, bit_size, data_type, array_size, buffer, endianness, overflow)
              # Save given values of bit offset, bit size, and array_size
              given_bit_offset = bit_offset
              given_bit_size = bit_size
              given_array_size = array_size
        Severity: Major
        Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 6 hrs to fix

          Method process_current_packet has 142 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def process_current_packet(parser, keyword, params)
                case keyword
          
                # Select or delete an item in the current packet
                when 'SELECT_PARAMETER', 'SELECT_ITEM', 'DELETE_PARAMETER', 'DELETE_ITEM'
          Severity: Major
          Found in openc3/lib/openc3/packets/packet_config.rb - About 5 hrs to fix

            Method read has 140 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def read(count_100hz, time)
                  pending_packets = get_pending_packets(count_100hz)
            
                  pending_packets.each do |packet|
                    case packet.packet_name

              Method process_current_item has 135 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def process_current_item(parser, keyword, params)
                    case keyword
              
                    # Add a state to the current telemety item
                    when 'STATE'
              Severity: Major
              Found in openc3/lib/openc3/packets/packet_config.rb - About 5 hrs to fix

                Function diff_cleanupMerge has 133 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                diff_match_patch.prototype.diff_cleanupMerge = function (diffs) {
                  // Add a dummy entry at the end.
                  diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ''))
                  var pointer = 0
                  var count_delete = 0

                  Method read has 133 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        def self.read(bit_offset, bit_size, data_type, buffer, endianness)
                          given_bit_offset = bit_offset
                          given_bit_size = bit_size
                  
                          bit_offset = check_bit_offset_and_size(:read, given_bit_offset, given_bit_size, data_type, buffer)
                  Severity: Major
                  Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 5 hrs to fix

                    Method read_array has 125 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def self.read_array(bit_offset, bit_size, data_type, array_size, buffer, endianness)
                          # Save given values of bit offset, bit size, and array_size
                          given_bit_offset = bit_offset
                          given_bit_size = bit_size
                          given_array_size = array_size
                    Severity: Major
                    Found in openc3/lib/openc3/accessors/binary_accessor.rb - About 5 hrs to fix

                      Function AceDiff has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function AceDiff(options = {}) {
                        // Ensure instance is a constructor with `new`
                        if (!(this instanceof AceDiff)) {
                          return new AceDiff(options)
                        }

                        Method install_phase2 has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def self.install_phase2(plugin_hash, scope:, gem_file_path: nil, validate_only: false)
                              # Register plugin to aid in uninstall if install fails
                              plugin_hash.delete("existing_plugin_txt_lines")
                              plugin_model = PluginModel.new(**(plugin_hash.transform_keys(&:to_sym)), scope: scope)
                              plugin_model.create unless validate_only
                        Severity: Major
                        Found in openc3/lib/openc3/models/plugin_model.rb - About 4 hrs to fix

                          Method handle_config has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def handle_config(parser, keyword, parameters)
                                case keyword
                                when 'CMD_BUFFER_DEPTH'
                                  parser.verify_num_parameters(1, 1, "#{keyword} <Number of commands to buffer to ensure logged in order>")
                                  @cmd_buffer_depth = parameters[0].to_i
                          Severity: Major
                          Found in openc3/lib/openc3/models/target_model.rb - About 4 hrs to fix

                            Function diff_cleanupSemantic has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            diff_match_patch.prototype.diff_cleanupSemantic = function (diffs) {
                              var changes = false
                              var equalities = [] // Stack of indices where equalities are found.
                              var equalitiesLength = 0 // Keeping our own length var is faster in JS.
                              /** @type {?string} */

                              Method read has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def read(identify_and_define = true)
                                    # Read entry length
                                    length = @file.read(4)
                                    return nil if !length or length.length <= 0
                              
                              
                              Severity: Major
                              Found in openc3/lib/openc3/logs/packet_log_reader.rb - About 4 hrs to fix

                                Method write_entry has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    def write_entry(entry_type, cmd_or_tlm, target_name, packet_name, time_nsec_since_epoch, stored, data, id, received_time_nsec_since_epoch: nil, extra: nil)
                                      raise ArgumentError.new("Length of id must be 64, got #{id.length}") if id and id.length != 64 # 64 hex digits, gets packed to 32 bytes with .pack('H*')
                                
                                      length = OPENC3_PRIMARY_FIXED_SIZE
                                      flags = 0
                                Severity: Major
                                Found in openc3/lib/openc3/logs/packet_log_writer.rb - About 4 hrs to fix

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

                                      def initialize(target_name)
                                        super(target_name)
                                  
                                        @target = System.targets[target_name]
                                        position_filename = File.join(@target.dir, 'data', 'position.bin')

                                    Function patch_make has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    diff_match_patch.prototype.patch_make = function (a, opt_b, opt_c) {
                                      var text1, diffs
                                      if (
                                        typeof a == 'string' &&
                                        typeof opt_b == 'string' &&

                                      Function diff_bisect_ has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      diff_match_patch.prototype.diff_bisect_ = function (text1, text2, deadline) {
                                        // Cache the text lengths to prevent multiple calls.
                                        var text1_length = text1.length
                                        var text2_length = text2.length
                                        var max_d = Math.ceil((text1_length + text2_length) / 2)

                                        Method process_file has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            def process_file(filename, existing_variables = {})
                                              current_interface_or_router = nil
                                              current_type = nil
                                              current_interface_log_added = false
                                        
                                        
                                        Severity: Major
                                        Found in openc3/lib/openc3/bridge/bridge_config.rb - About 3 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language