Showing 842 of 1,379 total issues
Method generate_tool
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method initialize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(port_name = '/dev/ttyS0',
baud_rate = 9600,
parity = :NONE,
stop_bits = 1,
write_timeout = 10.0,
Function set
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set(
Method set
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
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)
Method initialize
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
hostname,
port,
handshake_enabled = true,
response_timeout = 5.0,
read_timeout = nil,
Method set_limits
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
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)
Function convertToString
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
def write_item(item, value, value_type = :CONVERTED, buffer = @buffer)
case value_type
when :RAW
super(item, value, value_type, buffer)
when :CONVERTED
Method wait_tolerance
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method save_configuration
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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'))
Method destroy
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.destroy(name:, scope:, score:, uuid: nil, recurring: nil)
result = 0
# Delete all recurring activities
if recurring
Method as_json
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def as_json(*_a)
{
'name' => @name,
'folder_name' => @folder_name,
'requires' => @requires,
Method get_object_types
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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']]
Method create_commands
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create_commands(xml, commands, target_name)
return unless commands[target_name]
xml['xtce'].CommandMetaData do
xml['xtce'].ArgumentTypeSet do
Method fast_select
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method julian2mdy
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method initialize
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(
remote_log_directory,
logging_enabled = true,
cycle_time = nil,
cycle_size = 1_000_000_000,
Method initialize
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method traefik
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def traefik
result = {}
result['http'] = {}
http = result['http']
http['routers'] = {}
Method set
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
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