ophrescue/RescueRails

View on GitHub

Showing 159 of 254 total issues

Avoid too many return statements within this function.
Open

                                } else if (n = g(n, a, r, f)) return !0;
Severity: Major
Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                            if (void 0 === e) return this.each((function() {
                                (a = new n.default(t)).mask(this);
                            }));
    Severity: Major
    Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                                          if (o.begin > p && o.end <= p) return a === n.radixPoint ? {
                                              insert: {
                                                  pos: p + 1,
                                                  c: "0",
                                                  fromIsValid: !0
      Severity: Major
      Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                                    if (a === n.groupSeparator) return {
                                        caret: h
                                    };
        Severity: Major
        Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                                      if (-1 !== p && !0 === n._radixDance && !1 === i && a === n.radixPoint && void 0 !== n.digits && (isNaN(n.digits) || parseInt(n.digits) > 0) && p !== t) return {
                                          caret: n._radixDance && t === p - 1 ? p + 1 : p
                                      };
          Severity: Major
          Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                                if (o.begin < p) return {
                                                    rewritePosition: o.begin - 1
                                                };
            Severity: Major
            Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                          return {
                                              rewritePosition: t
                                          };
              Severity: Major
              Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                            return i;
                Severity: Major
                Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                              } else if (!n.showMaskOnHover && !n.showMaskOnFocus && !n.digitsOptional && n.digits > 0 && "" === this.__valueGet.call(this.el)) return {
                                                  rewritePosition: p
                                              };
                  Severity: Major
                  Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                                            return i.jit && (s.jitOffset[e] = z.matches.length - z.matches.indexOf(i)), !0;
                    Severity: Major
                    Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                          return !1;
                      Severity: Major
                      Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                                    if (s) return !0;
                        Severity: Major
                        Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                                          if (n.digitsOptional) return {
                                                              rewritePosition: o.end
                                                          };
                          Severity: Major
                          Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                                    return !1;
                            Severity: Major
                            Found in app/assets/javascripts/jquery.inputmask.js - About 30 mins to fix

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

                                def classify_foreign_key(audit_column, audit_type)
                                  reflections = audit_type.reflect_on_all_associations(:belongs_to).select { |r| r.foreign_key == audit_column } if audit_type.respond_to?(:reflect_on_all_associations)
                                  return reflections.first.class_name.safe_constantize if reflections&.any?
                              
                                  if audit_column =~ /_id$/
                              Severity: Minor
                              Found in app/helpers/audits_helper.rb - About 25 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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def initialize(params) # params is string with indifferent access
                                  @params = params[:filter_params] || {}
                                  # @params[:sort] == @params["sort"]
                                  # e.g. @params["search_field_text"] = "Tracking ID"
                                  @params["search_field_text"] = @params["search_field_index"] && Dog::SEARCH_FIELDS.as_options[@params["search_field_index"]]
                              Severity: Minor
                              Found in app/models/dog_filter.rb - About 25 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 search has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def search
                                  @users = User
                              
                                  if text_search?
                                    if email_search?
                              Severity: Minor
                              Found in app/models/user_searcher.rb - About 25 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 sortable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def sortable(column, title = nil)
                                  title ||= column.titleize
                                  css_id = "sort_by_#{column}"
                                  css_class = column == params[:sort] ? "current #{params[:direction]}" : nil
                                  direction = column == params[:sort] && params[:direction] == 'asc' ? 'desc' : 'asc'
                              Severity: Minor
                              Found in app/helpers/application_helper.rb - About 25 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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def initialize(params) # params is string with indifferent access
                                  @params = params[:filter_params] || {}
                                  # @params[:sort] == @params["sort"]
                                  # e.g. @params["search_field_text"] = "Tracking ID"
                                  @params["search_field_text"] = @params["search_field_index"] && Cat::SEARCH_FIELDS.as_options[@params["search_field_index"]]
                              Severity: Minor
                              Found in app/models/cat_filter.rb - About 25 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