pinclub/pinclub

View on GitHub
public/libs/code-prettify/prettify.js

Summary

Maintainability
D
2 days
Test Coverage

File prettify.js has 353 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var q = null;
window.PR_SHOULD_USE_CONTINUATION = !0;
(function () {
  function L(a) {
    function m(a) {
Severity: Minor
Found in public/libs/code-prettify/prettify.js - About 4 hrs to fix

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

      function L(a) {
        function m(a) {
          var f = a.charCodeAt(0);
          if (f !== 92)return f;
          var b = a.charAt(1);
    Severity: Major
    Found in public/libs/code-prettify/prettify.js - About 2 hrs to fix

      Function D has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function D(a, m) {
          function e(a) {
            switch (a.nodeType) {
              case 1:
                if (k.test(a.className))break;
      Severity: Minor
      Found in public/libs/code-prettify/prettify.js - About 1 hr to fix

        Function x has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function x(a, m) {
            function e(a) {
              for (var l = a.d, p = [l, "pln"], d = 0, g = a.a.match(y) || [], r = {}, n = 0, z = g.length; n < z; ++n) {
                var f = g[n], b = r[f], o = void 0, c;
                if (typeof b ===
        Severity: Minor
        Found in public/libs/code-prettify/prettify.js - About 1 hr to fix

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

            function E(a) {
              var m =
                a.g;
              try {
                var e = M(a.h), h = e.a;
          Severity: Minor
          Found in public/libs/code-prettify/prettify.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                    if (/\\[bdsw]/i.test(j))a.push(j); else {
                      var j = m(j), d;
                      c + 2 < i && "-" === f[c + 1] ? (d = m(f[c + 2]), c += 2) : d = j;
                      b.push([j, d]);
                      d < 65 || j > 122 || (d < 65 || j > 90 || b.push([Math.max(65, j) | 32, Math.min(d, 90) | 32]), d < 97 || j > 122 || b.push([Math.max(97, j) & -33, Math.min(d, 122) & -33]))
            Severity: Critical
            Found in public/libs/code-prettify/prettify.js - About 1 hr to fix

              Function prettyPrint has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                window.prettyPrint = function (a) {
                  function m() {
                    for (var e = window.PR_SHOULD_USE_CONTINUATION ? l.now() + 250 : Infinity; p < h.length && l.now() < e; p++) {
                      var n = h[p], k = n.className;
                      if (k.indexOf("prettyprint") >= 0) {
              Severity: Minor
              Found in public/libs/code-prettify/prettify.js - About 1 hr to fix

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

                    function e(a) {
                      for (var l = a.d, p = [l, "pln"], d = 0, g = a.a.match(y) || [], r = {}, n = 0, z = g.length; n < z; ++n) {
                        var f = g[n], b = r[f], o = void 0, c;
                        if (typeof b ===
                          "string")c = !1; else {
                Severity: Minor
                Found in public/libs/code-prettify/prettify.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                              for (c = 0; c < t; ++c)if (i = m[c], o = f.match(i[1])) {
                                b = i[0];
                                break
                              }
                  Severity: Major
                  Found in public/libs/code-prettify/prettify.js - About 45 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                            if (k.indexOf("prettyprint") >= 0) {
                              var k = k.match(g), f, b;
                              if (b = !k) {
                                b = n;
                                for (var o = void 0, c = b.firstChild; c; c = c.nextSibling)var i = c.nodeType, o = i === 1 ? o ? b : c : i === 3 ? N.test(c.nodeValue) ? b : o : o;
                    Severity: Major
                    Found in public/libs/code-prettify/prettify.js - About 40 mins to fix

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

                          a.currentStyle ? l = a.currentStyle.whiteSpace : window.getComputedStyle && (l = s.defaultView.getComputedStyle(a, q).getPropertyValue("white-space"));
                      Severity: Major
                      Found in public/libs/code-prettify/prettify.js and 1 other location - About 1 hr to fix
                      public/libs/code-prettify/prettify.js on lines 95..95

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

                      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

                          a.currentStyle ? l = a.currentStyle.whiteSpace : window.getComputedStyle && (l = document.defaultView.getComputedStyle(a, q).getPropertyValue("white-space"));
                      Severity: Major
                      Found in public/libs/code-prettify/prettify.js and 1 other location - About 1 hr to fix
                      public/libs/code-prettify/prettify.js on lines 213..213

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

                      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