wahyd4/ocelots

View on GitHub
include.js

Summary

Maintainability
F
5 days
Test Coverage

Function a has 211 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var a = function () {
        function e(a) {
            return Array.isArray ? Array.isArray(a) : a.constructor.toString().indexOf("Array") != -1
        }

Severity: Major
Found in include.js - About 1 day to fix

    Consider simplifying this complex logical expression.
    Open

        if (!navigator.id.request || navigator.id._shimmed) {
            var c = "https://login.persona.org", d = navigator.userAgent, e = d.indexOf("Fennec/") != -1 || d.indexOf("Firefox/") != -1 && d.indexOf("Android") != -1, f = e ? undefined : "menubar=0,location=1,resizable=1,scrollbars=1,status=0,dialog=1,minimizable=1,width=700,height=375", g, h = {login:null, logout:null, ready:null}, i, j = undefined;
    
            function k(a) {
                a !== !0;
    Severity: Critical
    Found in include.js - About 7 hrs to fix

      File include.js has 464 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * Uncompressed source can be found at https://login.persona.org/include.orig.js
       *
       * This Source Code Form is subject to the terms of the Mozilla Public
       * License, v. 2.0. If a copy of the MPL was not distributed with this
      Severity: Minor
      Found in include.js - About 7 hrs to fix

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

                return{build:function (b) {
                    var g = function (a) {
                        if (b.debugOutput && window.console && window.console.log) {
                            try {
                                typeof a != "string" && (a = JSON.stringify(a))
        Severity: Major
        Found in include.js - About 6 hrs to fix

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

              var b = function () {
                  function l() {
                      return c
                  }
          
          
          Severity: Minor
          Found in include.js - About 1 hr to fix

            Function open has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    return g() ? {open:function (e, g) {
                        function q(a) {
                            try {
                                var b = JSON.parse(a.data);
                                b.a === "ready" ? m.postMessage(o, l) : b.a === "error" ? g && (g(b.d), g = null) : b.a === "response" && (d(window, "message", q), d(window, "unload", p), p(), g && (g(null, b.d), g = null))
            Severity: Minor
            Found in include.js - About 1 hr to fix

              Function r has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          }, r = function (a, c, d) {
                              if (typeof b.gotMessageObserver == "function")try {
                                  b.gotMessageObserver(a, d)
                              } catch (h) {
                                  g("gotMessageObserver() raised an exception: " + h.toString())
              Severity: Minor
              Found in include.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                                if (d.id && c) {
                                    if (k[c]) {
                                        var i = p(d.id, a, d.callbacks ? d.callbacks : []);
                                        m[d.id] = {};
                                        try {
                Severity: Major
                Found in include.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                                      if (k[c]) {
                                          var i = p(d.id, a, d.callbacks ? d.callbacks : []);
                                          m[d.id] = {};
                                          try {
                                              if (d.callbacks && e(d.callbacks) && d.callbacks.length > 0)for (var j = 0; j < d.callbacks.length; j++) {
                  Severity: Major
                  Found in include.js - About 1 hr to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    for (var r = 0; r < q.length - 1; r++) {
                                                        var s = q[r];
                                                        typeof o[s] != "object" && (o[s] = {}), o = o[s]
                                                    }
                    Severity: Major
                    Found in include.js - About 45 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                                  if (g)try {
                                      g.focus()
                                  } catch (d) {
                                  } else {
                                      if (!b.isSupported()) {
                      Severity: Major
                      Found in include.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                        if (a.onlogin && typeof a.onlogin != "function" || a.onlogout && typeof a.onlogout != "function" || a.onready && typeof a.onready != "function")throw new Error("non-function where function expected in parameters to navigator.id.watch()");
                        Severity: Major
                        Found in include.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                      if (c === "*")for (var h in b) {
                                          if (!b.hasOwnProperty(h))continue;
                                          if (h === "*")continue;
                                          if (typeof b[h][d] == "object") {
                                              g = f(b[h][d]);
                          Severity: Major
                          Found in include.js - About 40 mins to fix

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

                                        if (navigator.appName === "Microsoft Internet Explorer") {
                                            var b = navigator.userAgent, c = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");
                                            c.exec(b) != null && (a = parseFloat(RegExp.$1))
                                        }
                            Severity: Major
                            Found in include.js and 1 other location - About 1 hr to fix
                            include.js on lines 358..361

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

                            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

                                        if (b.appName == "Microsoft Internet Explorer") {
                                            var c = b.userAgent, d = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");
                                            d.exec(c) != null && (a = parseFloat(RegExp.$1))
                                        }
                            Severity: Major
                            Found in include.js and 1 other location - About 1 hr to fix
                            include.js on lines 257..260

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

                            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

                                    function d(a, b, c) {
                                        a.detachEvent ? a.detachEvent("on" + b, c) : a.removeEventListener && a.removeEventListener(b, c, !1)
                                    }
                            Severity: Major
                            Found in include.js and 1 other location - About 1 hr to fix
                            include.js on lines 268..270

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

                            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

                                    function c(a, b, c) {
                                        a.attachEvent ? a.attachEvent("on" + b, c) : a.addEventListener && a.addEventListener(b, c, !1)
                                    }
                            Severity: Major
                            Found in include.js and 1 other location - About 1 hr to fix
                            include.js on lines 264..266

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

                            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 c = "https://login.persona.org", d = navigator.userAgent, e = d.indexOf("Fennec/") != -1 || d.indexOf("Firefox/") != -1 && d.indexOf("Android") != -1, f = e ? undefined : "menubar=0,location=1,resizable=1,scrollbars=1,status=0,dialog=1,minimizable=1,width=700,height=375", g, h = {login:null, logout:null, ready:null}, i, j = undefined;
                            Severity: Minor
                            Found in include.js and 1 other location - About 50 mins to fix
                            include.js on lines 249..249

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

                            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.indexOf("Fennec/") != -1 || a.indexOf("Firefox/") != -1 && a.indexOf("Android") != -1
                            Severity: Minor
                            Found in include.js and 1 other location - About 50 mins to fix
                            include.js on lines 374..374

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

                            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

                            There are no issues that match your filters.

                            Category
                            Status