Showing 7 of 13 total issues
Class Base
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
def initialize(app = nil, *args, &block)
@app = app
@concat = block_given? && @app.respond_to?(:concat_content)
@options = extract_options_from(*args, &block).dup
Method static_control_string
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def static_control_string(text, options = {})
content_tag :div, class: 'form-group' do
if inline_form?
label = content_tag :label, options[:label], class: 'sr-only' if options[:label]
field = content_tag :p, text, class: 'form-control-static'
- 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 link_to
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def link_to(*args, &block)
link_to = Bh::LinkTo.new self, *args, &block
link_to.append_class! :'alert-link' if Bh::Stack.find(Bh::AlertBox)
link_to.append_class! :'navbar-brand' if Bh::Stack.find(Bh::Vertical)
- 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 button_to
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def button_to(*args, &block)
button_to = Bh::ButtonTo.new self, *args, &block
if button_to.extract! :context, :size, :layout
button_to.append_button_class! :btn
- 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 select
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def select(method, choices = nil, options = {}, html_options = {}, &block)
Method label_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def label_options(errors = {})
klass = []
klass << 'sr-only' if inline_form?
klass << 'col-sm-3' if horizontal_form?
klass << 'control-label' if horizontal_form?
- 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 fields_for
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fields_for(record_name, record_object = nil, fields_options = {}, &block)
if record_object.is_a?(Hash) && record_object.extractable_options?
record_object, fields_options = nil, record_object
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"