activescaffold/active_scaffold

View on GitHub

Showing 273 of 362 total issues

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

      def active_scaffold_record_select(record, column, options, value, multiple, ui_options: column.options)
Severity: Minor
Found in lib/active_scaffold/bridges/record_select/helpers.rb - About 35 mins to fix

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

        def initialize(name, default, sql_type = nil, null = true, **)
    Severity: Minor
    Found in lib/active_scaffold/tableless.rb - About 35 mins to fix

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

          def find_template(name, prefixes = [], partial = false, keys = [], options = {})
      Severity: Minor
      Found in lib/active_scaffold/extensions/action_view_rendering.rb - About 35 mins to fix

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

              def pagination_ajax_links(current_page, url_options, options, inner_window, outer_window)
        Severity: Minor
        Found in lib/active_scaffold/helpers/pagination_helpers.rb - About 35 mins to fix

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

                def usa_state_select(object, method, priority_states = nil, options = {}, html_options = {})
          Severity: Minor
          Found in lib/active_scaffold/bridges/usa_state_select/usa_state_select_helper.rb - About 35 mins to fix

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

                  def active_scaffold_file_with_content(column, content, options, remove_file_prefix, controls_class)
            Severity: Minor
            Found in lib/active_scaffold/helpers/form_column_helpers.rb - About 35 mins to fix

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

                    def form_attribute(column, record, scope = nil, only_value = false, col_class = nil)
              Severity: Minor
              Found in lib/active_scaffold/helpers/form_column_helpers.rb - About 35 mins to fix

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

                      def active_scaffold_checkbox_option(option, label_method, associated_ids, checkbox_options, li_options = {})
                Severity: Minor
                Found in lib/active_scaffold/helpers/form_column_helpers.rb - About 35 mins to fix

                  Method links_for_associations has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def links_for_associations
                          return unless active_scaffold_config.actions.include?(:list) && active_scaffold_config.actions.include?(:nested)
                          active_scaffold_config.columns.each do |column|
                            next unless column.link.nil? && column.autolink?
                            # lazy load of action_link, cause it was really slowing down app in dev mode
                  Severity: Minor
                  Found in lib/active_scaffold/core.rb - About 35 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

                  Function stripe has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    stripe: function(tbody_id) {
                      var even = false;
                      var rows = this.records_for(tbody_id);
                      for (var i = 0; i < rows.length; i++) {
                        var child = rows[i];
                  Severity: Minor
                  Found in app/assets/javascripts/prototype/active_scaffold.js - About 35 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 update_respond_to_js has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def update_respond_to_js
                        if successful?
                          record_to_refresh_on_update if !render_parent? && active_scaffold_config.actions.include?(:list)
                          flash.now[:info] = as_(:updated_model, :model => ERB::Util.h((@updated_record || @record).to_label)) if active_scaffold_config.update.persistent
                        end
                  Severity: Minor
                  Found in lib/active_scaffold/actions/update.rb - About 35 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 do_update_column has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def do_update_column
                        # delete from params so update :table won't break urls, also they shouldn't be used in sort links too
                        value = params.delete(:value)
                        column = params.delete(:column)
                        params.delete(:original_html)
                  Severity: Minor
                  Found in lib/active_scaffold/actions/update.rb - About 35 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 active_scaffold_input_chosen has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def active_scaffold_input_chosen(column, html_options, ui_options: column.options)
                          html_options[:class] << ' chosen'
                          if column.association&.collection?
                            record = html_options.delete(:object)
                            associated_options, select_options = active_scaffold_plural_association_options(column, record)
                  Severity: Minor
                  Found in lib/active_scaffold/bridges/chosen/helpers.rb - About 35 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 set_outer_joins_for_search has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def set_outer_joins_for_search(columns) # rubocop:disable Naming/AccessorMethodName
                          references = []
                          outer_joins = []
                          columns.each do |column|
                            next if column.search_joins.blank?
                  Severity: Minor
                  Found in lib/active_scaffold/actions/common_search.rb - About 35 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 render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def render(*args, &block)
                        if self.class.uses_active_scaffold? && params[:adapter] && @rendering_adapter.nil? && request.xhr?
                          @rendering_adapter = true # recursion control
                          # if we need an adapter, then we render the actual stuff to a string and insert it into the adapter template
                          opts = args.any? ? args.first : {}
                  Severity: Minor
                  Found in lib/active_scaffold/extensions/action_controller_rendering.rb - About 35 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

                  Function read_inplace_edit_heading_attributes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    read_inplace_edit_heading_attributes: function(column_heading, options) {
                      if (column_heading.readAttribute('data-ie-cancel-text')) options.cancelText = column_heading.readAttribute('data-ie-cancel-text');
                      if (column_heading.readAttribute('data-ie-loading-text')) options.loadingText = column_heading.readAttribute('data-ie-loading-text');
                      if (column_heading.readAttribute('data-ie-saving-text')) options.savingText = column_heading.readAttribute('data-ie-saving-text');
                      if (column_heading.readAttribute('data-ie-save-text')) options.okText = column_heading.readAttribute('data-ie-save-text');
                  Severity: Minor
                  Found in app/assets/javascripts/prototype/active_scaffold.js - About 35 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 respond_to_action has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def respond_to_action(action)
                        return unless !conditional_get_support? || view_stale?
                        respond_to do |type|
                          action_formats.each do |format|
                            type.send(format) do
                  Severity: Minor
                  Found in lib/active_scaffold/actions/core.rb - About 35 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 do_search has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def do_search
                          if search_params.is_a?(String) && search_params.present?
                            query = search_params.to_s.strip
                            columns = active_scaffold_config.search.columns.visible_columns
                            text_search = active_scaffold_config.search.text_search
                  Severity: Minor
                  Found in lib/active_scaffold/actions/search.rb - About 35 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 datetime_options has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def self.datetime_options(locale)
                          rails_time_format = I18n.translate! 'time.formats.picker', :locale => locale, :default => '%a, %d %b %Y %H:%M:%S'
                          datetime_picker_options = {
                            :ampm => false,
                            :hourText => I18n.translate!('datetime.prompts.hour', :locale => locale),
                  Severity: Minor
                  Found in lib/active_scaffold/bridges/date_picker/helper.rb - About 35 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

                  Function replace has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Element.replace = function(element, html) {
                    element = $(element);
                    if (element.outerHTML) {
                      try {
                      element.outerHTML = html.stripScripts();
                  Severity: Minor
                  Found in app/assets/javascripts/prototype/active_scaffold.js - About 35 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