Showing 842 of 1,379 total issues
Function __init__
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def __init__(self):
self.state = "DISCONNECTED"
self.target_names = []
self.cmd_target_names = []
self.tlm_target_names = []
Method create_telemetry
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create_telemetry(xml, telemetry, target_name)
# Gather and make unique all the packet items
unique_items = telemetry[target_name] ? get_unique(telemetry[target_name]) : {}
xml['xtce'].TelemetryMetaData do
Method start_listen_thread
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def start_listen_thread(port, listen_write = false, listen_read = false)
# Create a socket to accept connections from clients
addr = Socket.pack_sockaddr_in(port, @listen_address)
if RUBY_ENGINE == 'ruby'
listen_socket = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
Method protocol_cmd
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def protocol_cmd(cmd_name, *cmd_args, read_write: :READ_WRITE, index: -1)
read_write = read_write.to_s.upcase.intern
raise "Unknown protocol descriptor: #{read_write}. Must be :READ, :WRITE, or :READ_WRITE." unless [:READ, :WRITE, :READ_WRITE].include?(read_write)
handled = false
Method initialize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(write_port,
read_port,
write_timeout,
read_timeout,
protocol_type = nil,
Method write_item
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def write_item(item, value, buffer)
item_name = item.name
case item_name
when 'HTTP_STATUS'
@packet.extra ||= {}
Method call
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def call(log, _appender = nil)
#<SemanticLogger::Log:0x0000ffffa5002b20 @level=:info, @thread_name="puma srv tp 001", @name="MicroservicesController",
# @time=2024-09-22 18:04:27.955490052 +0000, @tags=[], @named_tags={}, @level_index=2, @message="Completed #traefik",
# @payload={:controller=>"MicroservicesController", :action=>"traefik", :format=>"HTML", :method=>"GET",
# :path=>"/openc3-api/traefik", :status=>200, :view_runtime=>0.41, :allocations=>1438, :status_message=>"OK",
Method _limits_group
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def _limits_group(group_name, action:, manual:, scope:, token:)
authorize(permission: 'tlm_set', manual: manual, scope: scope, token: token)
group_name.upcase!
group = get_limits_groups(scope: scope, token: token)[group_name]
raise "LIMITS_GROUP #{group_name} undefined. Ensure your telemetry definition contains the line: LIMITS_GROUP #{group_name}" unless group
Method multi_create
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def multi_create
return unless authorization('script_run')
input_activities = params.to_unsafe_h.slice(:multi).to_h['multi']
unless input_activities.is_a?(Array)
render json: { status: 'error', message: 'invalid input, must be json list/array' }, status: 400
Method file_thread_body
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def file_thread_body(objects)
topics, offsets, item_objects_by_topic, packet_objects_by_topic = @collection.topics_offsets_and_objects
results = []
# This will read out packets until nothing is left
Function patch_addPadding
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
diff_match_patch.prototype.patch_addPadding = function (patches) {
var paddingLength = this.Patch_Margin
var nullPadding = ''
for (var x = 1; x <= paddingLength; x++) {
nullPadding += String.fromCharCode(x)
Function getSingleDiffInfo
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getSingleDiffInfo(editor, offset, diffString) {
const info = {
startLine: 0,
startChar: 0,
endLine: 0,
Function diff_linesToChars_
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
diff_match_patch.prototype.diff_linesToChars_ = function (text1, text2) {
var lineArray = [] // e.g. lineArray[4] == 'Hello\n'
var lineHash = {} // e.g. lineHash['Hello\n'] == 4
// '\x00' is a valid character, but various debuggers don't like it.
Function diff_main
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
diff_match_patch.prototype.diff_main = function (
text1,
text2,
opt_checklines,
opt_deadline,
Method identify
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def identify(packet_data, target_names = nil)
identified_packet = nil
target_names = target_names() unless target_names
Method get_tlm_values
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.get_tlm_values(items, stale_time: 30, cache_timeout: nil, scope: $openc3_scope)
now = Time.now
results = []
lookups = []
packet_lookup = {}
Method finish_packet
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def finish_packet
if @current_packet
warnings = @current_packet.check_bit_offsets
if warnings.length > 0
raise "Overlapping items not allowed in tables.\n#{warnings}"
Method qfromc
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.qfromc(rotation_matrix)
tracec = rotation_matrix.trace()
p = 1.0 + tracec
if p < 0.0
p = 0.0
Method _build_cmd_output_string
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def _build_cmd_output_string(method_name, target_name, cmd_name, cmd_params, packet)
output_string = "#{method_name}(\""
output_string << (target_name + ' ' + cmd_name)
if cmd_params.nil? or cmd_params.empty?
output_string << '")'
Method calc
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def calc(data, seed = @seed)
crc = seed
case @bit_size
when 8