Showing 1,379 of 1,379 total issues
Method action
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def action
begin
yield
rescue ArgumentError, TypeError => e
logger.error(e.formatted)
Function _openc3_script_wait_array_tolerance
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def _openc3_script_wait_array_tolerance(
Function append_item
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def append_item(
Function _openc3_script_wait_array_tolerance
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def _openc3_script_wait_array_tolerance(
Function __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Method append_item
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def append_item(name, bit_size, data_type, array_size = nil, endianness = @default_endianness, overflow = :ERROR, format_string = nil, read_conversion = nil, write_conversion = nil, id_value = nil)
Method _openc3_script_wait_implementation_array_tolerance
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def _openc3_script_wait_implementation_array_tolerance(array_size, target_name, packet_name, item_name, value_type, expected_value, tolerance, timeout, polling_rate = DEFAULT_TLM_POLLING_RATE, scope: $openc3_scope, token: $openc3_token, &block)
Method initialize
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
length_bit_offset = 0,
length_bit_size = 16,
length_value_offset = 0,
length_bytes_per_count = 1,
length_endianness = 'BIG_ENDIAN',
Method buffered_write
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def buffered_write(entry_type, cmd_or_tlm, target_name, packet_name, time_nsec_since_epoch, stored, data, id = nil, redis_topic = nil, redis_offset = '0-0', received_time_nsec_since_epoch: nil, extra: nil)
Method write
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def write(entry_type, cmd_or_tlm, target_name, packet_name, time_nsec_since_epoch, stored, data, id = nil, redis_topic = nil, redis_offset = '0-0', take_mutex: true, allow_new_file: true, received_time_nsec_since_epoch: nil, extra: nil)
Method formatted
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
word_size = 1,
words_per_line = 16,
word_separator = ' ',
indent = 0,
show_address = true,
Method initialize
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(port_name = 'COM1',
baud_rate = 9600,
parity = :NONE,
stop_bits = 1,
write_timeout = 10.0,
Similar blocks of code found in 2 locations. Consider refactoring. Open
acediff.editors.right.markers.forEach((marker) => {
acediff.editors.right.ace.getSession().removeMarker(marker)
}, acediff)
- 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 60.
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
acediff.editors.left.markers.forEach((marker) => {
acediff.editors.left.ace.getSession().removeMarker(marker)
}, acediff)
- 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 60.
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 diff_cleanupSemanticScore_
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function diff_cleanupSemanticScore_(one, two) {
if (!one || !two) {
// Edges are the best.
return 6
}
Function diff_commonOverlap_
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_commonOverlap_ = function (text1, text2) {
// Cache the text lengths to prevent multiple calls.
var text1_length = text1.length
var text2_length = text2.length
// Eliminate the null case.
Method _openc3_script_wait_implementation_expression
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _openc3_script_wait_implementation_expression(exp_to_eval, timeout, polling_rate, context, scope: $openc3_scope, token: $openc3_token)
end_time = Time.now.sys + timeout
raise "Invalid comparison to non-ascii value" unless exp_to_eval.is_printable?
while true
Method build_dcb
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.build_dcb
dcb = Structure.new(:LITTLE_ENDIAN)
dcb.define_item('DCBlength', 0, 32, :UINT)
dcb.define_item('BaudRate', 32, 32, :UINT)
dcb.define_item('fBinary', 71, 1, :UINT)
Method initialize
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(
start_char = nil,
read_strip_characters = true,
read_enable_escaping = true,
write_enable_escaping = true,