pupilfirst/pupilfirst

View on GitHub
app/frontend/shared/utils/rollbar.js

Summary

Maintainability
D
2 days
Test Coverage

File rollbar.js has 430 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var _rollbarConfig = {
  accessToken: window.pupilfirst.rollbar.accessToken,
  captureUncaught: window.pupilfirst.rollbar.captureUncaught,
  captureUnhandledRejections:
    window.pupilfirst.rollbar.captureUnhandledRejections,
Severity: Minor
Found in app/frontend/shared/utils/rollbar.js - About 6 hrs to fix

    Consider simplifying this complex logical expression.
    Open

            if (r) {
              var o = e.globalAlias || "Rollbar";
              if ("object" == typeof r[o]) return r[o];
              (r._rollbarShims = {}), (r._rollbarWrappedError = null);
              var l = new c(e);
    Severity: Critical
    Found in app/frontend/shared/utils/rollbar.js - About 2 hrs to fix

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

            (i.prototype.wrap = function (r, e, o) {
              try {
                var n;
                if (
                  ((n =
      Severity: Minor
      Found in app/frontend/shared/utils/rollbar.js - About 1 hr to fix

        Function loadFull has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            (i.prototype.loadFull = function (r, e, o, n, t) {
              var l = !1,
                i = e.createElement("script"),
                s = e.getElementsByTagName("script")[0],
                d = s.parentNode;
        Severity: Minor
        Found in app/frontend/shared/utils/rollbar.js - About 1 hr to fix

          Function setupShim has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                setupShim: function (r, e) {
                  if (r) {
                    var o = e.globalAlias || "Rollbar";
                    if ("object" == typeof r[o]) return r[o];
                    (r._rollbarShims = {}), (r._rollbarWrappedError = null);
          Severity: Minor
          Found in app/frontend/shared/utils/rollbar.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                      if (
                        !r._rollbar_wrapped &&
                        ((r._rollbar_wrapped = function () {
                          o && "function" == typeof o && o.apply(this, arguments);
                          try {
            Severity: Critical
            Found in app/frontend/shared/utils/rollbar.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                      if (r) {
                        "function" == typeof r._rollbarURH &&
                          r._rollbarURH.belongsToShim &&
                          r.removeEventListener("unhandledrejection", r._rollbarURH);
                        var n = function (r) {
              Severity: Critical
              Found in app/frontend/shared/utils/rollbar.js - About 1 hr to fix

                Function captureUnhandledRejections has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      captureUnhandledRejections: function (r, e, o) {
                        if (r) {
                          "function" == typeof r._rollbarURH &&
                            r._rollbarURH.belongsToShim &&
                            r.removeEventListener("unhandledrejection", r._rollbarURH);
                Severity: Minor
                Found in app/frontend/shared/utils/rollbar.js - About 1 hr to fix

                  Function onreadystatechange has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                            a(function () {
                              if (
                                !(
                                  l ||
                                  (this.readyState &&
                  Severity: Minor
                  Found in app/frontend/shared/utils/rollbar.js - About 1 hr to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for (a = n.args || [], i = 0; i < a.length; ++i)
                                              if ("function" == typeof (l = a[i])) {
                                                l(e);
                                                break;
                                              }
                    Severity: Major
                    Found in app/frontend/shared/utils/rollbar.js - About 45 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                            if (e.hasOwnProperty && e.hasOwnProperty("addEventListener")) {
                              for (var n = e.addEventListener; n._rollbarOldAdd && n.belongsToShim; )
                                n = n._rollbarOldAdd;
                              var t = function (e, o, t) {
                                n.call(this, e, r.wrap(o), t);
                      Severity: Major
                      Found in app/frontend/shared/utils/rollbar.js - About 40 mins to fix

                        Function loadFull has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            (i.prototype.loadFull = function (r, e, o, n, t) {
                        Severity: Minor
                        Found in app/frontend/shared/utils/rollbar.js - About 35 mins to fix

                          There are no issues that match your filters.

                          Category
                          Status