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,
Severity: Major
Found in lib/cw/dsl.rb - About 1 day to fix

    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
    Severity: Minor
    Found in lib/cw/tester.rb - About 6 hrs to fix

      Class Tx has 48 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class Tx < Tester
      
          include ToneHelpers
          include FileDetails
      
      
      Severity: Minor
      Found in lib/cw/tx.rb - About 6 hrs to fix

        File tx.rb has 425 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module CW
          class Tx < Tester
        
            include ToneHelpers
            include FileDetails
        Severity: Minor
        Found in lib/cw/tx.rb - About 6 hrs to fix

          Class Book has 33 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class Book < Tester
          
              include FileDetails
          
              def initialize book_details
          Severity: Minor
          Found in lib/cw/book.rb - About 4 hrs to fix

            Class Words has 32 methods (exceeds 20 allowed). Consider refactoring.
            Open

              class Words
            
                include TextHelpers
            
                def load args
            Severity: Minor
            Found in lib/cw/words.rb - About 4 hrs to fix

              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
              Severity: Minor
              Found in lib/cw/encoding.rb - About 3 hrs to fix

              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
              Severity: Minor
              Found in lib/cw/tester.rb - About 3 hrs to fix

              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]}"
              Severity: Minor
              Found in lib/cw/read.rb - About 3 hrs to fix

              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
              Severity: Minor
              Found in lib/cw/print.rb - About 3 hrs to fix

                Class ToneGenerator has 28 methods (exceeds 20 allowed). Consider refactoring.
                Open

                  class ToneGenerator
                
                    MUTE = false
                
                    include ToneHelpers
                Severity: Minor
                Found in lib/cw/tone_generator.rb - About 3 hrs to fix

                  Class Sentence has 25 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                    class Sentence
                  
                      attr_accessor :index #todo
                  
                      def text              ; @text ||= String.new   ; end
                  Severity: Minor
                  Found in lib/cw/sentence.rb - About 2 hrs to fix

                    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
                    Severity: Minor
                    Found in lib/cw/read.rb - About 2 hrs to fix

                      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
                      Severity: Major
                      Found in lib/cw/tx.rb - About 2 hrs to fix

                        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)
                        Severity: Minor
                        Found in lib/cw/tx.rb - About 2 hrs to fix

                        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
                        Severity: Minor
                        Found in lib/cw/tester.rb - About 2 hrs to fix

                        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
                        Severity: Minor
                        Found in lib/cw/read.rb - About 1 hr to fix

                          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
                          
                          
                          Severity: Minor
                          Found in lib/cw/read.rb - About 1 hr to fix

                          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
                          Severity: Minor
                          Found in lib/cw/tx.rb - About 1 hr to fix

                          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,"
                          Severity: Minor
                          Found in lib/cw/tx.rb - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language