OpenC3/cosmos

View on GitHub

Showing 842 of 1,379 total issues

Method generate_tool has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def self.generate_tool(args)
      if args.length < 2 or args.length > 3
        abort("Usage: cli generate #{args[0]} 'Tool Name' (--ruby or --python)")
      end

Severity: Minor
Found in openc3/lib/openc3/utilities/cli_generator.rb - About 1 hr to fix

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

        def initialize(port_name = '/dev/ttyS0',
                       baud_rate = 9600,
                       parity = :NONE,
                       stop_bits = 1,
                       write_timeout = 10.0,
    Severity: Minor
    Found in openc3/lib/openc3/io/posix_serial_driver.rb - About 1 hr to fix

      Function set has 12 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

        Method set has 12 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def set(target_name, packet_name, item_name, red_low, yellow_low, yellow_high, red_high, green_low = nil, green_high = nil, limits_set = :CUSTOM, persistence = nil, enabled = true)
        Severity: Major
        Found in openc3/lib/openc3/packets/limits.rb - About 1 hr to fix

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

                hostname,
                port,
                handshake_enabled = true,
                response_timeout = 5.0,
                read_timeout = nil,
          Severity: Major
          Found in openc3/lib/openc3/interfaces/linc_interface.rb - About 1 hr to fix

            Method set_limits has 12 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def set_limits(target_name, packet_name, item_name, red_low, yellow_low, yellow_high, red_high,
                               green_low = nil, green_high = nil, limits_set = 'CUSTOM', persistence = nil, enabled = true,
                               manual: false, scope: $openc3_scope, token: $openc3_token)
            Severity: Major
            Found in openc3/lib/openc3/api/limits_api.rb - About 1 hr to fix

              Function convertToString has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  convertToString(value) {
                    var i = 0
                    var returnValue = ''
                    if (Object.prototype.toString.call(value).slice(8, -1) === 'Array') {
                      var arrayLength = value.length

                Method write_item has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def write_item(item, value, value_type = :CONVERTED, buffer = @buffer)
                      case value_type
                      when :RAW
                        super(item, value, value_type, buffer)
                      when :CONVERTED
                Severity: Minor
                Found in openc3/lib/openc3/packets/packet.rb - About 1 hr to fix

                  Method wait_tolerance has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def wait_tolerance(*args, type: :CONVERTED, quiet: false, scope: $openc3_scope, token: $openc3_token)
                        raise "Invalid type '#{type}' for wait_tolerance" unless %i(RAW CONVERTED).include?(type)
                  
                        target_name, packet_name, item_name, expected_value, tolerance, timeout, polling_rate = _wait_tolerance_process_args(args)
                        start_time = Time.now.sys
                  Severity: Minor
                  Found in openc3/lib/openc3/script/api_shared.rb - About 1 hr to fix

                    Method save_configuration has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def save_configuration
                          configuration = find_configuration(@config.name)
                          configuration = File.join(@paths['SAVED_CONFIG'], File.build_timestamped_filename([@config.name], '.zip')) unless configuration
                          unless File.exist?(configuration)
                            configuration_tmp = File.join(@paths['SAVED_CONFIG'], File.build_timestamped_filename(['tmp_' + @config.name], '.zip.tmp'))
                    Severity: Minor
                    Found in openc3/lib/openc3/system/system_config.rb - About 1 hr to fix

                      Method destroy has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def self.destroy(name:, scope:, score:, uuid: nil, recurring: nil)
                            result = 0
                      
                            # Delete all recurring activities
                            if recurring
                      Severity: Minor
                      Found in openc3/lib/openc3/models/activity_model.rb - About 1 hr to fix

                        Method as_json has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def as_json(*_a)
                              {
                                'name' => @name,
                                'folder_name' => @folder_name,
                                'requires' => @requires,
                        Severity: Minor
                        Found in openc3/lib/openc3/models/target_model.rb - About 1 hr to fix

                          Method get_object_types has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def get_object_types(element)
                                array_type = nil
                                if /Parameter/.match?(element.name)
                                  # Look up the parameter and parameter type
                                  parameter = @parameters[element['parameterRef']]
                          Severity: Minor
                          Found in openc3/lib/openc3/packets/parsers/xtce_parser.rb - About 1 hr to fix

                            Method create_commands has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def create_commands(xml, commands, target_name)
                                  return unless commands[target_name]
                            
                                  xml['xtce'].CommandMetaData do
                                    xml['xtce'].ArgumentTypeSet do
                            Severity: Minor
                            Found in openc3/lib/openc3/packets/parsers/xtce_converter.rb - About 1 hr to fix

                              Method fast_select has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def fast_select(read_sockets = nil, write_sockets = nil, error_array = nil, timeout = nil)
                                    # Always try a zero timeout first
                                    current_timeout = SELECT_BASE_TIMEOUT
                                    total_timeout = 0.0
                              
                              
                              Severity: Minor
                              Found in openc3/lib/openc3/core_ext/io.rb - About 1 hr to fix

                                Method julian2mdy has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def self.julian2mdy(jdate)
                                    z = (jdate + 0.5).to_i
                                    w = ((z - 1867216.25) / 36524.25).to_i
                                    x = w / 4
                                    a = z + 1 + w - x
                                Severity: Minor
                                Found in openc3/lib/openc3/core_ext/time.rb - About 1 hr to fix

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

                                      def initialize(
                                        remote_log_directory,
                                        logging_enabled = true,
                                        cycle_time = nil,
                                        cycle_size = 1_000_000_000,
                                  Severity: Minor
                                  Found in openc3/lib/openc3/logs/log_writer.rb - About 1 hr to fix

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

                                        def initialize(hostname, write_port, read_port, write_timeout, read_timeout, connect_timeout = 5.0)
                                          @hostname = hostname
                                          if @hostname.to_s.upcase == 'LOCALHOST'
                                            @hostname = '127.0.0.1'
                                          end
                                    Severity: Minor
                                    Found in openc3/lib/openc3/streams/tcpip_client_stream.rb - About 1 hr to fix

                                      Method traefik has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        def traefik
                                          result = {}
                                          result['http'] = {}
                                          http = result['http']
                                          http['routers'] = {}

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

                                            def set(target_name, packet_name, item_name, red_low, yellow_low, yellow_high, red_high, green_low = nil, green_high = nil, limits_set = :CUSTOM, persistence = nil, enabled = true)
                                              packet = _get_packet(target_name, packet_name)
                                              item = packet.get_item(item_name)
                                              limits = item.limits
                                              if limits_set
                                        Severity: Minor
                                        Found in openc3/lib/openc3/packets/limits.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language