Showing 13 of 13 total issues
Method accumulate_hex_input
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def accumulate_hex_input
unless block_given?
raise ArgumentError.new("must pass block")
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
File words.rb
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Sixword
# Dictionary from RFC 2289 Appendix D
# http://tools.ietf.org/html/rfc2289#appendix-D
WORDS = [ "A", "ABE", "ACE", "ACT", "AD", "ADA", "ADD",
Method process_encode_input
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def process_encode_input
unless block_given?
raise ArgumentError.new("block is required")
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 encode_iter
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.encode_iter(byte_string, options={})
options = {words_per_slice: 1, pad: false}.merge(options)
words_per_slice = options.fetch(:words_per_slice)
pad = options.fetch(:pad)
- 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 encode_iter
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.encode_iter(byte_string, options={})
options = {words_per_slice: 1, pad: false}.merge(options)
words_per_slice = options.fetch(:words_per_slice)
pad = options.fetch(:pad)
Method decode_6_words
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.decode_6_words(word_array, padding_ok)
unless word_array.length == 6
raise ArgumentError.new("Must pass a six-word array")
end
Method print_hex
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def print_hex(data, chunk_index, cols=80)
case hex_style
when 'lower', 'lowercase'
# encode to lowercase hex with no newlines
print Sixword::Hex.encode(data)
- 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 accumulate_hex_input
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def accumulate_hex_input
unless block_given?
raise ArgumentError.new("must pass block")
end
Method decode_6_words
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.decode_6_words(word_array, padding_ok)
unless word_array.length == 6
raise ArgumentError.new("Must pass a six-word array")
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 run!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def run!
if encoding?
do_encode! do |encoded|
puts encoded
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 int_to_byte_array
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.int_to_byte_array(int, length=nil)
unless int >= 0
raise ArgumentError.new("Not sure what to do with negative numbers")
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 read_input_by_6_words
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def read_input_by_6_words
word_arr = []
while true
line = stream.gets
- 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 do_encode!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def do_encode!
sentences_per_line = options.fetch(:line_width, 1)
if sentences_per_line <= 0
sentences_per_line = 1 << 32
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"