Showing 1,379 of 1,379 total issues
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, bit_offset, bit_size, data_type, endianness, array_size = nil, overflow = :ERROR)
Method _execute_wait
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _execute_wait(target_name, packet_name, item_name, value_type, comparison_to_eval, timeout, polling_rate, quiet: false, scope: $openc3_scope, token: $openc3_token)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
hostname,
write_port,
read_port,
write_timeout,
read_timeout,
Method mdy2julian
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.mdy2julian(year, month = 1, day = 1, hour = 0, minute = 0, second = 0, us = 0)
Method mdy2ccsds
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.mdy2ccsds(year, month, day, hour, minute, second, us)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
write_termination_characters,
read_termination_characters,
strip_read_termination = true,
discard_leading_bytes = 0,
sync_pattern = nil,
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, bit_offset, bit_size, data_type, endianness, array_size = nil, overflow = :ERROR)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
min_id_size,
discard_leading_bytes = 0,
sync_pattern = nil,
telemetry = true,
fill_fields = false,
Method mdy2mjd
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.mdy2mjd(year, month = 1, day = 1, hour = 0, minute = 0, second = 0, us = 0)
Method define_item
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def define_item(name, bit_offset, bit_size, data_type, array_size = nil, endianness = @default_endianness, overflow = :ERROR)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(hostname, port = 1883, ssl = false, write_topic = nil, read_topic = nil, protocol_type = nil, *protocol_args)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(hostname, port = 80, protocol = 'http', write_timeout = 5, read_timeout = nil, connect_timeout = 5, include_request_in_response = false)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
name,
bit_offset,
bit_size,
data_type,
endianness,
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
remote_log_directory,
logging_enabled = true,
cycle_time = nil,
cycle_size = 1_000_000_000,
cycle_hour = nil,
Method write
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.write(value, bit_offset, bit_size, data_type, buffer, endianness, overflow)
Method check_overflow
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.check_overflow(value, min_value, max_value, hex_max_value, bit_size, data_type, overflow)
Method check_overflow_array
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.check_overflow_array(values, min_value, max_value, hex_max_value, bit_size, data_type, overflow)
Method run
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
scope,
name,
suite_runner = nil,
disconnect = false,
environment = nil,
Method spawn
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.spawn(scope, name, suite_runner = nil, disconnect = false, environment = nil, user_full_name = nil, username = nil)
Similar blocks of code found in 9 locations. Consider refactoring. Open
build_cmd(target_name, command_name, param_list) {
if (command_name === undefined) {
return this.exec('build_cmd', target_name)
} else {
return this._cmd('build_cmd', target_name, command_name, param_list)
- 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 52.
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