Showing 842 of 1,379 total issues
Method start_service
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def start_service(hostname = nil, port = nil, object = nil, max_threads = 1000)
server_started = false
@server_mutex.synchronize do
server_started = true if @server
end
Method from_json
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.from_json(hash)
# Convert strings to symbols
endianness = hash['endianness'] ? hash['endianness'].intern : nil
data_type = hash['data_type'] ? hash['data_type'].intern : nil
overflow = hash['overflow'] ? hash['overflow'].intern : nil
Method monitor
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def monitor
processes_to_delete = []
cleanup_time = Time.now
while true
current_time = Time.now
Method install_phase1
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.install_phase1(gem_file_path, existing_variables: nil, existing_plugin_txt_lines: nil, process_existing: false, scope:, validate_only: false)
gem_name = File.basename(gem_file_path).split("__")[0]
temp_dir = Dir.mktmpdir
tf = nil
Method set_min_max_default
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def set_min_max_default(item, type, data_type)
return unless @current_cmd_or_tlm == PacketConfig::COMMAND
# Need to set min, max, and default
if data_type == :INT || data_type == :UINT
Method reduce_to_single_packet
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def reduce_to_single_packet
# Discard sync pattern if present
if @sync_pattern
if @reduction_state == :START
return :STOP if @data.length < @sync_pattern.length
Method instrumented
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.instrumented(filename, text)
language = detect_language(text, filename)
if language == 'ruby'
return {
'title' => 'Instrumented Script',
Function simplifyDiffs
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function simplifyDiffs(acediff, diffs) {
const groupedDiffs = []
function compare(val) {
return acediff.options.diffGranularity === C.DIFF_GRANULARITY_SPECIFIC
Method as_json
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def as_json(*a)
config = {}
config['target_name'] = @target_name.to_s
config['packet_name'] = @packet_name.to_s
config['endianness'] = @default_endianness.to_s
Method get_check_overflow_ranges
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.get_check_overflow_ranges(bit_size, data_type)
min_value = 0 # Default for UINT cases
case bit_size
when 8
Method initialize
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(port_name = 'COM1',
baud_rate = 9600,
parity = :NONE,
stop_bits = 1,
write_timeout = 10.0,
Method update_local_plugin
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.update_local_plugin(plugin_file_path, plugin_hash, old_plugin_name: nil, scope:)
if ENV['OPENC3_LOCAL_MODE'] and Dir.exist?(OPENC3_LOCAL_MODE_PATH)
variables = plugin_hash['variables']
if variables
PluginModel::RESERVED_VARIABLE_NAMES.each do |name|
Function diff_lineMode_
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
diff_match_patch.prototype.diff_lineMode_ = function (text1, text2, deadline) {
// Scan the text on a line-by-line basis first.
var a = this.diff_linesToChars_(text1, text2)
text1 = a.chars1
text2 = a.chars2
Method deploy
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def deploy(gem_path, variables, validate_only: false)
variables["target_name"] = @name
start_path = "/targets/#{@folder_name}/"
temp_dir = Dir.mktmpdir
found = false
Method extract_fields_from_cmd_text
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def extract_fields_from_cmd_text(text, scope: $openc3_scope)
split_string = text.split(/\s+with\s+/i, 2)
raise "ERROR: text must not be empty" if split_string.length == 0
raise "ERROR: 'with' must be followed by parameters : #{text}" if (split_string.length == 1 and text =~ /\s*with\s*/i) or (split_string.length == 2 and split_string[1].empty?)
Method process_file
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def process_file(filename, targets_config_dir)
parser = ConfigParser.new("https://docs.openc3.com/docs")
# First pass - Everything except targets
parser.parse_file(filename) do |keyword, parameters|
Consider simplifying this complex logical expression. Open
Open
if "expect" in line and ".to eql" in line:
line = line.replace("expect(", "self.assertEqual(")
line = re.sub(r"\)\.to eql(.*)", r", \1)", line)
elif "expect" in line and ".to eq" in line:
line = line.replace("expect(", "self.assertEqual(")
Method read
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def read
raise "Interface not connected for read: #{@name}" unless connected?
raise "Interface not readable: #{@name}" unless read_allowed?
first = true
Method initialize
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(write_port_name,
read_port_name,
baud_rate,
parity,
stop_bits,
Method evaluate_trigger
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def evaluate_trigger(head:, trigger:, visited:, triggers:)
if visited["#{trigger.name}__R"]
return visited["#{trigger.name}__R"]
end
if visited["#{trigger.name}__P"].nil?