Showing 1,379 of 1,379 total issues
Method update
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update(start:, stop:, kind:, data:, overlap: true)
array = Store.zrangebyscore(@primary_key, @start, @start)
if array.length == 0
raise ActivityError.new "failed to find activity at: #{@start}"
end
Method move_log_file_to_bucket
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.move_log_file_to_bucket(filename, bucket_key, metadata: {})
Thread.new do
client = Bucket.getClient()
orig_filename = nil
Method read
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read
raise "Attempt to read from write only stream" unless @read_socket
# No read mutex is needed because reads happen serially
begin
Method initialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(bucket_path)
@bucket = OpenC3::Bucket.getClient()
@bucket_path = bucket_path
@local_path = nil
@reservation_count = 0
Method create
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
return unless authorization('script_run')
if params['key'].nil? || params['value'].nil?
render json: {
status: 'error',
Similar blocks of code found in 4 locations. Consider refactoring. Open
case 'WIDTH':
if (!isNaN(Number(setting[1]))) {
setting[1] += 'px'
}
style['width'] = setting[1] + ' !important'
- 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 56.
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 set_tlm(*args, type: :CONVERTED, manual: false, scope: $openc3_scope, token: $openc3_token)
target_name, packet_name, item_name, value = _set_tlm_process_args(args, __method__, scope: scope)
authorize(permission: 'tlm_set', target_name: target_name, packet_name: packet_name, manual: manual, scope: scope, token: token)
CvtModel.set_item(target_name, packet_name, item_name, value, type: type.intern, scope: scope)
- 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 49.
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 4 locations. Consider refactoring. Open
case 'MARGIN':
if (!isNaN(Number(setting[1]))) {
setting[1] += 'px'
}
style['margin'] = setting[1] + ' !important'
- 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 56.
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 4 locations. Consider refactoring. Open
case 'PADDING':
if (!isNaN(Number(setting[1]))) {
setting[1] += 'px'
}
style['padding'] = setting[1] + ' !important'
- 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 56.
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 override_tlm(*args, type: :ALL, manual: false, scope: $openc3_scope, token: $openc3_token)
target_name, packet_name, item_name, value = _set_tlm_process_args(args, __method__, scope: scope)
authorize(permission: 'tlm_set', target_name: target_name, packet_name: packet_name, manual: manual, scope: scope, token: token)
CvtModel.override(target_name, packet_name, item_name, value, type: type.intern, scope: scope)
- 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 49.
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 4 locations. Consider refactoring. Open
case 'HEIGHT':
if (!isNaN(Number(setting[1]))) {
setting[1] += 'px'
}
style['height'] = setting[1] + ' !important'
- 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 56.
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 addCopyArrows
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addCopyArrows(acediff, info, diffIndex) {
if (
info.leftEndLine > info.leftStartLine &&
acediff.options.left.copyLinkEnabled
) {
Function __init__
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
name: str,
folder_name: str = None,
cmd: Optional[list] = None,
Method cleanup
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cleanup(areas, cleanup_poll_time)
bucket = Bucket.getClient()
while true
break if @cancel_thread
Method update_min_stats
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_min_stats(reduced, state)
# Update statistics for this packet's raw values
state.raw_values.each do |key, value|
if value
vals_key = "#{key}__VALS"
Method values_and_limits_states
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def values_and_limits_states(item_array, value_types = :CONVERTED)
items = []
# Verify item_array is a nested array
raise(ArgumentError, "item_array must be a nested array consisting of [[tgt,pkt,item],[tgt,pkt,item],...]") unless Array === item_array[0]
Method download
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.download(target_name, scope:)
tmp_dir = Dir.mktmpdir
zip_filename = File.join(tmp_dir, "#{target_name}.zip")
Zip.continue_on_exists_proc = true
zip = Zip::File.open(zip_filename, Zip::File::CREATE)
Method connect
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def connect
(@read_protocols | @write_protocols).each { |protocol| protocol.connect_reset }
periodic_cmds = @options['PERIODIC_CMD']
if periodic_cmds
Method identify
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def identify(packet_data, target_names = nil)
target_names = target_names() unless target_names
target_names.each do |target_name|
target_name = target_name.to_s.upcase
Method get_metrics
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_metrics(manual: false, scope: $openc3_scope, token: $openc3_token)
authorize(permission: 'system', manual: manual, scope: scope, token: token)
sum_metrics = SUM_METRICS.dup
duration_metrics = DURATION_METRICS.dup