ophrescue/RescueRails

View on GitHub

Showing 254 of 254 total issues

Consider simplifying this complex logical expression.
Open

                            if (function(e, t, a, i) {
                                function o(t, n) {
                                    var o = "" === i ? t : i + "-" + t;
                                    null !== (n = void 0 !== n ? n : e.getAttribute(o)) && ("string" == typeof n && (0 === t.indexOf("on") ? n = r.default[n] : "false" === n ? n = !1 : "true" === n && (n = !0)),
                                    a[t] = n);
Severity: Critical
Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                            if (void 0 !== i && !0 === i.match.static && !0 !== i.match.optionality && (void 0 === t[0] || void 0 === t[0].alternation)) {
                                var n = a.begin <= e - 1 ? t[e - 1] && !0 === t[e - 1].match.static && t[e - 1] : t[e - 1], r = a.end > e + 1 ? t[e + 1] && !0 === t[e + 1].match.static && t[e + 1] : t[e + 1];
                                return n && r;
                            }
    Severity: Critical
    Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix

      Consider simplifying this complex logical expression.
      Open

                          if (void 0 === t && (t = {}), "string" == typeof e) switch (e) {
                            case "unmaskedvalue":
                              return o && o.inputmask ? o.inputmask.unmaskedvalue() : (0, i.default)(o).val();
      
                            case "remove":
      Severity: Critical
      Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix

        Function onBeforeWrite has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                                onBeforeWrite: function(e, t, a, i) {
                                    function n(e, t) {
                                        if (!1 !== i.__financeInput || t) {
                                            var a = e.indexOf(i.radixPoint);
                                            -1 !== a && e.splice(a, 1);
        Severity: Minor
        Found in app/assets/javascripts/jquery.inputmask.js - About 1 hr to fix

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

                                        case n.default.UP:
                                          return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) + parseInt(i.step)),
                                          o.trigger("setvalue"), !1;
          Severity: Major
          Found in app/assets/javascripts/jquery.inputmask.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/jquery.inputmask.js on lines 1183..1185

          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 73.

          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

                                        case n.default.DOWN:
                                          return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) - parseInt(i.step)),
                                          o.trigger("setvalue"), !1;
          Severity: Major
          Found in app/assets/javascripts/jquery.inputmask.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/jquery.inputmask.js on lines 1179..1181

          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 73.

          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

          Function determineNewCaretPosition has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                          }, t.determineNewCaretPosition = function(e, t, a) {
                              var n = this, u = this.maskset, c = this.opts;
                              t && (n.isRTL ? e.end = e.begin : e.begin = e.end);
                              if (e.begin === e.end) {
                                  switch (a = a || c.positionCaretOnClick) {
          Severity: Minor
          Found in app/assets/javascripts/jquery.inputmask.js - About 1 hr to fix

            Function g has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                                function g(e, i, n) {
                                    n = void 0 !== n ? n : e.matches.length;
                                    var r = e.matches[n - 1];
                                    if (t) 0 === i.indexOf("[") || d && /\\d|\\s|\\w]/i.test(i) || "." === i ? e.matches.splice(n++, 0, {
                                        fn: new RegExp(i, a.casing ? "i" : ""),
            Severity: Minor
            Found in app/assets/javascripts/jquery.inputmask.js - About 1 hr to fix

              Method adoption_app_params has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def adoption_app_params
                  params.require(:adoption_app)
                    .permit(:adopter_id,
                            :spouse_name,
                            :other_household_names,
              Severity: Minor
              Found in app/controllers/adoption_app_controller.rb - About 1 hr to fix

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

                let makeHasPetsQuestionsRequired = function(bool) {
                  document.getElementById("volunteer_app_volunteer_foster_app_attributes_vet_info").required = bool;
                  document.getElementById("volunteer_app_volunteer_foster_app_attributes_current_pets").required = bool;
                  document.getElementById("volunteer_app_volunteer_foster_app_attributes_current_pets_spay_neuter").required = bool;
                }
                Severity: Major
                Found in app/javascript/packs/volunteer_app.js and 1 other location - About 1 hr to fix
                app/javascript/packs/volunteer_app.js on lines 98..102

                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 70.

                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

                let makeRentalQuestionsRequired = function(bool) {
                  document.getElementById("volunteer_app_volunteer_foster_app_attributes_rental_restrictions").required = bool;
                  document.getElementById("volunteer_app_volunteer_foster_app_attributes_rental_landlord_name").required = bool;
                  document.getElementById("volunteer_app_volunteer_foster_app_attributes_rental_landlord_info").required = bool;
                }
                Severity: Major
                Found in app/javascript/packs/volunteer_app.js and 1 other location - About 1 hr to fix
                app/javascript/packs/volunteer_app.js on lines 104..108

                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 70.

                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

                Function inputmask has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                void 0 === i.default.fn.inputmask && (i.default.fn.inputmask = function(e, t) {
                                    var a, o = this[0];
                                    if (void 0 === t && (t = {}), "string" == typeof e) switch (e) {
                                      case "unmaskedvalue":
                                        return o && o.inputmask ? o.inputmask.unmaskedvalue() : (0, i.default)(o).val();
                Severity: Minor
                Found in app/assets/javascripts/jquery.inputmask.js - About 1 hr to fix

                  Function d has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                  function d(e, t, a, i, n) {
                                      var l = e ? e.inputmask : this, c = l.maskset, f = l.opts, d = l.dependencyLib, h = i.slice(), m = "", v = -1, g = void 0, k = f.skipOptionalPartCharacter;
                                      f.skipOptionalPartCharacter = "", o.resetMaskSet.call(l), c.tests = {}, v = f.radixPoint ? o.determineNewCaretPosition.call(l, {
                                          begin: 0,
                                          end: 0
                  Severity: Minor
                  Found in app/assets/javascripts/jquery.inputmask.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                                    if (o.default && h && h.head && h.head.attachShadow && n.default.customElements && void 0 === n.default.customElements.get("input-mask")) {
                                        var m = function(e) {
                                            !function(e, t) {
                                                if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
                                                e.prototype = Object.create(t && t.prototype, {
                    Severity: Critical
                    Found in app/assets/javascripts/jquery.inputmask.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                                          if (void 0 !== e && (e.inputmask._valueSet(t.join("")), void 0 === a || void 0 !== i && "blur" === i.type || o.caret.call(l, e, a, void 0, void 0, void 0 !== i && "keydown" === i.type && (i.keyCode === n.default.DELETE || i.keyCode === n.default.BACKSPACE)),
                                          !0 === r)) {
                                              var p = c(e), h = e.inputmask._valueGet();
                                              e.inputmask.skipInputEvent = !0, p.trigger("input"), setTimeout((function() {
                                                  h === o.getBufferTemplate.call(l).join("") ? p.trigger("cleared") : !0 === s.isComplete.call(l, t) && p.trigger("complete");
                      Severity: Critical
                      Found in app/assets/javascripts/jquery.inputmask.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        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: Critical
                        Found in app/assets/javascripts/jquery.inputmask.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          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: Critical
                          Found in app/assets/javascripts/jquery.inputmask.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                                            if ((s.tests[e] || s.validPositions[e]) && (s.tests[e] || [ s.validPositions[e] ]).every((function(e, r) {
                                                                if (e.mloc[t]) return i = e, !1;
                                                                var o = void 0 !== a ? a : e.alternation, s = void 0 !== e.locator[o] ? e.locator[o].toString().indexOf(t) : -1;
                                                                return (void 0 === n || s < n) && -1 !== s && (i = e, n = s), !0;
                                                            })), i) {
                            Severity: Critical
                            Found in app/assets/javascripts/jquery.inputmask.js - About 1 hr to fix

                              Function on has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                                  on: function(e, t, a) {
                                                      var s = e.inputmask.dependencyLib, l = function(t) {
                                                          t.originalEvent && (t = t.originalEvent || t, arguments[0] = t);
                                                          var l, u = this, c = u.inputmask, f = c ? c.opts : void 0;
                                                          if (void 0 === c && "FORM" !== this.nodeName) {
                              Severity: Minor
                              Found in app/assets/javascripts/jquery.inputmask.js - About 1 hr to fix

                                Function m has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                                function m(e, t, a, i) {
                                                    var r = this, s = this.maskset, l = this.opts, u = this.dependencyLib;
                                                    function c(e, t, a) {
                                                        var i = t[e];
                                                        if (void 0 !== i && !0 === i.match.static && !0 !== i.match.optionality && (void 0 === t[0] || void 0 === t[0].alternation)) {
                                Severity: Minor
                                Found in app/assets/javascripts/jquery.inputmask.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language