Showing 1,379 of 1,379 total issues
Method xtce_handle_base_container
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def xtce_handle_base_container(base_name, element)
if element.name == base_name
# Need to add BaseContainer items to current_packet
# Lookup the base packet
if base_name == 'BaseMetaCommand'
Method read
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read
while true
if @handshaked
msg = @frame.next
return msg.data if msg
Method remove
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def remove(object)
@mutex.synchronize do
found_object = @objects_by_id[object.id]
if found_object
@objects.delete(found_object)
Similar blocks of code found in 5 locations. Consider refactoring. Open
def stop
running_script = RunningScript.find(params[:id].to_i)
if running_script
target_name = running_script['name'].split('/')[0]
return unless authorization('script_run', target_name: target_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 53.
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 5 locations. Consider refactoring. Open
def pause
running_script = RunningScript.find(params[:id].to_i)
if running_script
target_name = running_script['name'].split('/')[0]
return unless authorization('script_run', target_name: target_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 53.
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 5 locations. Consider refactoring. Open
def retry
running_script = RunningScript.find(params[:id].to_i)
if running_script
target_name = running_script['name'].split('/')[0]
return unless authorization('script_run', target_name: target_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 53.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if endianness == :LITTLE_ENDIAN
# Bitoffset always refers to the most significant bit of a bitfield
num_bytes = (((bit_offset % 8) + bit_size - 1) / 8) + 1
upper_bound = bit_offset / 8
lower_bound = upper_bound - num_bytes + 1
- 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 53.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if endianness == :LITTLE_ENDIAN
# Bitoffset always refers to the most significant bit of a bitfield
num_bytes = (((bit_offset % 8) + bit_size - 1) / 8) + 1
upper_bound = bit_offset / 8
lower_bound = upper_bound - num_bytes + 1
- 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 53.
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 5 locations. Consider refactoring. Open
def go
running_script = RunningScript.find(params[:id].to_i)
if running_script
target_name = running_script['name'].split('/')[0]
return unless authorization('script_run', target_name: target_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 53.
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 5 locations. Consider refactoring. Open
def step
running_script = RunningScript.find(params[:id].to_i)
if running_script
target_name = running_script['name'].split('/')[0]
return unless authorization('script_run', target_name: target_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 53.
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
Method put_target_file
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def put_target_file(path, io_or_string, scope: $openc3_scope)
raise "Disallowed path modifier '..' found in #{path}" if path.include?('..')
upload_path = "#{scope}/targets_modified/#{path}"
Method run_script
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_script(activity)
@logger.info "#{@timeline_name} run_script > #{activity.as_json(:allow_nan => true)}"
begin
if get_exec_setting()
username = activity.data['username']
Method evaluate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def evaluate(name:, left:, operator:, right:)
@logger.debug "TriggerGroupWorker-#{@ident} evaluate: (#{left}(#{left.class}) #{operator} #{right}(#{right.class}))"
begin
case operator
when '>'
Method _cmd_string
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _cmd_string(target_name, cmd_name, cmd_params, raw)
output_string = $disconnect ? 'DISCONNECT: ' : ''
if raw
output_string += 'cmd_raw("'
else
Method check_for_dead_clients
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_for_dead_clients
indexes_to_delete = []
index = 0
@connection_mutex.synchronize do
Method close_file
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def close_file(take_mutex = true)
threads = []
@mutex.lock if take_mutex
begin
if @file
Method get_cmd_time
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_cmd_time(target_name = nil, command_name = nil, manual: false, scope: $openc3_scope, token: $openc3_token)
authorize(permission: 'cmd_info', target_name: target_name, packet_name: command_name, manual: manual, scope: scope, token: token)
if target_name and command_name
target_name = target_name.upcase
command_name = command_name.upcase
Method offline_access_needed
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def offline_access_needed(manual: false, scope: $openc3_scope, token: $openc3_token)
authorize(permission: 'system', manual: manual, scope: scope, token: token)
begin
authorize(permission: 'script_view', manual: manual, scope: scope, token: token)
rescue
Method setup_thread_body
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_thread_body(objects)
first_object = objects[0]
# The goal of this mode is to determine if we are starting with files or from
# realtime
Method sync_with_bucket
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.sync_with_bucket(bucket, scope:)
# Build catalogs
local_catalog = build_local_catalog(scope: scope)
remote_catalog = build_remote_catalog(bucket, scope: scope)