lib/highline.rb
Class HighLine
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class HighLine
include BuiltinStyles
include CustomErrors
extend SingleForwardable
Method get_line_raw_no_echo_mode
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
Open
def get_line_raw_no_echo_mode(question)
line = ""
terminal.raw_no_echo_mode_exec do
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
File highline.rb
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "English"
require "erb"
require "optparse"
require "stringio"
require "highline/terminal"
Method choose
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def choose(*items, &details)
menu = Menu.new(&details)
menu.choices(*items) unless items.empty?
# Set auto-completion
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def initialize(input = $stdin, output = $stdout,
wrap_at = nil, page_at = nil,
indent_size = 3, indent_level = 0)