Showing 842 of 1,379 total issues
Method read_item
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def read_item(item, buffer)
item_name = item.name
case item_name
when 'HTTP_STATUS'
return nil unless @packet.extra
Method initialize
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize
# Create local file cache location
@cache_dir = Dir.mktmpdir
FileUtils.mkdir_p(@cache_dir)
at_exit do
Method initialize
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(key, start_time_nsec, end_time_nsec, item_key: nil, scope:, token: nil)
key = key.upcase
@key = key
@item_key = item_key
key_split = key.split('__')
Function addEventHandlers
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function addEventHandlers(acediff) {
acediff.editors.left.ace.getSession().on(
'changeScrollTop',
throttle(() => {
updateGap(acediff)
Method read
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def read
packet = nil
if @connected
while true
packet = first_pending_packet()
Method connect
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def connect
# Packet definitions need to be retrieved here because @target_names is not filled in until after initialize
unless @handshake_enableds
@handshake_enableds = {}
@target_names.each do |target_name|
Method report
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.report(binary, definition_filename, requested_table_name = nil)
report = StringIO.new
config = TableConfig.process_file(definition_filename)
begin
load_binary(config, binary)
Function exec
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async exec(method, params, kwparams = {}, headerOptions = {}) {
try {
let refreshed = await OpenC3Auth.updateToken(
OpenC3Auth.defaultMinValidity,
)
Method to_config
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def to_config(output_dir)
FileUtils.mkdir_p(output_dir)
@telemetry.each do |target_name, packets|
next if target_name == 'UNKNOWN'
Method undeploy
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def undeploy
prefix = "#{@scope}/targets/#{@name}/"
@bucket.list_objects(bucket: ENV['OPENC3_CONFIG_BUCKET'], prefix: prefix).each do |object|
@bucket.delete_object(bucket: ENV['OPENC3_CONFIG_BUCKET'], key: object.key)
end
Method cycle_thread_body
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def cycle_thread_body
@@cycle_sleeper = Sleeper.new
while true
start_time = Time.now
@@mutex.synchronize do
Method set_limits
has 44 lines of code (exceeds 25 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)
authorize(permission: 'tlm_set', target_name: target_name, packet_name: packet_name, manual: manual, scope: scope, token: token)
if (red_low > yellow_low) || (yellow_low >= yellow_high) || (yellow_high > red_high)
Method analyze_local_mode
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.analyze_local_mode(plugin_name:, scope:)
if ENV['OPENC3_LOCAL_MODE'] and Dir.exist?(OPENC3_LOCAL_MODE_PATH)
# We already know a plugin with this name doesn't exist in the models
# Now need to determine if there is a highly likely candidate that has been
# updated, so that we don't do an erroneous extra plugin install
Method initialize
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(id, scope, name, disconnect)
@@instance = self
@id = id
@@id = id
@scope = scope
Method redis_thread_body
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def redis_thread_body
topics, offsets, item_objects_by_topic, packet_objects_by_topic = @collection.topics_offsets_and_objects
results = []
if topics.length > 0
# 500ms timeout to allow for thread to shutdown within 1 second
Method generate_target
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.generate_target(args)
if args.length < 2 or args.length > 3
abort("Usage: cli generate #{args[0]} <NAME> (--ruby or --python)")
end
Method check_tolerance
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def check_tolerance(*args, type: :CONVERTED, scope: $openc3_scope, token: $openc3_token)
raise "Invalid type '#{type}' for check_tolerance" unless %i(RAW CONVERTED).include?(type)
target_name, packet_name, item_name, expected_value, tolerance =
_check_tolerance_process_args(args)
Method handle_output_io
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def handle_output_io(filename = @current_filename, line_number = @current_line_number)
@output_time = Time.now.sys
if @output_io.string[-1..-1] == "\n"
time_formatted = Time.now.sys.formatted
color = 'BLACK'
Function digit16
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
diff_match_patch.prototype.digit16 = function (c) {
switch (c) {
case '0':
return 0
case '1':
Method handle_packet
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def handle_packet(packet)
InterfaceStatusModel.set(@interface.as_json(:allow_nan => true), queued: true, scope: @scope)
packet.received_time = Time.now.sys unless packet.received_time
if packet.stored