Showing 55 of 55 total issues
Class Dsl
has 63 methods (exceeds 20 allowed). Consider refactoring. Open
class Dsl
include CW::Cfg
include CW::FileDetails
[:wpm, :effective_wpm, :frequency, :audio_filename,:audio_dir,
Class Tester
has 49 methods (exceeds 20 allowed). Consider refactoring. Open
class Tester
def quit ; Cfg.config.params["quit"] = true ; end
def quit? ; Cfg.get_param("quit") ; end
def exit! ; Cfg.config.params["exit"] = true ; end
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
Class Book
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Book < Tester
include FileDetails
def initialize book_details
Class Words
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class Words
include TextHelpers
def load args
Method match_elements
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def match_elements arg
chars = []
encodings.each_pair do |key, value|
chars << key unless value.include?(:dot) if arg[0] == :dashes
chars << key unless value.include?(:dash) if arg[0] == :dots
- 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_letters
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def process_letters letr
loop do
do_events
if self.class == Book
process_space_maybe(letr) unless @book_details.args[:output] == :letter
- 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 decode_signal
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def decode_signal
if(@state[FILTERED])
@state[FILTERED] = false
@need_space = true
#dbg_print "wpm #{@wpm.to_s}\nhigh period: #{@high[PERIOD]}\nhigh avg: #{@high[AVG]}"
- 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
Class Print
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Print
class ProgressPrint
def colour
:yellow
Class ToneGenerator
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class ToneGenerator
MUTE = false
include ToneHelpers
Class Sentence
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Sentence
attr_accessor :index #todo
def text ; @text ||= String.new ; end
Class Read
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Read
def n ; N ; end
def k ; (0.5 + ((n * @tone / @sample_rate))).to_i ; end
def w ; ((2 * Math::PI) / n) * k ; end
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 process_words
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def process_words words
book_class = (self.class == Book)
(words.to_s + ' ').each_char do |letr|
process_letter letr
if book_class
- 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 initialize
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(filename)
@tone = TONE
@mag_max = 0
@mag_min = 999999999
@sample_rate = SAMPLE_RATE
Method calc_filtered_state
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def calc_filtered_state
if real_state_change?
reset_noise_blanker
end
- 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,"