OpenC3/cosmos

View on GitHub

Showing 842 of 1,379 total issues

Method limits_change_callback has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def limits_change_callback(packet, item, old_limits_state, value, log_change)
      return if @cancel_thread
      # Make a copy because packet_time is frozen
      packet_time = packet.packet_time.dup
      if value
Severity: Minor
Found in openc3/lib/openc3/microservices/decom_microservice.rb - About 1 hr to fix

    Method wait has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def wait(*args, type: :CONVERTED, quiet: false, scope: $openc3_scope, token: $openc3_token)
          time_diff = nil
    
          case args.length
          # wait() # indefinitely until they click Go
    Severity: Minor
    Found in openc3/lib/openc3/script/api_shared.rb - About 1 hr to fix

      Method read_packet has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def read_packet(packet)
            if @response_template && @response_packet
              # If lines make it this far they are part of a response
              @response_packets << packet
              return :STOP if @response_packets.length < (@ignore_lines + @response_lines)
      Severity: Minor
      Found in openc3/lib/openc3/interfaces/protocols/template_protocol.rb - About 1 hr to fix

        Method formatted has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def formatted(
            word_size = 1,
            words_per_line = 16,
            word_separator = ' ',
            indent = 0,
        Severity: Minor
        Found in openc3/lib/openc3/core_ext/string.rb - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                                      if (
                                          instance.cycle_time
                                          and (utc_now - instance.start_time).total_seconds() > instance.cycle_time
                                      ):
                                          Logger.debug("Log writer start new file due to cycle time")
          Severity: Critical
          Found in openc3/python/openc3/logs/log_writer.py - About 1 hr to fix

            Method sync_system_thread_body has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def self.sync_system_thread_body(scope:, block_ms: nil)
                  telemetry = System.telemetry.all
                  topics = ["#{scope}__openc3_limits_events"]
                  Topic.read_topics(topics, nil, block_ms) do |_topic, _msg_id, event, _redis|
                    event = JSON.parse(event['event'], :allow_nan => true, :create_additions => true)
            Severity: Minor
            Found in openc3/lib/openc3/topics/limits_event_topic.rb - About 1 hr to fix

              Method <=> has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def <=>(other)
                      return nil unless other.kind_of?(StructureItem)
              
                      other_original_bit_offset = other.original_bit_offset
              
              
              Severity: Minor
              Found in openc3/lib/openc3/packets/structure_item.rb - About 1 hr to fix

                Method linc_interface_command has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def linc_interface_command(packet)
                      if @error_ignore_commands
                        @error_ignore_commands.each do |error_ignore_command|
                          if error_ignore_command.identify?(packet.buffer(false))
                            linc_cmd = error_ignore_command.clone
                Severity: Minor
                Found in openc3/lib/openc3/interfaces/linc_interface.rb - About 1 hr to fix

                  Method ensure_public has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def ensure_public(bucket)
                        unless ENV['OPENC3_NO_BUCKET_POLICY']
                          policy = <<~EOL
                          {
                            "Version": "2012-10-17",
                  Severity: Minor
                  Found in openc3/lib/openc3/utilities/aws_bucket.rb - About 1 hr to fix

                    Function set_limits has 13 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def set_limits(
                    Severity: Major
                    Found in openc3/python/openc3/api/limits_api.py - About 1 hr to fix

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

                          def __init__(
                      Severity: Major
                      Found in openc3/python/openc3/interfaces/protocols/template_protocol.py - About 1 hr to fix

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

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

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

                                write_termination_characters,
                                read_termination_characters,
                                ignore_lines = 0,
                                initial_read_delay = nil,
                                response_lines = 1,
                          Severity: Major
                          Found in openc3/lib/openc3/interfaces/protocols/template_protocol.rb - About 1 hr to fix

                            Method write_interface has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def write_interface(data, extra = nil)
                                  extra ||= {}
                                  queries = extra['HTTP_QUERIES']
                                  queries ||= {}
                                  headers = extra['HTTP_HEADERS']
                            Severity: Minor
                            Found in openc3/lib/openc3/interfaces/http_client_interface.rb - About 1 hr to fix

                              Method write_item_internal has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def self.write_item_internal(item, value, decoded)
                                    return nil if item.data_type == :DERIVED
                              
                                    # Save traversal state
                                    parent_node = nil
                              Severity: Minor
                              Found in openc3/lib/openc3/accessors/json_accessor.rb - About 1 hr to fix

                                Method list_files has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    def list_files(bucket:, path:, only_directories: false, metadata: false)
                                      # Trailing slash is important in AWS S3 when listing files
                                      # See https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/Types/ListObjectsV2Output.html#common_prefixes-instance_method
                                      if path[-1] != '/'
                                        path += '/'
                                Severity: Minor
                                Found in openc3/lib/openc3/utilities/aws_bucket.rb - About 1 hr to fix

                                  Method parse_options has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def parse_options(options)
                                      settings = {}
                                      if options.include?('manual')
                                        settings['Manual'] = true
                                        $manual = true
                                  Severity: Minor
                                  Found in openc3-cosmos-script-runner-api/app/models/running_script.rb - About 1 hr to fix

                                    Function copy has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function copy(acediff, e, dir) {
                                      const diffIndex = parseInt(e.target.getAttribute('data-diff-index'), 10)
                                      const diff = acediff.diffs[diffIndex]
                                      let sourceEditor
                                      let targetEditor

                                      Function diff has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        diff() {
                                          const dmp = new diff_match_patch()
                                          const val1 = this.editors.left.ace.getSession().getValue()
                                          const val2 = this.editors.right.ace.getSession().getValue()
                                          // Main diff method that calculates the diffs

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

                                            def __init__(
                                                self,
                                                write_port,
                                                read_port,
                                                write_timeout,
                                        Severity: Minor
                                        Found in openc3/python/openc3/interfaces/tcpip_server_interface.py - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language