Showing 55 of 55 total issues

Avoid too many return statements within this method.
Open

          return store
Severity: Major
Found in lib/cw/tx.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

              return
    Severity: Major
    Found in lib/cw/tx.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                return info
      Severity: Major
      Found in lib/cw/tx.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return '*' unless temp
        Severity: Major
        Found in lib/cw/encoding.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                    return capture_attribute :temperature, upcase
          Severity: Major
          Found in lib/cw/tx.rb - About 30 mins to fix

            Method sync_with_play has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def sync_with_play
                  loop do
                    break if sentence_index_current?
                    break if quit?
                    sleep 0.015
            Severity: Minor
            Found in lib/cw/tester.rb - About 25 mins 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 mid has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def mid first, last
                  results = []
                  count = 0
                  File.foreach(dictionary).collect do |line|
                    if (count >= first) && (count <= last)
            Severity: Minor
            Found in lib/cw/common_words.rb - About 25 mins 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 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
            Severity: Minor
            Found in lib/cw/tx.rb - About 25 mins 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 close_threads has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def close_threads
                  await_termination_count = 0
                  loop do
                    sleep 0.1
                    break unless any_thread_open?()
            Severity: Minor
            Found in lib/cw/threads.rb - About 25 mins 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 missing_letters_or_numbers? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def missing_letters_or_numbers?
                  if @options && @options[:letters_numbers]
                    return true if has_no_letter?
                    return true if has_no_number?
                  end
            Severity: Minor
            Found in lib/cw/randomize.rb - About 25 mins 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 build_word_maybe has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def build_word_maybe
                  @input_word ||= ''
                  @input_word << key_chr if is_relevant_char?
                  if @book_details.args[:output] == :letter
                    move_word_to_process if is_relevant_char? #todo
            Severity: Minor
            Found in lib/cw/book.rb - About 25 mins 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 select_part has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def select_part country = :uk, partial
                  pc = rand_val
                  weight = callsigns[country][partial][:weight]
                  tot_wt = 0
                  weight.each_with_index do |wt, idx|
            Severity: Minor
            Found in lib/cw/callsign.rb - About 25 mins 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 print_words has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def print_words words
                  timing.init_char_timer
                  (words.to_s + ' ').each_char do |letr|
                    process_letter letr
                    loop do
            Severity: Minor
            Found in lib/cw/repeat_word.rb - About 25 mins 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 wait_for_start_sync has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def wait_for_start_sync
                  timeout = Time.now + 5
                  until play.start_sync?
                    sleep 0.001
                    break if quit?
            Severity: Minor
            Found in lib/cw/tester.rb - About 25 mins 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 fail_unmarked_inactive_elements has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def fail_unmarked_inactive_elements
                  if(( ! stream_empty?) && (count > @active_region))
                    @first_element.upto(inactive_region) do |count|
                      @success[count] = false unless @success[count] == true
                    end
            Severity: Minor
            Found in lib/cw/stream.rb - About 25 mins 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

            Severity
            Category
            Status
            Source
            Language