OpenC3/cosmos

View on GitHub

Showing 842 of 1,379 total issues

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

    def initialize
      @name = self.class.to_s.split("::")[-1] # Remove namespacing if present
      @state = 'DISCONNECTED'
      @target_names = []
      @cmd_target_names = []
Severity: Minor
Found in openc3/lib/openc3/interfaces/interface.rb - About 1 hr to fix

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

        def initialize(
          hostname,
          write_dest_port,
          read_port,
          write_src_port = nil,
    Severity: Minor
    Found in openc3/lib/openc3/interfaces/udp_interface.rb - About 1 hr to fix

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

          def initialize(poly, seed, xor, reflect)
            @poly = poly
            @seed = seed
            @xor = xor
            @reflect = reflect
      Severity: Minor
      Found in openc3/lib/openc3/utilities/crc.rb - About 1 hr to fix

        Method next_packet_and_topic has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def next_packet_and_topic
            next_time = nil
            next_reader = nil
            closed_readers = nil
            @open_readers.each do |reader|

          Method files has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def files
              return unless authorization('system')
              root = ENV[params[:root]] # Get the actual bucket / volume name
              raise "Unknown bucket / volume #{params[:root]}" unless root
              results = []
          Severity: Minor
          Found in openc3-cosmos-cmd-tlm-api/app/controllers/storage_controller.rb - About 1 hr to fix

            Method index has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def index
                OpenC3::Logger.debug("request for aggregator metrics")
                begin
                  scopes = OpenC3::ScopeModel.names()
                rescue RuntimeError => e

              Function data has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                data() {
                  return {
                    curValue: null,
                    prevValue: null,
                    grayLevel: 80,

                Function deleteItem has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    deleteItem(item) {
                      let start = null
                      let api = ''
                      switch (item.type.toLowerCase()) {
                        case 'activity':

                  Method _wait_tolerance_process_args has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def _wait_tolerance_process_args(args)
                        case args.length
                        when 4, 5
                          target_name, packet_name, item_name = extract_fields_from_tlm_text(args[0])
                          expected_value = args[1]
                  Severity: Minor
                  Found in openc3/lib/openc3/script/api_shared.rb - About 1 hr to fix

                    Method process_result has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def process_result(results)
                          openc3_lib = Regexp.new(File.join(OpenC3::PATH, 'lib'))
                          # If we were passed an array we concat it to the results global
                          if results.is_a? Array
                            @results.concat(results)
                    Severity: Minor
                    Found in openc3/lib/openc3/script/suite_results.rb - About 1 hr to fix

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

                          def initialize(
                            name:,
                            config_params: [],
                            target_names: [],
                            cmd_target_names: [],
                      Severity: Minor
                      Found in openc3/lib/openc3/models/interface_model.rb - About 1 hr to fix

                        Method handle_sync_pattern has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def handle_sync_pattern
                                if @sync_pattern and @sync_state == :SEARCHING
                                  loop do
                                    # Make sure we have some data to look for a sync word in
                                    return :STOP if @data.length < @sync_pattern.length
                        Severity: Minor
                        Found in openc3/lib/openc3/interfaces/protocols/burst_protocol.rb - About 1 hr to fix

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

                              def connect
                                @cancel_threads = false
                                @read_queue.clear if @read_queue
                                if @write_port == @read_port # One socket
                                  start_listen_thread(@read_port, true, true)
                          Severity: Minor
                          Found in openc3/lib/openc3/interfaces/tcpip_server_interface.rb - About 1 hr to fix

                            Method retrieve has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def retrieve(client = @bucket, uncompress = true)
                                @mutex.synchronize do
                                  local_path = "#{BucketFileCache.instance.cache_dir}/#{File.basename(@bucket_path)}"
                                  unless File.exist?(local_path)
                                    OpenC3::Logger.debug "Retrieving #{@bucket_path} from logs bucket"
                            Severity: Minor
                            Found in openc3/lib/openc3/utilities/bucket_file_cache.rb - About 1 hr to fix

                              Method generate_widget has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def self.generate_widget(args)
                                    if args.length < 2 or args.length > 3
                                      abort("Usage: cli generate #{args[0]} <SuperdataWidget> (--ruby or --python)")
                                    end
                                    # Per https://stackoverflow.com/a/47591707/453280
                              Severity: Minor
                              Found in openc3/lib/openc3/utilities/cli_generator.rb - About 1 hr to fix

                                Method setup_thread_body has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def setup_thread_body
                                    # The goal of this mode is to determine if we are starting with files or from
                                    # realtime
                                    if @start_time
                                      # start_time can be at most 1 minute in the future to prevent
                                Severity: Minor
                                Found in openc3-cosmos-cmd-tlm-api/app/models/messages_thread.rb - About 1 hr to fix

                                  Method add has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def add(data)
                                      # OpenC3::Logger.debug "start:#{Time.at(data["start_time"].to_i/1_000_000_000.0).formatted}" if data["start_time"]
                                      # OpenC3::Logger.debug "end:#{Time.at(data["end_time"].to_i/1_000_000_000.0).formatted}" if data["end_time"]
                                      @mutex.synchronize do
                                        # Preprocess request fields
                                  Severity: Minor
                                  Found in openc3-cosmos-cmd-tlm-api/app/models/streaming_api.rb - About 1 hr to fix

                                    Function __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def __init__(
                                    Severity: Major
                                    Found in openc3/python/openc3/script/web_socket_api.py - About 1 hr to fix

                                      Function define_item has 11 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          def define_item(
                                      Severity: Major
                                      Found in openc3/python/openc3/packets/packet.py - About 1 hr to fix

                                        Function formatted has 11 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                        def formatted(
                                        Severity: Major
                                        Found in openc3/python/openc3/utilities/string.py - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language