Showing 842 of 1,379 total issues
Method connect
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def connect
@server = WEBrick::HTTPServer.new(:BindAddress => @listen_address, :Port => @port)
@request_queue = Queue.new
# Create a response hook for every command packet
Method start
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def start
@thread_sleeper = Sleeper.new
@thread = Thread.new do
@cancel_thread = false
begin
Method initialize
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(name)
@mutex = Mutex.new
super(name)
@interface_or_router = self.class.name.to_s.split("Microservice")[0].upcase.split("::")[-1]
Method process_file
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def process_file(filename)
Logger.instance.info "Processing target definition in file '#{filename}'"
parser = ConfigParser.new("https://docs.openc3.com/docs/configuration/target")
parser.parse_file(filename) do |keyword, parameters|
case keyword
Function diff_cleanupEfficiency
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
diff_match_patch.prototype.diff_cleanupEfficiency = function (diffs) {
var changes = false
var equalities = [] // Stack of indices where equalities are found.
var equalitiesLength = 0 // Keeping our own length var is faster in JS.
/** @type {?string} */
Method run
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def run
begin
if @interface.read_allowed?
@logger.info "#{@interface.name}: Starting packet reading"
else
Function modifyLimits
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
modifyLimits(limitsSettings) {
// By default the red bars take 10% of the display
this.redLow = 10
this.redHigh = 10
Method handle_config
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def handle_config(parser, keyword, parameters)
case keyword
when 'ENV'
parser.verify_num_parameters(2, 2, "#{keyword} <Key> <Value>")
@env[parameters[0]] = parameters[1]
Method run
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.run
ScopeModel.names.each do |scope|
puts "Processing scope #{scope}"
# Update all old TriggerModels just so they work when we delete the ReactionModel
Method build_json_hash
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.build_json_hash(binary, definition_filename)
config = TableConfig.process_file(definition_filename)
tables = []
json = { tables: tables }
begin
Function patch_fromText
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
diff_match_patch.prototype.patch_fromText = function (textline) {
var patches = []
if (!textline) {
return patches
}
Method deploy_microservices
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def deploy_microservices(gem_path, variables, system)
command_topic_list = []
decom_command_topic_list = []
packet_topic_list = []
decom_topic_list = []
Method handle_packet
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def handle_packet(packet)
if packet.stored
# Stored telemetry does not update the current value table
identified_packet = System.telemetry.identify_and_define_packet(packet, @interface.tlm_target_names)
else
Method unsegment_packet
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def unsegment_packet(packet)
@ccsds_packet.buffer = packet.buffer
previous_sequence_count = @sequence_count
@sequence_count = @ccsds_packet.read('CcsdsSeqcnt')
Function __init__
has 18 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Method _openc3_script_wait_implementation
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def _openc3_script_wait_implementation(target_name, packet_name, item_name, value_type, timeout, polling_rate, exp_to_eval, scope: $openc3_scope, token: $openc3_token, &block)
end_time = Time.now.sys + timeout
if exp_to_eval and !exp_to_eval.is_printable?
raise "ERROR: Invalid comparison to non-ascii value"
end
Method create
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create(overlap: true)
if @recurring['end'] and @recurring['frequency'] and @recurring['span']
# First validate the initial recurring activity ... all others are just offsets
validate_input(start: @start, stop: @stop, kind: @kind, data: @data)
Method dynamic_update
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def dynamic_update(packets, cmd_or_tlm = :TELEMETRY, filename = "dynamic_tlm.txt")
# Build hash of targets/packets
packet_hash = {}
packets.each do |packet|
target_name = packet.target_name.upcase
Method define
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def define(item)
# Handle Overwriting Existing Item
if @items[item.name]
item_index = nil
@sorted_items.each_with_index do |sorted_item, index|
Method syntax
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.syntax(filename, text)
language = detect_language(text, filename)
if language == 'ruby'
check_process = IO.popen('ruby -c -rubygems 2>&1', 'r+')
check_process.write("require 'openc3'; require 'openc3/script'; " + text)