ophrescue/RescueRails

View on GitHub

Showing 254 of 254 total issues

Method user_params has 141 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def user_params
    if current_user && current_user.admin?
      params.require(:user)
        .permit(:name,
                :avatar,
Severity: Major
Found in app/controllers/users_controller.rb - About 5 hrs to fix

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

                                        var h = new RegExp("(^" + ("" != i.negationSymbol.front ? (0, r.default)(i.negationSymbol.front) + "?" : "") + (0,
                                        r.default)(i.prefix) + ")(.*)(" + (0, r.default)(i.suffix) + ("" != i.negationSymbol.back ? (0,
                                        r.default)(i.negationSymbol.back) + "?" : "") + "$)").exec(n(t.slice(), !0).reverse().join(""));
    Severity: Major
    Found in app/assets/javascripts/jquery.inputmask.js and 1 other location - About 5 hrs to fix
    app/assets/javascripts/jquery.inputmask.js on lines 1136..1138

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

    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

                                    var a = new RegExp("(^" + ("" !== t.negationSymbol.front ? (0, r.default)(t.negationSymbol.front) + "?" : "") + (0,
                                    r.default)(t.prefix) + ")(.*)(" + (0, r.default)(t.suffix) + ("" != t.negationSymbol.back ? (0,
                                    r.default)(t.negationSymbol.back) + "?" : "") + "$)").exec(e.slice().reverse().join("")), i = a ? a[2] : "", n = !1;
    Severity: Major
    Found in app/assets/javascripts/jquery.inputmask.js and 1 other location - About 5 hrs to fix
    app/assets/javascripts/jquery.inputmask.js on lines 1157..1159

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

    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

    Consider simplifying this complex logical expression.
    Open

                            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" : ""),
                                static: !1,
                                optionality: !1,
                                newBlockMarker: void 0 === r ? "master" : r.def !== i,
    Severity: Critical
    Found in app/assets/javascripts/jquery.inputmask.js - About 5 hrs to fix

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

                          function g(t, a, n, r) {
                              function o(n, r, f) {
                                  function p(e, t) {
                                      var a = 0 === t.matches.indexOf(e);
                                      return a || t.matches.every((function(i, n) {
      Severity: Major
      Found in app/assets/javascripts/jquery.inputmask.js - About 5 hrs to fix

        Consider simplifying this complex logical expression.
        Open

                            if (void 0 !== c) {
                                v = parseInt(u), S.excludes[v] = S.excludes[v] || [], !0 !== e && S.excludes[v].push((0,
                                n.getDecisionTaker)(p) + ":" + p.alternation);
                                var A = [], C = -1;
                                for (h = v; h < o.getLastValidPosition.call(x, void 0, !0) + 1; h++) -1 === C && e <= h && void 0 !== t && (A.push(t),
        Severity: Critical
        Found in app/assets/javascripts/jquery.inputmask.js - About 5 hrs to fix

          Function o has 124 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                                  function o(n, r, f) {
                                      function p(e, t) {
                                          var a = 0 === t.matches.indexOf(e);
                                          return a || t.matches.every((function(i, n) {
                                              return !0 === i.isQuantifier ? a = p(e, t.matches[n - 1]) : Object.prototype.hasOwnProperty.call(i, "matches") && (a = p(e, i)),
          Severity: Major
          Found in app/assets/javascripts/jquery.inputmask.js - About 4 hrs to fix

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

            rentToggle.addEventListener('change', function (event) {
              console.log(`${event.target.value} is picked`);
              if (event.target.value === 'Rent') {
                document.getElementById('foster-rental-questions').classList.remove('collapse')
                makeRentalQuestionsRequired(true)
            Severity: Major
            Found in app/javascript/packs/volunteer_app.js and 1 other location - About 4 hrs to fix
            app/javascript/packs/volunteer_app.js on lines 25..34

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

            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

            petsToggle.addEventListener('change', function (event) {
              console.log(`${event.target.value} is picked`);
              if (event.target.value === 'true') {
                document.getElementById('other-pets-questions').classList.remove('collapse')
                makeHasPetsQuestionsRequired(true)
            Severity: Major
            Found in app/javascript/packs/volunteer_app.js and 1 other location - About 4 hrs to fix
            app/javascript/packs/volunteer_app.js on lines 13..22

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

            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

            Consider simplifying this complex logical expression.
            Open

                                    if (d !== f) {
                                        var h = function(e, i, r) {
                                            for (var o, s, l, c = e.substr(0, r.begin).split(""), f = e.substr(r.begin).split(""), d = i.substr(0, r.begin).split(""), p = i.substr(r.begin).split(""), h = c.length >= d.length ? c.length : d.length, m = f.length >= p.length ? f.length : p.length, v = "", g = [], k = "~"; c.length < h; ) c.push(k);
                                            for (;d.length < h; ) d.push(k);
                                            for (;f.length < m; ) f.unshift(k);
            Severity: Critical
            Found in app/assets/javascripts/jquery.inputmask.js - About 4 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                                      if (e[i] = "ampm" === i ? t : t.replace(/[^0-9]/g, "0"), e["raw" + i] = t, void 0 !== r) {
                                          var n = e[i];
                                          ("day" === i && 29 === parseInt(n) || "month" === i && 2 === parseInt(n)) && (29 !== parseInt(e.day) || 2 !== parseInt(e.month) || "" !== e.year && void 0 !== e.year || e.date.setFullYear(2012, 1, 29)),
                                          "day" === i && 0 === parseInt(n) && (n = 1), "month" === i && (n = parseInt(n)) > 0 && (n -= 1),
                                          "year" === i && n.length < 4 && (n = y(n, 4, !0)), "" === n || isNaN(n) || r.call(e.date, n),
              Severity: Critical
              Found in app/assets/javascripts/jquery.inputmask.js - About 4 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                                        if (void 0 !== e) {
                                            var i = new d.Event("_checkval");
                                            i.which = e.toString().charCodeAt(0), m += e;
                                            var n = o.getLastValidPosition.call(l, void 0, !0);
                                            !function(e, t) {
                Severity: Critical
                Found in app/assets/javascripts/jquery.inputmask.js - About 4 hrs to fix

                  Function 157 has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              157: function(e, t, a) {
                                  Object.defineProperty(t, "__esModule", {
                                      value: !0
                                  }), t.mask = function() {
                                      var e = this, t = this.opts, a = this.el, i = this.dependencyLib;
                  Severity: Major
                  Found in app/assets/javascripts/jquery.inputmask.js - About 4 hrs to fix

                    Consider simplifying this complex logical expression.
                    Open

                                        if ("function" == typeof k.preValidation && !0 !== i && !0 !== s && (S = P(S = k.preValidation.call(v, o.getBuffer.call(v), x, t, b(e), k, y, e, a || r))),
                                        !0 === S) {
                                            if (S = E(x, t, a), (!a || !0 === i) && !1 === S && !0 !== s) {
                                                var _ = y.validPositions[x];
                                                if (!_ || !0 !== _.match.static || _.match.def !== t && t !== k.skipOptionalPartCharacter) {
                    Severity: Critical
                    Found in app/assets/javascripts/jquery.inputmask.js - About 4 hrs to fix

                      Function 5296 has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  5296: function(e, t, a) {
                                      function i(e) {
                                          return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
                                              return typeof e;
                                          } : function(e) {
                      Severity: Major
                      Found in app/assets/javascripts/jquery.inputmask.js - About 4 hrs to fix

                        Function 7760 has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                    7760: function(e, t, a) {
                                        Object.defineProperty(t, "__esModule", {
                                            value: !0
                                        }), t.applyInputValue = c, t.clearOptionalTail = f, t.checkVal = d, t.HandleNativePlaceholder = function(e, t) {
                                            var a = e ? e.inputmask : this;
                        Severity: Major
                        Found in app/assets/javascripts/jquery.inputmask.js - About 4 hrs to fix

                          Function mask has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                          }), t.mask = function() {
                                              var e = this, t = this.opts, a = this.el, i = this.dependencyLib;
                                              s.EventRuler.off(a);
                                              var f = function(t, a) {
                                                  "textarea" !== t.tagName.toLowerCase() && a.ignorables.push(n.default.ENTER);
                          Severity: Major
                          Found in app/assets/javascripts/jquery.inputmask.js - About 4 hrs to fix

                            Consider simplifying this complex logical expression.
                            Open

                                                    s.handleRemove.call(t, f, p, h), (0, l.writeBuffer)(f, n.getBuffer.call(t, !0), c.p, e, f.inputmask._valueGet() !== n.getBuffer.call(t).join("")); else if (p === r.default.END || p === r.default.PAGE_DOWN) {
                                                        e.preventDefault();
                                                        var v = n.seekNext.call(t, n.getLastValidPosition.call(t));
                                                        n.caret.call(t, f, e.shiftKey ? h.begin : v, v, !0);
                                                    } else p === r.default.HOME && !e.shiftKey || p === r.default.PAGE_UP ? (e.preventDefault(),
                            Severity: Critical
                            Found in app/assets/javascripts/jquery.inputmask.js - About 4 hrs to fix

                              Function 3851 has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                          3851: function(e, t, a) {
                                              var i, n = (i = a(2394)) && i.__esModule ? i : {
                                                  default: i
                                              }, r = a(8711), o = a(4713);
                                              n.default.extendDefinitions({
                              Severity: Major
                              Found in app/assets/javascripts/jquery.inputmask.js - About 3 hrs to fix

                                Consider simplifying this complex logical expression.
                                Open

                                                            if (o.getBuffer.call(v, !0), !1 !== (s = (!f.jit || void 0 !== y.validPositions[o.seekPrevious.call(v, t)]) && (null != f.fn ? f.fn.test(a, y, t, r, k, b(e)) : (a === f.def || a === k.skipOptionalPartCharacter) && "" !== f.def && {
                                                                c: n.getPlaceholder.call(v, t, f, !0) || f.def,
                                                                pos: t
                                                            }))) {
                                                                var d = void 0 !== s.c ? s.c : a, p = t;
                                Severity: Critical
                                Found in app/assets/javascripts/jquery.inputmask.js - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language