Showing 1,379 of 1,379 total issues
Function addEventHandlers
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addEventHandlers(acediff) {
acediff.editors.left.ace.getSession().on(
'changeScrollTop',
throttle(() => {
updateGap(acediff)
Method read
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read
packet = nil
if @connected
while true
packet = first_pending_packet()
Method connect
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def connect
# Packet definitions need to be retrieved here because @target_names is not filled in until after initialize
unless @handshake_enableds
@handshake_enableds = {}
@target_names.each do |target_name|
Method report
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.report(binary, definition_filename, requested_table_name = nil)
report = StringIO.new
config = TableConfig.process_file(definition_filename)
begin
load_binary(config, binary)
Similar blocks of code found in 3 locations. Consider refactoring. Open
def enable
return unless authorization('script_run')
begin
model = @model_class.get(name: params[:name], scope: params[:scope])
if model.nil?
- 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 71.
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
endpoint = "/openc3-api/packages?scope=#{scope}"
uri = URI.parse($api_server.generate_url + endpoint)
auth = $api_server.generate_auth
request = Net::HTTP::Get.new(uri)
- 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 71.
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 3 locations. Consider refactoring. Open
def disable
return unless authorization('script_run')
begin
model = @model_class.get(name: params[:name], scope: params[:scope])
if model.nil?
- 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 71.
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
endpoint = "/openc3-api/plugins?scope=#{scope}"
uri = URI.parse($api_server.generate_url + endpoint)
auth = $api_server.generate_auth
request = Net::HTTP::Get.new(uri)
- 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 71.
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
module OpenC3
class StashModel < Model
PRIMARY_KEY = 'openc3__stash'
# NOTE: The following three class methods are used by the ModelController
- 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 71.
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
module OpenC3
class SecretModel < Model
PRIMARY_KEY = 'openc3__secrets'
# NOTE: The following three class methods are used by the ModelController
- 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 71.
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 3 locations. Consider refactoring. Open
def execute
return unless authorization('script_run')
begin
model = @model_class.get(name: params[:name], scope: params[:scope])
if model.nil?
- 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 71.
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 exec
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
async exec(method, params, kwparams = {}, headerOptions = {}) {
try {
let refreshed = await OpenC3Auth.updateToken(
OpenC3Auth.defaultMinValidity,
)
Method to_config
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_config(output_dir)
FileUtils.mkdir_p(output_dir)
@telemetry.each do |target_name, packets|
next if target_name == 'UNKNOWN'
Method undeploy
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def undeploy
prefix = "#{@scope}/targets/#{@name}/"
@bucket.list_objects(bucket: ENV['OPENC3_CONFIG_BUCKET'], prefix: prefix).each do |object|
@bucket.delete_object(bucket: ENV['OPENC3_CONFIG_BUCKET'], key: object.key)
end
Method cycle_thread_body
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cycle_thread_body
@@cycle_sleeper = Sleeper.new
while true
start_time = Time.now
@@mutex.synchronize do
Method set_limits
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_limits(target_name, packet_name, item_name, red_low, yellow_low, yellow_high, red_high,
green_low = nil, green_high = nil, limits_set = 'CUSTOM', persistence = nil, enabled = true,
manual: false, scope: $openc3_scope, token: $openc3_token)
authorize(permission: 'tlm_set', target_name: target_name, packet_name: packet_name, manual: manual, scope: scope, token: token)
if (red_low > yellow_low) || (yellow_low >= yellow_high) || (yellow_high > red_high)
Method analyze_local_mode
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.analyze_local_mode(plugin_name:, scope:)
if ENV['OPENC3_LOCAL_MODE'] and Dir.exist?(OPENC3_LOCAL_MODE_PATH)
# We already know a plugin with this name doesn't exist in the models
# Now need to determine if there is a highly likely candidate that has been
# updated, so that we don't do an erroneous extra plugin install
Method initialize
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(id, scope, name, disconnect)
@@instance = self
@id = id
@@id = id
@scope = scope
Method redis_thread_body
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def redis_thread_body
topics, offsets, item_objects_by_topic, packet_objects_by_topic = @collection.topics_offsets_and_objects
results = []
if topics.length > 0
# 500ms timeout to allow for thread to shutdown within 1 second
Method generate_target
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.generate_target(args)
if args.length < 2 or args.length > 3
abort("Usage: cli generate #{args[0]} <NAME> (--ruby or --python)")
end