shivam091/rails_bootstrap_form

View on GitHub

Showing 16 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

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

                          module Inputs
                            module RangeField
                              extend ActiveSupport::Concern
                        
                              included do
                        Severity: Minor
                        Found in lib/rails_bootstrap_form/inputs/range_field.rb and 1 other location - About 35 mins to fix
                        lib/rails_bootstrap_form/inputs/color_field.rb on lines 6..19

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 35.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                          module Inputs
                            module ColorField
                              extend ActiveSupport::Concern
                        
                              included do
                        Severity: Minor
                        Found in lib/rails_bootstrap_form/inputs/color_field.rb and 1 other location - About 35 mins to fix
                        lib/rails_bootstrap_form/inputs/range_field.rb on lines 6..19

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 35.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                                  inputs = inputs_collection(attribute, collection, value_method, text_method, bootstrap, options) do |attribute, value, options|
                                    bootstrap_opts = bootstrap_form_options.scoped(options.delete(:bootstrap))
                        
                                    tag.div(class: choice_wrapper_classes(bootstrap_opts)) do
                                      bootstrap_radio_button(attribute, value, options, bootstrap_opts)
                        Severity: Minor
                        Found in lib/rails_bootstrap_form/inputs/collection_radio_buttons.rb and 1 other location - About 25 mins to fix
                        lib/rails_bootstrap_form/inputs/collection_check_boxes.rb on lines 19..23

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 29.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                                  inputs = inputs_collection(attribute, collection, value_method, text_method, bootstrap, options) do |attribute, value, options|
                                    bootstrap_opts = bootstrap_form_options.scoped(options.delete(:bootstrap))
                        
                                    tag.div(class: choice_wrapper_classes(bootstrap_opts)) do
                                      bootstrap_check_box(attribute, value, options, bootstrap_opts)
                        Severity: Minor
                        Found in lib/rails_bootstrap_form/inputs/collection_check_boxes.rb and 1 other location - About 25 mins to fix
                        lib/rails_bootstrap_form/inputs/collection_radio_buttons.rb on lines 17..21

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 29.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language