File shared_form_builder_utils.rb
has 275 lines of code (exceeds 250 allowed). Consider refactoring.
module FrontendHelpers
module SharedFormBuilderUtils
include BuilderHtmlUtils
def label(method, text = nil, options = {}, &block)
Method step_number_field
has 31 lines of code (exceeds 25 allowed). Consider refactoring.
def step_number_field(method, options = {})
options[:data] ||= {}
options[:data]['step-number-input-target'] = 'input'
subtract_data = options.delete(:subtract_data) || {}
Method file_field_group
has 29 lines of code (exceeds 25 allowed). Consider refactoring.
def file_field_group(method, options = {})
options.with_defaults!(
class: 'file-input',
data: { action: 'file-input#onChange' }
)
Function fillInAddress
has 29 lines of code (exceeds 25 allowed). Consider refactoring.
fillInAddress () {
const place = this.autocomplete.getPlace()
for (const component of place.address_components) {
const componentType = component.types[0]
Method step_number_field
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def step_number_field(method, options = {})
options[:data] ||= {}
options[:data]['step-number-input-target'] = 'input'
subtract_data = options.delete(:subtract_data) || {}
Method time_field
has 27 lines of code (exceeds 25 allowed). Consider refactoring.
def time_field(method, options = {})
options[:wrapper_options] = {
'data-datepicker-enable-time-value': true,
'data-datepicker-no-calendar-value': true
}
Method slim_select_field
has 27 lines of code (exceeds 25 allowed). Consider refactoring.
def slim_select_field(method, values, options = {}, html_options = {})
html_options.with_defaults!(multiple: false, 'data-slim-select-target': 'select')
options.with_defaults!(
add_items: false,
Function default
has 27 lines of code (exceeds 25 allowed). Consider refactoring.
export default function (options = {}) {
promise =
promise ||
new Promise((resolve, reject) => {
Function setValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
setValue () {
this.value = Math.max(Math.min(this.value, this.maxValue), this.minValue)
this.inputTarget.value = this.value
if (this.hasAddTarget) {
Method content_tag
has 5 arguments (exceeds 4 allowed). Consider refactoring.
def content_tag(name, content_or_options_with_block = nil, options = nil, escape = true, &block)
Method switch_field_group
has 5 arguments (exceeds 4 allowed). Consider refactoring.
def switch_field_group(method, options = {},
checked_value = '1', unchecked_value = '0', &block)
Method render
has 5 arguments (exceeds 4 allowed). Consider refactoring.
def self.render(template, form, method, options, &block)
Method time_field
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def time_field(method, options = {})
options[:wrapper_options] = {
'data-datepicker-enable-time-value': true,
'data-datepicker-no-calendar-value': true
}
Method submit_actions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def submit_actions(value, options = {})
cancel_path = options.delete(:cancel_path) || ''
cancel_options = options.delete(:cancel_options) || {}
field_data = options.delete(:field_data)