jameshuynh/formnestic

View on GitHub

Showing 7 of 11 total issues

Method formnestic_table_semantic_fields_for has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def formnestic_table_semantic_fields_for(
        record_or_name_or_array, *args, &block
      )
        options = args.dup.extract_options!
        formnestic_add_table_headers_form_attributes
Severity: Minor
Found in lib/formnestic/form_builder/table_form_builder.rb - About 1 hr to fix

    Method formnestic_list_semantic_fields_for has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def formnestic_list_semantic_fields_for(
            record_or_name_or_array,
            *args,
            &block
          )
    Severity: Minor
    Found in lib/formnestic/form_builder/list_form_builder.rb - About 1 hr to fix

      Method formnestic_list_row_inputs has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def formnestic_list_row_inputs(*args, &block)
              html_options =
                formnestic_prepare_html_options_for_wrapper(:list, *args)
              rows_counter =
                template.content_tag(
      Severity: Minor
      Found in lib/formnestic/helpers/inputs_helper.rb - About 1 hr to fix

        Method extend_form_builder has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def extend_form_builder
              Formtastic::FormBuilder.send(
                :alias_method,
                :formtastic_semantic_fields_for,
                :semantic_fields_for
        Severity: Minor
        Found in lib/formnestic/formtastic_extensions.rb - About 1 hr to fix

          Method formnestic_table_row_inputs has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def formnestic_table_row_inputs(*args, &block)
                  html_options =
                    formnestic_prepare_html_options_for_wrapper(:table, *args)
                  template.content_tag(
                    :tr, [
          Severity: Minor
          Found in lib/formnestic/helpers/inputs_helper.rb - About 1 hr to fix

            Method formnestic_link_to_add_fields_with_content has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def formnestic_link_to_add_fields_with_content(
                    record_or_name_or_array, *args, &block
                  )
                    relationship = object.class.reflections[record_or_name_or_array.to_s]
                    if relationship.nil?
            Severity: Minor
            Found in lib/formnestic/form_builder/base_builder.rb - About 1 hr to fix

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

                    def formnestic_link_to_add_fields_with_content(
                      record_or_name_or_array, *args, &block
                    )
                      relationship = object.class.reflections[record_or_name_or_array.to_s]
                      if relationship.nil?
              Severity: Minor
              Found in lib/formnestic/form_builder/base_builder.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

              Severity
              Category
              Status
              Source
              Language