Showing 842 of 1,379 total issues
Function setHeight
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setHeight(height, units = 'px', defaultHeight = '20') {
// Don't set the height if someone has already set it
let foundSetting = null
if (this.widgetIndex !== null) {
foundSetting = this.settings.find(
Function setWidth
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setWidth(width, units = 'px', defaultWidth = '120') {
// Don't set the width if someone has already set it
// This is important in PacketViewer which uses the value-widget
// and passes an explicit width setting to use
let foundSetting = null
Method update_raw_hour_day_stats
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def update_raw_hour_day_stats(reduced, state)
# Update statistics for this packet's raw values
state.raw_max_values.each do |key, value|
if value
max_key = "#{key}__X"
Method initialize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(target_name = nil, packet_name = nil, default_endianness = :BIG_ENDIAN, description = nil, buffer = nil, item_class = PacketItem)
super(default_endianness, buffer, item_class)
# Explicitly call the defined setter methods
self.target_name = target_name
self.packet_name = packet_name
Method disconnect
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def disconnect
@cancel_threads = true
@read_queue << nil if @read_queue
@listen_pipes.each do |pipe|
pipe.write('.')
Method connect
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def connect
if @read_port and @write_dest_port and @write_src_port and (@read_port == @write_src_port)
@read_socket = UdpReadWriteSocket.new(
@read_port,
@bind_address,
Method to_xtce_string
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def to_xtce_string(item, param_or_arg, xml, string_or_binary)
# TODO: OpenC3 Variably sized strings are not supported in XTCE
attrs = { :name => (item.name + '_Type') }
attrs[:characterWidth] = 8 if string_or_binary == 'String'
if item.default && !item.array_size
Method build_target_archive
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def build_target_archive(temp_dir, target_folder)
target_files = []
Find.find(target_folder) { |file| target_files << file }
target_files.sort!
@id = OpenC3.hash_files(target_files, nil, 'SHA256').hexdigest
Method process_array_type
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def process_array_type(element, bit_size)
array_num_items = 1
# Need to determine dimensions
xtce_recurse_element(element) do |block_element|
if block_element.name == 'Dimension'
Method normalize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.normalize(target_name, packet_name, item_name, type: :ALL, scope: $openc3_scope)
hash = Store.hget("#{scope}__override__#{target_name}", packet_name)
hash = JSON.parse(hash, :allow_nan => true, :create_additions => true) if hash
hash ||= {} # In case the above didn't create anything
case type
Method initialize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(commands, telemetry, output_dir)
FileUtils.mkdir_p(output_dir)
# Build target list
targets = []
Method write_data
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def write_data(data, extra = nil)
# Intentionally not calling super()
need_insert = false
result_data = ''
Method overrides
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.overrides(scope: $openc3_scope)
overrides = []
TargetModel.names(scope: scope).each do |target_name|
all = Store.hgetall("#{scope}__override__#{target_name}")
next if all.nil? or all.empty?
Method process_ref_entry
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def process_ref_entry(element)
reference_location, bit_offset = xtce_handle_location_in_container_in_bits(element)
object, type, data_type, array_type = get_object_types(element)
bit_size = Integer(type.sizeInBits)
if array_type
Method convert_to_type
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.convert_to_type(value, item)
return value if value.nil?
case item.data_type
when :OBJECT, :ARRAY
# Do nothing for complex object types
Method create_table
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create_table(tables, warnings)
params = @parser.parameters
table_name = params[0].to_s.upcase
endianness = params[1].to_s.upcase.to_sym
if endianness != :BIG_ENDIAN && endianness != :LITTLE_ENDIAN
Method action
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def action
begin
yield
rescue ArgumentError, TypeError => e
logger.error(e.formatted)
Function diff_cleanupSplitSurrogates
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
diff_match_patch.prototype.diff_cleanupSplitSurrogates = function (diffs) {
var lastEnd
for (var x = 0; x < diffs.length; x++) {
var thisDiff = diffs[x]
var thisTop = thisDiff[1][0]
Function diff_prettyHtml
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
diff_match_patch.prototype.diff_prettyHtml = function (diffs) {
diffs = this.diff_cleanupSplitSurrogates(diffs)
var html = []
var pattern_amp = /&/g
var pattern_lt = /</g
Function __init__
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def __init__(
self,
remote_log_directory,
logging_enabled=True,
cycle_time=None,