ophrescue/RescueRails

View on GitHub

Showing 254 of 254 total issues

Class Cat has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

class Cat < ApplicationRecord
  audited
  include Filterable
  include Flaggable
  include ClientValidated
Severity: Minor
Found in app/models/cat.rb - About 3 hrs to fix

    Function postValidation has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                            postValidation: function(e, t, a, i, n, r, o, s) {
                                var l, u;
                                if (o) return !0;
                                if (!1 === i && (((l = P(t + 1, n)).targetMatch && l.targetMatchIndex === t && l.targetMatch[0].length > 1 && void 0 !== f[l.targetMatch[0]] || (l = P(t + 2, n)).targetMatch && l.targetMatchIndex === t + 1 && l.targetMatch[0].length > 1 && void 0 !== f[l.targetMatch[0]]) && (u = f[l.targetMatch[0]][0]),
                                void 0 !== u && (void 0 !== r.validPositions[t + 1] && new RegExp(u).test(a + "0") ? (e[t] = a,
    Severity: Major
    Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix

      Function 3976 has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  3976: function(e, t, a) {
                      Object.defineProperty(t, "__esModule", {
                          value: !0
                      }), t.default = void 0;
                      var i, n = (i = a(4528)) && i.__esModule ? i : {
      Severity: Major
      Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix

        Function preValidation has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                                preValidation: function(e, t, a, i, n, r, o, s) {
                                    var l;
                                    if (!1 !== n.__financeInput && a === n.radixPoint) return !1;
                                    if (l = n.shortcuts && n.shortcuts[a]) {
                                        if (l.length > 1) for (var u = [], c = 0; c < l.length; c++) u.push({
        Severity: Major
        Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix

          Function 9716 has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      9716: function(e, t, a) {
                          Object.defineProperty(t, "__esModule", {
                              value: !0
                          }), t.EventRuler = void 0;
                          var i = s(a(2394)), n = s(a(4528)), r = a(8711), o = a(7760);
          Severity: Major
          Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                                            if ([ "submit", "reset", "setvalue" ].includes(t.type) || "FORM" === this.nodeName || !(u.disabled || u.readOnly && !("keydown" === t.type && t.ctrlKey && 67 === t.keyCode || !1 === f.tabThrough && t.keyCode === n.default.TAB))) {
                                                switch (t.type) {
                                                  case "input":
                                                    if (!0 === c.skipInputEvent || t.inputType && "insertCompositionText" === t.inputType) return c.skipInputEvent = !1,
                                                    t.preventDefault();
            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) {
                                          for (var k, y = e - 1; void 0 === (k = s.validPositions[y] || s.tests[y]) && y > -1; ) y--;
                                          void 0 !== k && y > -1 && (p = function(e, t) {
                                              var a, i = [];
                                              return Array.isArray(t) || (t = [ t ]), t.length > 0 && (void 0 === t[0].alternation || !0 === u.keepStatic ? 0 === (i = o.call(n, e, t.slice()).locator.slice()).length && (i = t[0].locator.slice()) : t.forEach((function(e) {
              Severity: Critical
              Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                                        if ("" !== a.inputmask._valueGet(!0) || !1 === t.clearMaskOnLostFocus || d === a) {
                                            (0, o.applyInputValue)(a, a.inputmask._valueGet(!0), t);
                                            var p = r.getBuffer.call(e).slice();
                                            !1 === u.isComplete.call(e, p) && t.clearIncomplete && r.resetMaskSet.call(e), t.clearMaskOnLostFocus && d !== a && (-1 === r.getLastValidPosition.call(e) ? p = [] : o.clearOptionalTail.call(e, p)),
                                            (!1 === t.clearMaskOnLostFocus || t.showMaskOnFocus && d === a || "" !== a.inputmask._valueGet(!0)) && (0,
                Severity: Critical
                Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix

                  Function exports has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function(api) {
                    var validEnv = ['development', 'test', 'production']
                    var currentEnv = api.env()
                    var isDevelopmentEnv = api.env('development')
                    var isProductionEnv = api.env('production')
                  Severity: Major
                  Found in babel.config.js - About 2 hrs to fix

                    File users_controller.rb has 269 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    class UsersController < Clearance::UsersController
                      include ApplicationHelper
                    
                      before_action :select_bootstrap41
                      before_action :require_login
                    Severity: Minor
                    Found in app/controllers/users_controller.rb - About 2 hrs to fix

                      Function inputFallBackEvent has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                          inputFallBackEvent: function(e) {
                                              var t = this.inputmask, a = t.opts, i = t.dependencyLib;
                                              var s = this, f = s.inputmask._valueGet(!0), d = (t.isRTL ? n.getBuffer.call(t).slice().reverse() : n.getBuffer.call(t)).join(""), p = n.caret.call(t, s, void 0, void 0, !0);
                                              if (d !== f) {
                                                  var h = function(e, i, r) {
                      Severity: Major
                      Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix

                        Consider simplifying this complex logical expression.
                        Open

                                            if (!1 !== f) {
                                                e.originalPlaceholder = a.placeholder, e.maxLength = void 0 !== a ? a.maxLength : void 0,
                                                -1 === e.maxLength && (e.maxLength = void 0), "inputMode" in a && null === a.getAttribute("inputmode") && (a.inputMode = t.inputmode,
                                                a.setAttribute("inputmode", t.inputmode)), !0 === f && (t.showMaskOnFocus = t.showMaskOnFocus && -1 === [ "cc-number", "cc-exp" ].indexOf(a.autocomplete),
                                                l.iphone && (t.insertModeVisual = !1), s.EventRuler.on(a, "submit", c.EventHandlers.submitEvent),
                        Severity: Critical
                        Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix

                          Consider simplifying this complex logical expression.
                          Open

                                                      if (t = function(e, t, a, i, n) {
                                                          return n._radixDance && n.numericInput && t !== n.negationSymbol.back && e <= a && (a > 0 || t == n.radixPoint) && (void 0 === i.validPositions[e - 1] || i.validPositions[e - 1].input !== n.negationSymbol.back) && (e -= 1),
                                                          e;
                                                      }(t, a, p, r, n), "-" === a || a === n.negationSymbol.front) {
                                                          if (!0 !== n.allowMinus) return !1;
                          Severity: Critical
                          Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix

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

                              Function 443 has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                          443: function(e, t, a) {
                                              var i = o(a(8254)), n = o(a(2394));
                                              function r(e) {
                                                  return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
                                                      return typeof e;
                              Severity: Major
                              Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix

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

                                                            i = (i = i.replace(new RegExp("^" + (0, r.default)(a.negationSymbol.front)), "-")).replace(new RegExp((0,
                                                            r.default)(a.negationSymbol.back) + "$"), ""), Number(i)) : i;
                                Severity: Major
                                Found in app/assets/javascripts/jquery.inputmask.js and 1 other location - About 2 hrs to fix
                                app/assets/javascripts/jquery.inputmask.js on lines 1102..1103

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

                                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

                                                            return a = (a = (a = (a = (a = a.replace(new RegExp("^" + (0, r.default)(t.negationSymbol.front)), "-")).replace(new RegExp((0,
                                                            r.default)(t.negationSymbol.back) + "$"), "")).replace(t.prefix, "")).replace(t.suffix, "")).replace(new RegExp((0,
                                Severity: Major
                                Found in app/assets/javascripts/jquery.inputmask.js and 1 other location - About 2 hrs to fix
                                app/assets/javascripts/jquery.inputmask.js on lines 1097..1098

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

                                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 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];
                                Severity: Major
                                Found in app/assets/javascripts/jquery.inputmask.js and 1 other location - About 2 hrs to fix
                                app/assets/javascripts/jquery.inputmask.js on lines 2737..2737

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

                                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

                                Method volunteer_app_params has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def volunteer_app_params
                                    params.require(:volunteer_app).permit(:name,
                                                                          :email,
                                                                          :status,
                                                                          :phone,
                                Severity: Major
                                Found in app/controllers/volunteer_apps_controller.rb - About 2 hrs to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                                      if (e.begin > e.end && (h = e.end, m = e.begin), i = void 0 !== i ? i : h, h !== m || l.insertMode && void 0 !== s.validPositions[i] && void 0 === a || void 0 === t) {
                                                          var g, k = u.extend(!0, {}, s.validPositions), y = o.getLastValidPosition.call(r, void 0, !0);
                                                          for (s.p = h, g = y; g >= h; g--) delete s.validPositions[g], void 0 === t && delete s.tests[g + 1];
                                                          var b, x, P = i, E = P;
                                                          for (t && (s.validPositions[i] = u.extend(!0, {}, t), E++, P++), g = t ? m : m - 1; g <= y; g++) {
                                  Severity: Critical
                                  Found in app/assets/javascripts/jquery.inputmask.js - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language