Showing 1,379 of 1,379 total issues
Method index
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
OpenC3::Logger.debug("request for aggregator metrics")
begin
scopes = OpenC3::ScopeModel.names()
rescue RuntimeError => e
Function data
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
data() {
return {
curValue: null,
prevValue: null,
grayLevel: 80,
Function deleteItem
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
deleteItem(item) {
let start = null
let api = ''
switch (item.type.toLowerCase()) {
case 'activity':
Method _wait_tolerance_process_args
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _wait_tolerance_process_args(args)
case args.length
when 4, 5
target_name, packet_name, item_name = extract_fields_from_tlm_text(args[0])
expected_value = args[1]
Method process_result
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_result(results)
openc3_lib = Regexp.new(File.join(OpenC3::PATH, 'lib'))
# If we were passed an array we concat it to the results global
if results.is_a? Array
@results.concat(results)
Method initialize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(
name:,
config_params: [],
target_names: [],
cmd_target_names: [],
Method handle_sync_pattern
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_sync_pattern
if @sync_pattern and @sync_state == :SEARCHING
loop do
# Make sure we have some data to look for a sync word in
return :STOP if @data.length < @sync_pattern.length
Method connect
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def connect
@cancel_threads = false
@read_queue.clear if @read_queue
if @write_port == @read_port # One socket
start_listen_thread(@read_port, true, true)
Method retrieve
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def retrieve(client = @bucket, uncompress = true)
@mutex.synchronize do
local_path = "#{BucketFileCache.instance.cache_dir}/#{File.basename(@bucket_path)}"
unless File.exist?(local_path)
OpenC3::Logger.debug "Retrieving #{@bucket_path} from logs bucket"
Method generate_widget
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.generate_widget(args)
if args.length < 2 or args.length > 3
abort("Usage: cli generate #{args[0]} <SuperdataWidget> (--ruby or --python)")
end
# Per https://stackoverflow.com/a/47591707/453280
Method setup_thread_body
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_thread_body
# The goal of this mode is to determine if we are starting with files or from
# realtime
if @start_time
# start_time can be at most 1 minute in the future to prevent
Method add
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add(data)
# OpenC3::Logger.debug "start:#{Time.at(data["start_time"].to_i/1_000_000_000.0).formatted}" if data["start_time"]
# OpenC3::Logger.debug "end:#{Time.at(data["end_time"].to_i/1_000_000_000.0).formatted}" if data["end_time"]
@mutex.synchronize do
# Preprocess request fields
Similar blocks of code found in 2 locations. Consider refactoring. Open
def deploy_unknown_packetlog_microservice(gem_path, variables, parent)
microservice_name = "#{@scope}__PACKETLOG__UNKNOWN"
microservice = MicroserviceModel.new(
name: microservice_name,
cmd: ["ruby", "log_microservice.rb", microservice_name],
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def destroy
return unless authorization('script_run')
action do
count = @model_class.destroy(start: params[:id].to_i, scope: params[:scope])
if count == 0
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def destroy
return unless authorization('script_run')
action do
count = @model_class.destroy(start: params[:id].to_i, scope: params[:scope])
if count == 0
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def deploy_unknown_commandlog_microservice(gem_path, variables, parent)
microservice_name = "#{@scope}__COMMANDLOG__UNKNOWN"
microservice = MicroserviceModel.new(
name: microservice_name,
cmd: ["ruby", "log_microservice.rb", microservice_name],
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function define_item
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def define_item(
Function formatted
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def formatted(
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(