OpenC3/cosmos

View on GitHub

Showing 842 of 1,379 total issues

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

    def connect
      @server = WEBrick::HTTPServer.new(:BindAddress => @listen_address, :Port => @port)
      @request_queue = Queue.new

      # Create a response hook for every command packet
Severity: Major
Found in openc3/lib/openc3/interfaces/http_server_interface.rb - About 2 hrs to fix

    Method start has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def start
          @thread_sleeper = Sleeper.new
          @thread = Thread.new do
            @cancel_thread = false
            begin
    Severity: Major
    Found in openc3/lib/openc3/tools/cmd_tlm_server/interface_thread.rb - About 2 hrs to fix

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

          def initialize(name)
            @mutex = Mutex.new
            super(name)
      
            @interface_or_router = self.class.name.to_s.split("Microservice")[0].upcase.split("::")[-1]
      Severity: Major
      Found in openc3/lib/openc3/microservices/interface_microservice.rb - About 2 hrs to fix

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

            def process_file(filename)
              Logger.instance.info "Processing target definition in file '#{filename}'"
              parser = ConfigParser.new("https://docs.openc3.com/docs/configuration/target")
              parser.parse_file(filename) do |keyword, parameters|
                case keyword
        Severity: Major
        Found in openc3/lib/openc3/system/target.rb - About 2 hrs to fix

          Function diff_cleanupEfficiency has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          diff_match_patch.prototype.diff_cleanupEfficiency = 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 run has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def run
                  begin
                    if @interface.read_allowed?
                      @logger.info "#{@interface.name}: Starting packet reading"
                    else
            Severity: Major
            Found in openc3/lib/openc3/microservices/interface_microservice.rb - About 2 hrs to fix

              Function modifyLimits has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  modifyLimits(limitsSettings) {
                    // By default the red bars take 10% of the display
                    this.redLow = 10
                    this.redHigh = 10
              
              

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

                    def handle_config(parser, keyword, parameters)
                      case keyword
                      when 'ENV'
                        parser.verify_num_parameters(2, 2, "#{keyword} <Key> <Value>")
                        @env[parameters[0]] = parameters[1]
                Severity: Major
                Found in openc3/lib/openc3/models/microservice_model.rb - About 2 hrs to fix

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

                      def self.run
                        ScopeModel.names.each do |scope|
                          puts "Processing scope #{scope}"
                  
                          # Update all old TriggerModels just so they work when we delete the ReactionModel
                  Severity: Major
                  Found in openc3/lib/openc3/migrations/20230615000000_autonomic.rb - About 2 hrs to fix

                    Method build_json_hash has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def self.build_json_hash(binary, definition_filename)
                          config = TableConfig.process_file(definition_filename)
                          tables = []
                          json = { tables: tables }
                          begin
                    Severity: Major
                    Found in openc3/lib/openc3/tools/table_manager/table_manager_core.rb - About 2 hrs to fix

                      Function patch_fromText has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      diff_match_patch.prototype.patch_fromText = function (textline) {
                        var patches = []
                        if (!textline) {
                          return patches
                        }

                        Method deploy_microservices has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def deploy_microservices(gem_path, variables, system)
                              command_topic_list = []
                              decom_command_topic_list = []
                              packet_topic_list = []
                              decom_topic_list = []
                        Severity: Major
                        Found in openc3/lib/openc3/models/target_model.rb - About 2 hrs to fix

                          Method handle_packet has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def handle_packet(packet)
                                if packet.stored
                                  # Stored telemetry does not update the current value table
                                  identified_packet = System.telemetry.identify_and_define_packet(packet, @interface.tlm_target_names)
                                else
                          Severity: Major
                          Found in openc3/lib/openc3/tools/cmd_tlm_server/interface_thread.rb - About 2 hrs to fix

                            Method unsegment_packet has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def unsegment_packet(packet)
                                  @ccsds_packet.buffer = packet.buffer
                            
                                  previous_sequence_count = @sequence_count
                                  @sequence_count = @ccsds_packet.read('CcsdsSeqcnt')
                            Severity: Major
                            Found in openc3/lib/openc3/ccsds/ccsds_parser.rb - About 2 hrs to fix

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

                                  def __init__(
                              Severity: Major
                              Found in openc3/python/openc3/models/microservice_model.py - About 2 hrs to fix

                                Method _openc3_script_wait_implementation has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    def _openc3_script_wait_implementation(target_name, packet_name, item_name, value_type, timeout, polling_rate, exp_to_eval, scope: $openc3_scope, token: $openc3_token, &block)
                                      end_time = Time.now.sys + timeout
                                      if exp_to_eval and !exp_to_eval.is_printable?
                                        raise "ERROR: Invalid comparison to non-ascii value"
                                      end
                                Severity: Major
                                Found in openc3/lib/openc3/script/api_shared.rb - About 2 hrs to fix

                                  Method create has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      def create(overlap: true)
                                        if @recurring['end'] and @recurring['frequency'] and @recurring['span']
                                          # First validate the initial recurring activity ... all others are just offsets
                                          validate_input(start: @start, stop: @stop, kind: @kind, data: @data)
                                  
                                  
                                  Severity: Major
                                  Found in openc3/lib/openc3/models/activity_model.rb - About 2 hrs to fix

                                    Method dynamic_update has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        def dynamic_update(packets, cmd_or_tlm = :TELEMETRY, filename = "dynamic_tlm.txt")
                                          # Build hash of targets/packets
                                          packet_hash = {}
                                          packets.each do |packet|
                                            target_name = packet.target_name.upcase
                                    Severity: Major
                                    Found in openc3/lib/openc3/models/target_model.rb - About 2 hrs to fix

                                      Method define has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          def define(item)
                                            # Handle Overwriting Existing Item
                                            if @items[item.name]
                                              item_index = nil
                                              @sorted_items.each_with_index do |sorted_item, index|
                                      Severity: Major
                                      Found in openc3/lib/openc3/packets/structure.rb - About 2 hrs to fix

                                        Method syntax has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          def self.syntax(filename, text)
                                            language = detect_language(text, filename)
                                            if language == 'ruby'
                                              check_process = IO.popen('ruby -c -rubygems 2>&1', 'r+')
                                              check_process.write("require 'openc3'; require 'openc3/script'; " + text)
                                        Severity: Major
                                        Found in openc3-cosmos-script-runner-api/app/models/script.rb - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language