shivam091/rails_bootstrap_form

View on GitHub

Showing 12 of 16 total issues

Method grouped_collection_select has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def grouped_collection_select(attribute, collection, group_method, group_label_method, option_key_method, option_value_method, options = {}, html_options = {})
Severity: Major
Found in lib/rails_bootstrap_form/inputs/grouped_collection_select.rb - About 1 hr to fix

    Method inputs_collection has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            def inputs_collection(attribute, collection, value_method, text_method, bootstrap, options = {})
    Severity: Minor
    Found in lib/rails_bootstrap_form/inputs/base.rb - About 45 mins to fix

      Method collection_select has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def collection_select(attribute, collection, value_method, text_method, options = {}, html_options = {})
      Severity: Minor
      Found in lib/rails_bootstrap_form/inputs/collection_select.rb - About 45 mins to fix

        Method build_input_options has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              def build_input_options(object, attribute, value_method, text_method, bootstrap, options)
        Severity: Minor
        Found in lib/rails_bootstrap_form/inputs/base.rb - About 45 mins to fix

          Method collection_check_boxes has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def collection_check_boxes(attribute, collection, value_method, text_method, options = {}, html_options = {})
          Severity: Minor
          Found in lib/rails_bootstrap_form/inputs/collection_check_boxes.rb - About 45 mins to fix

            Method collection_radio_buttons has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    def collection_radio_buttons(attribute, collection, value_method, text_method, options = {}, html_options = {})
            Severity: Minor
            Found in lib/rails_bootstrap_form/inputs/collection_radio_buttons.rb - About 45 mins to fix

              Method associated_error_messages has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                    def associated_error_messages(attribute)
                      error_messages = []
              
                      object.class.try(:reflections)&.each do |association_name, association|
                        next unless is_belongs_to_association?(association)
              Severity: Minor
              Found in lib/rails_bootstrap_form/helpers/errors.rb - About 45 mins to fix

              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 build_floating_layout_content has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def build_floating_layout_content(attribute, bootstrap, label, help_text, &block)
              Severity: Minor
              Found in lib/rails_bootstrap_form/field_wrapper_builder.rb - About 35 mins to fix

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

                    def field_wrapper_builder(attribute, bootstrap, options, html_options = nil, &block)
                Severity: Minor
                Found in lib/rails_bootstrap_form/field_wrapper_builder.rb - About 35 mins to fix

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

                      def build_default_layout_content(attribute, bootstrap, label, help_text, &block)
                  Severity: Minor
                  Found in lib/rails_bootstrap_form/field_wrapper_builder.rb - About 35 mins to fix

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

                            def select(attribute, choices = nil, options = {}, html_options = {}, &block)
                    Severity: Minor
                    Found in lib/rails_bootstrap_form/inputs/select.rb - About 35 mins to fix

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

                          def build_horizontal_layout_content(attribute, bootstrap, label, help_text, &block)
                      Severity: Minor
                      Found in lib/rails_bootstrap_form/field_wrapper_builder.rb - About 35 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language