Grupo-AFAL/frontend-helpers

View on GitHub

Showing 32 of 36 total issues

Method render has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def self.render(template, form, method, options, &block)
Severity: Minor
Found in lib/frontend_helpers/field_group_wrapper.rb - About 35 mins to fix

    Method content_tag has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def content_tag(name, content_or_options_with_block = nil, options = nil, escape = true, &block)
    Severity: Minor
    Found in lib/frontend_helpers/builder_html_utils.rb - About 35 mins to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      export const toFloat = number => {
      return parseFloat(number.length === 0 ? '0' : number.replace(/,/g, ''))
      }
      Severity: Minor
      Found in javascript/src/utils/formatters.js and 1 other location - About 35 mins to fix
      javascript/src/utils/formatters.js on lines 21..23

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      export const toInt = number => {
      return parseInt(number.length === 0 ? '0' : number.replace(/,/g, ''))
      }
      Severity: Minor
      Found in javascript/src/utils/formatters.js and 1 other location - About 35 mins to fix
      javascript/src/utils/formatters.js on lines 17..19

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      this.element.addEventListener('turbo:submit-end', e => {
      this.enableButton(e.detail.formSubmission.submitter)
      })
      Severity: Minor
      Found in javascript/src/controllers/submit-button-controller.js and 1 other location - About 30 mins to fix
      javascript/src/controllers/submit-button-controller.js on lines 12..14

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      this.element.addEventListener('turbo:submit-start', e => {
      this.disableButton(e.detail.formSubmission.submitter)
      })
      Severity: Minor
      Found in javascript/src/controllers/submit-button-controller.js and 1 other location - About 30 mins to fix
      javascript/src/controllers/submit-button-controller.js on lines 16..18

      Method submit_actions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def submit_actions(value, options = {})
      cancel_path = options.delete(:cancel_path) || ''
      cancel_options = options.delete(:cancel_options) || {}
       
      field_data = options.delete(:field_data)
      Severity: Minor
      Found in lib/frontend_helpers/shared_form_builder_utils.rb - About 25 mins to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      def percentage_field_group(method, options = {})
      options.with_defaults!(
      placeholder: 0,
      addon_right: tag.span('%', class: 'button is-static'),
      step: '0.01',
      Severity: Minor
      Found in lib/frontend_helpers/field_group_builders.rb and 1 other location - About 25 mins to fix
      lib/frontend_helpers/field_group_builders.rb on lines 136..145

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      def currency_field_group(method, options = {})
      options.with_defaults!(
      placeholder: 0,
      addon_left: tag.span('$', class: 'button is-static'),
      step: '0.01',
      Severity: Minor
      Found in lib/frontend_helpers/field_group_builders.rb and 1 other location - About 25 mins to fix
      lib/frontend_helpers/field_group_builders.rb on lines 149..158

      Method time_field has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def time_field(method, options = {})
      options[:wrapper_options] = {
      'data-datepicker-enable-time-value': true,
      'data-datepicker-no-calendar-value': true
      }
      Severity: Minor
      Found in lib/frontend_helpers/shared_form_builder_utils.rb - About 25 mins to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      addon_left = @template.content_tag(:div, class: 'control') do
      @template.link_to icon_tag('minus'), '', class: button_class, disabled: disabled,
      data: disabled ? {} : subtract_button_data,
      title: 'subtract'
      end
      Severity: Minor
      Found in lib/frontend_helpers/shared_form_builder_utils.rb and 1 other location - About 15 mins to fix
      lib/frontend_helpers/shared_form_builder_utils.rb on lines 184..188

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      addon_right = @template.content_tag(:div, class: 'control') do
      @template.link_to icon_tag('plus'), '', class: button_class, disabled: disabled,
      data: disabled ? {} : add_button_data,
      title: 'add'
      end
      Severity: Minor
      Found in lib/frontend_helpers/shared_form_builder_utils.rb and 1 other location - About 15 mins to fix
      lib/frontend_helpers/shared_form_builder_utils.rb on lines 174..178
      Severity
      Category
      Status
      Source
      Language