Showing 47 of 67 total issues
Method output
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def output
Vedeu.timer("Drawing border: '#{name}'") do
[
(top if top?),
(left if left?),
- 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 bordered_height
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def bordered_height
return height unless border && enabled?
if top? && bottom?
height - 2
- 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 stream
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def stream(value = '', opts = {}, &block)
requires_model!
attrs = build_attributes(value, opts, &block)
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(context = nil,
model = nil,
value = '',
options = {},
&block)
Method build
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.build(context = nil,
model = nil,
value = '',
options = {},
&block)
Method execute!
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.execute!(argv = [],
stdin = STDIN,
stdout = STDOUT,
stderr = STDERR,
kernel = Kernel)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(argv = [],
stdin = STDIN,
stdout = STDOUT,
stderr = STDERR,
kernel = Kernel)
Method pair
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def pair
if maximised?
[1, default]
elsif bottom_aligned? || right_aligned?
- 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 add_action
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_action(controller, action)
if present?(controller) && present?(action)
Vedeu.log(type: :create,
message: "Action: ':#{action}' " \
"(for ':#{controller}')")
- 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 coerce
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def coerce
if coerced?
value
elsif value.is_a?(Vedeu::Models::Row)
- 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 stop
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def stop
log('Attempting to stop')
return not_enabled unless Vedeu.config.drb?
- 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 coerce
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def coerce
raise Vedeu::Error::InvalidSyntax unless hash?(value)
if colour? && hash?(colour)
Vedeu::Coercers::ColourAttributes.coerce(colour)
- 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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def read
keys = console.getch
if keys.ord == Vedeu::ESCAPE_KEY_CODE
keys << console.read_nonblock(4) rescue nil
- 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 switch_mode!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def switch_mode!(mode = nil)
if present?(mode) && valid_mode?(mode)
Vedeu.configure { |config| config.terminal_mode = mode }
else
- 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 _dn
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _dn
if dn
dn
elsif d.nil? && d_dn
- 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 items
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def items
items = []
collection.each_with_index do |item, index|
items << if index == @current && index == @selected
[true, true, item]
- 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 compress
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compress
Vedeu.timer('Removing duplicate cells...') do
content.map do |cell|
character = character_for(cell)
- 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 snake_case
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def snake_case(klass)
str = klass.is_a?(Module) ? klass.name : klass
str.split(/::/).map do |namespace|
*upper, _ = namespace.split(/([A-Z]+)/).reject(&:empty?).map do |chars|
- 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 escape_sequence
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def escape_sequence
return '' if empty?
if registered?(colour)
retrieve(colour)
- 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 end_coordinate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def end_coordinate
if d_dn
(d_dn > default) ? default : d_dn
elsif dn
- 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"