Class Tx
has 48 methods (exceeds 20 allowed). Consider refactoring. Open
class Tx < Tester
include ToneHelpers
include FileDetails
File tx.rb
has 425 lines of code (exceeds 250 allowed). Consider refactoring. Open
module CW
class Tx < Tester
include ToneHelpers
include FileDetails
Method process_letter
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_letter
@input_word ||= ''
case @char
when '#'
return_val = receive_mode
Method capture_attribute
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def capture_attribute(attr_type, use_recording = false)
puts "\n\r"
puts "Enter their #{attr_type.to_s} followed by SPACE" unless use_recording
temp = use_recording ? @recording : []
print.menu temp.join('').delete(' ') if(@recording && ! use_recording)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method write_attribute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def write_attribute attr, type
clip = attr.join('').delete(' ')
@their_callsign = clip if :callsign == type
@their_name = clip if :name == type
@their_rst = clip if :rst == type
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method capture
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def capture
puts "\n\r"
puts "\r Menu: [C]allsign, [N]ame, "
puts "\r [L]ocation, [R]st, "
puts "\r [T]emperature, [S]tore,"
Method receive_mode
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def receive_mode
print_mode :rx
loop do
char = key_input.read
check_clear char
Method monitor_keys
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def monitor_keys
@char = '#'
process_letter
loop do
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method process_letter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process_letter
@input_word ||= ''
case @char
when '#'
return_val = receive_mode
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this method. Open
return store
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return info
Avoid too many return
statements within this method. Open
return capture_attribute :temperature, upcase
Method receive_mode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def receive_mode
print_mode :rx
loop do
char = key_input.read
check_clear char
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"