Showing 22 of 22 total issues
File form_builder.rb
has 415 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "bootstrap_options"
module ComfyBootstrapForm
class FormBuilder < ActionView::Helpers::FormBuilder
Method draw_choices
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def draw_choices(bootstrap, type, method, collection, value_method, text_method, _options, html_options)
draw_form_group_fieldset(bootstrap, method) do
if bootstrap.custom_control
label_css_class = "custom-control-label"
- 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 check_box
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def check_box(method, options = {}, checked_value = "1", unchecked_value = "0")
bootstrap = form_bootstrap.scoped(options.delete(:bootstrap))
return super if bootstrap.disabled
help_text = draw_help(bootstrap)
- 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 radio_button
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def radio_button(method, tag_value, options = {})
bootstrap = form_bootstrap.scoped(options.delete(:bootstrap))
return super if bootstrap.disabled
help_text = draw_help(bootstrap)
- 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
Class FormBuilder
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class FormBuilder < ActionView::Helpers::FormBuilder
FIELD_HELPERS = %w[
color_field date_field datetime_field email_field month_field
password_field phone_field range_field search_field text_area
Function exports
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(api) {
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env()
var isDevelopmentEnv = api.env('development')
var isProductionEnv = api.env('production')
Method draw_input_group
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def draw_input_group(bootstrap, errors, &block)
prepend_html = draw_input_group_content(bootstrap, :prepend)
append_html = draw_input_group_content(bootstrap, :append)
help_text = draw_help(bootstrap)
- 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 draw_choices
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def draw_choices(bootstrap, type, method, collection, value_method, text_method, _options, html_options)
draw_form_group_fieldset(bootstrap, method) do
if bootstrap.custom_control
label_css_class = "custom-control-label"
Method check_box
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_box(method, options = {}, checked_value = "1", unchecked_value = "0")
bootstrap = form_bootstrap.scoped(options.delete(:bootstrap))
return super if bootstrap.disabled
help_text = draw_help(bootstrap)
Method radio_button
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def radio_button(method, tag_value, options = {})
bootstrap = form_bootstrap.scoped(options.delete(:bootstrap))
return super if bootstrap.disabled
help_text = draw_help(bootstrap)
Method draw_form_group_fieldset
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def draw_form_group_fieldset(bootstrap, method)
options = {}
unless bootstrap.label[:hide]
label_text = bootstrap.label[:text]
- 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 draw_form_group_fieldset
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def draw_form_group_fieldset(bootstrap, method)
options = {}
unless bootstrap.label[:hide]
label_text = bootstrap.label[:text]
Method draw_choices
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def draw_choices(bootstrap, type, method, collection, value_method, text_method, _options, html_options)
Method collection_check_boxes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {})
Method file_field
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def file_field(method, options = {})
bootstrap = form_bootstrap.scoped(options.delete(:bootstrap))
return super if bootstrap.disabled
draw_form_group(bootstrap, method, options) 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
Method collection_select
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def collection_select(method, collection, value_method, text_method, options = {}, html_options = {})
Method collection_radio_buttons
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def collection_radio_buttons(method, collection, value_method, text_method, options = {}, html_options = {})
Method form_group
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def form_group(options = {})
bootstrap = form_bootstrap.scoped(options.delete(:bootstrap))
label_options = bootstrap.label.clone
label_text = label_options.delete(:text)
- 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 draw_errors
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def draw_errors(bootstrap, method)
errors = []
if bootstrap.error.present?
errors = [bootstrap.error]
- 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"