app/frontend/shared/utils/rollbar.js
File rollbar.js
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var _rollbarConfig = {
accessToken: window.pupilfirst.rollbar.accessToken,
captureUncaught: window.pupilfirst.rollbar.captureUncaught,
captureUnhandledRejections:
window.pupilfirst.rollbar.captureUnhandledRejections,
Consider simplifying this complex logical expression. Open
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);
Function wrap
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(i.prototype.wrap = function (r, e, o) {
try {
var n;
if (
((n =
Function loadFull
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function setupShim
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Consider simplifying this complex logical expression. Open
Open
if (
!r._rollbar_wrapped &&
((r._rollbar_wrapped = function () {
o && "function" == typeof o && o.apply(this, arguments);
try {
Consider simplifying this complex logical expression. Open
Open
if (r) {
"function" == typeof r._rollbarURH &&
r._rollbarURH.belongsToShim &&
r.removeEventListener("unhandledrejection", r._rollbarURH);
var n = function (r) {
Function captureUnhandledRejections
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
captureUnhandledRejections: function (r, e, o) {
if (r) {
"function" == typeof r._rollbarURH &&
r._rollbarURH.belongsToShim &&
r.removeEventListener("unhandledrejection", r._rollbarURH);
Function onreadystatechange
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
a(function () {
if (
!(
l ||
(this.readyState &&
Avoid deeply nested control flow statements. Open
Open
for (a = n.args || [], i = 0; i < a.length; ++i)
if ("function" == typeof (l = a[i])) {
l(e);
break;
}
Consider simplifying this complex logical expression. Open
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);
Function loadFull
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
(i.prototype.loadFull = function (r, e, o, n, t) {