ophrescue/RescueRails

View on GitHub

Showing 159 of 254 total issues

Function f has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

                function f(e, t, a, i, r, s, d) {
Severity: Major
Found in app/assets/javascripts/jquery.inputmask.js - About 50 mins to fix

    Function postValidation has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

                            postValidation: function(e, t, a, i, n, r, o) {
    Severity: Major
    Found in app/assets/javascripts/jquery.inputmask.js - About 50 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                          if (!1 !== (x = d.call(r, E, b, l)) || "+" === b.match.def) {
                                              "+" === b.match.def && o.getBuffer.call(r, !0);
                                              var S = f.call(r, E, b.input, "+" !== b.match.def, !0);
                                              if (v = !1 !== S, P = (S.pos || E) + 1, !v && x) break;
                                          } else v = !1;
      Severity: Major
      Found in app/assets/javascripts/jquery.inputmask.js - About 45 mins to fix

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

          def init_fields
            @user.build_agreement unless @user.agreement
            @user.build_confidentiality_agreement unless @user.confidentiality_agreement
            @user.build_code_of_conduct_agreement unless @user.code_of_conduct_agreement
            @user.build_insurance_training_agreement unless @user.insurance_training_agreement
        Severity: Minor
        Found in app/controllers/users_controller.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

        Avoid deeply nested control flow statements.
        Open

                                            if (void 0 === t[e] || t[e].input === i.getPlaceholder.call(n, e)) {
                                                if (e < l.call(n, -1)) return !0;
                                                var a = r.call(n).indexOf(c.radixPoint);
                                                if (-1 !== a) {
                                                    for (var o in t) if (t[o] && a < o && t[o].input !== i.getPlaceholder.call(n, o)) return !1;
        Severity: Major
        Found in app/assets/javascripts/jquery.inputmask.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

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

            Avoid deeply nested control flow statements.
            Open

                                                    if (h.forEach((function(e, t) {
                                                        t >= P && (e.match.optionality = !0);
                                                    })), i = h[h.length - 1].match, void 0 !== f || !p(i, x)) return !0;
            Severity: Major
            Found in app/assets/javascripts/jquery.inputmask.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                                  l) for (c in u = void 0, l) if ("alias" === c.toLowerCase()) {
                                                      u = l[c];
                                                      break;
                                                  }
              Severity: Major
              Found in app/assets/javascripts/jquery.inputmask.js - About 45 mins to fix

                Function l has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                                function l(e, t, a, i, r, s) {
                Severity: Minor
                Found in app/assets/javascripts/jquery.inputmask.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                      if (-1 === T || "string" == typeof T) {
                                                          var A, C = d, D = a.slice(), B = [];
                                                          if ("string" == typeof T) B = T.split(","); else for (A = 0; A < S.matches.length; A++) B.push(A.toString());
                                                          if (void 0 !== s.excludes[e]) {
                                                              for (var j = B.slice(), R = 0, L = s.excludes[e].length; R < L; R++) {
                  Severity: Major
                  Found in app/assets/javascripts/jquery.inputmask.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if (o.length > 1 + ("" === o[o.length - 1].match.def ? 1 : 0)) for (var c = 0; c < o.length; c++) if ("" !== o[c].match.def && !0 !== o[c].match.optionality && !0 !== o[c].match.optionalQuantifier && (!0 === o[c].match.static || void 0 === r || !1 !== o[c].match.fn.test(r.match.def, n, e, !0, i)) && (l.push(o[c]),
                                                !0 === o[c].match.static && (r = o[c]), l.length > 1 && /[0-9a-bA-Z]/.test(l[0].match.def))) return i.placeholder.charAt(e % i.placeholder.length);
                    Severity: Major
                    Found in app/assets/javascripts/jquery.inputmask.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                          if (v) {
                                                              void 0 === t && b.match.static && g === e.begin && p++;
                                                              break;
                                                          }
                      Severity: Major
                      Found in app/assets/javascripts/jquery.inputmask.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                                if (l) for (c in u = void 0, l) if (c.toLowerCase() === s.toLowerCase()) {
                                                                    u = l[c];
                                                                    break;
                                                                }
                        Severity: Major
                        Found in app/assets/javascripts/jquery.inputmask.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                              if (y.jitOffset[x] && void 0 === y.validPositions[o.seekNext.call(v, x)] && !1 !== (S = f.call(v, x + y.jitOffset[x], t, !0, !0)) && (!0 !== r && (S.caret = x),
                                                              O = !0), e.end > x && (y.validPositions[x] = void 0), !O && !o.isMask.call(v, x, k.keepStatic && 0 === x)) for (var T = x + 1, A = o.seekNext.call(v, x, !1, 0 !== x); T <= A; T++) if (!1 !== (S = E(T, t, a))) {
                                                                  S = h.call(v, x, void 0 !== S.pos ? S.pos : T) || S, x = T;
                                                                  break;
                                                              }
                          Severity: Major
                          Found in app/assets/javascripts/jquery.inputmask.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                            } else if (n.isQuantifier && f !== t.matches[t.matches.indexOf(n) - 1]) for (var $ = n, q = a.length > 0 ? a.shift() : 0; q < (isNaN($.quantifier.max) ? q + 1 : $.quantifier.max) && d <= e; q++) {
                                                                var z = t.matches[t.matches.indexOf($) - 1];
                                                                if (n = o(z, [ q ].concat(r), z)) {
                                                                    if ((i = h[h.length - 1].match).optionalQuantifier = q >= $.quantifier.min, i.jit = (q + 1) * (z.matches.indexOf(i) + 1) > $.quantifier.jit,
                                                                    i.optionalQuantifier && p(i, z)) {
                            Severity: Major
                            Found in app/assets/javascripts/jquery.inputmask.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                  if (!v && E > s.maskLength) break;
                              Severity: Major
                              Found in app/assets/javascripts/jquery.inputmask.js - About 45 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                                        if (d) k(); else switch (r.charAt(0)) {
                                                          case "$":
                                                          case "^":
                                                            t || k();
                                                            break;
                                Severity: Major
                                Found in app/assets/javascripts/jquery.inputmask.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                                      if (void 0 === e.rawday || !isFinite(e.rawday) && new Date(e.date.getFullYear(), isFinite(e.rawmonth) ? e.month : e.date.getMonth() + 1, 0).getDate() >= e.day || "29" == e.day && !Number.isFinite(e.rawyear) || new Date(e.date.getFullYear(), isFinite(e.rawmonth) ? e.month : e.date.getMonth() + 1, 0).getDate() >= e.day) return t;
                                  Severity: Major
                                  Found in app/assets/javascripts/jquery.inputmask.js - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                                            if (this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache),
                                                            void 0 === this.el || void 0 !== e) {
                                                                var t = ("function" == typeof this.opts.onBeforeMask && this.opts.onBeforeMask.call(this, e, this.opts) || e).split("");
                                                                c.checkVal.call(this, void 0, !1, !1, t), "function" == typeof this.opts.onBeforeWrite && this.opts.onBeforeWrite.call(this, void 0, l.getBuffer.call(this), 0, this.opts);
                                                            }
                                    Severity: Major
                                    Found in app/assets/javascripts/jquery.inputmask.js - About 40 mins to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                                                  if (void 0 !== (b = k[g]) && !0 !== b.generatedInput && (g >= m || g >= h && c(g, k, {
                                                                      begin: h,
                                                                      end: m
                                                                  }))) {
                                                                      for (;"" !== n.getTest.call(r, E).match.def; ) {
                                      Severity: Major
                                      Found in app/assets/javascripts/jquery.inputmask.js - About 40 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language