socketstream/socketstream

View on GitHub
docs/js/google-code-prettify.js

Summary

Maintainability
F
1 wk
Test Coverage

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

// Copyright (C) 2006 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Severity: Major
Found in docs/js/google-code-prettify.js - About 2 days to fix

    Function combinePrefixPatterns has 186 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function combinePrefixPatterns(regexs) {
        var capturedGroupIndex = 0;
      
        var needToFoldCase = false;
        var ignoreCase = false;
    Severity: Major
    Found in docs/js/google-code-prettify.js - About 7 hrs to fix

      Function createSimpleLexer has 94 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {
          var shortcuts = {};
          var tokenizer;
          (function () {
            var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);
      Severity: Major
      Found in docs/js/google-code-prettify.js - About 3 hrs to fix

        Function numberLines has 90 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function numberLines(node, opt_startLineNum, isPreformatted) {
            var nocode = /(?:^|\s)nocode(?:\s|$)/;
            var lineBreak = /\r\n?|\n/;
          
            var document = node.ownerDocument;
        Severity: Major
        Found in docs/js/google-code-prettify.js - About 3 hrs to fix

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

            function prettyPrint(opt_whenDone) {
              function byTagName(tn) { return document.getElementsByTagName(tn); }
              // fetch a list of nodes to rewrite
              var codeSegments = [byTagName('pre'), byTagName('code'), byTagName('xmp')];
              var elements = [];
          Severity: Major
          Found in docs/js/google-code-prettify.js - About 3 hrs to fix

            Function recombineTagsAndDecorations has 81 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function recombineTagsAndDecorations(job) {
                var isIE8OrEarlier = /\bMSIE\s(\d+)/.exec(navigator.userAgent);
                isIE8OrEarlier = isIE8OrEarlier && +isIE8OrEarlier[1] <= 8;
                var newlineRe = /\n/g;
              
            Severity: Major
            Found in docs/js/google-code-prettify.js - About 3 hrs to fix

              Function sourceDecorator has 80 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function sourceDecorator(options) {
                  var shortcutStylePatterns = [], fallthroughStylePatterns = [];
                  if (options['tripleQuotedStrings']) {
                    // '''multi-line-string''', 'single-line-string', and double-quoted
                    shortcutStylePatterns.push(
              Severity: Major
              Found in docs/js/google-code-prettify.js - About 3 hrs to fix

                Function allowAnywhereFoldCaseAndRenumberGroups has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function allowAnywhereFoldCaseAndRenumberGroups(regex) {
                      // Split into character sets, escape sequences, punctuation strings
                      // like ('(', '(?:', ')', '^'), and runs of characters that do not
                      // include any of the above.
                      var parts = regex.source.match(
                Severity: Major
                Found in docs/js/google-code-prettify.js - About 2 hrs to fix

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

                      var decorate = function (job) {
                        var sourceCode = job.sourceCode, basePos = job.basePos;
                        /** Even entries are positions in source in ascending order.  Odd enties
                          * are style markers (e.g., PR_COMMENT) that run from that position until
                          * the end.
                  Severity: Major
                  Found in docs/js/google-code-prettify.js - About 2 hrs to fix

                    Function doWork has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function doWork() {
                          var endTime = (win['PR_SHOULD_USE_CONTINUATION'] ?
                                         clock['now']() + 250 /* ms */ :
                                         Infinity);
                          for (; k < elements.length && clock['now']() < endTime; k++) {
                    Severity: Major
                    Found in docs/js/google-code-prettify.js - About 2 hrs to fix

                      Function caseFoldCharset has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function caseFoldCharset(charSet) {
                            var charsetParts = charSet.substring(1, charSet.length - 1).match(
                                new RegExp(
                                    '\\\\u[0-9A-Fa-f]{4}'
                                    + '|\\\\x[0-9A-Fa-f]{2}'
                      Severity: Major
                      Found in docs/js/google-code-prettify.js - About 2 hrs to fix

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

                          function extractSourceSpans(node, isPreformatted) {
                            var nocode = /(?:^|\s)nocode(?:\s|$)/;
                          
                            var chunks = [];
                            var length = 0;
                        Severity: Minor
                        Found in docs/js/google-code-prettify.js - About 1 hr to fix

                          Function walk has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function walk(node) {
                                switch (node.nodeType) {
                                  case 1:  // Element
                                    if (nocode.test(node.className)) { break; }
                                    if ('br' === node.nodeName) {
                          Severity: Minor
                          Found in docs/js/google-code-prettify.js - About 1 hr to fix

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

                                function walk(node) {
                                  switch (node.nodeType) {
                                    case 1:  // Element
                                      if (nocode.test(node.className)) { return; }
                                      for (var child = node.firstChild; child; child = child.nextSibling) {
                            Severity: Minor
                            Found in docs/js/google-code-prettify.js - About 1 hr to fix

                              Avoid deeply nested control flow statements.
                              Open

                                            if (match) {
                                              style = patternParts[0];
                                              break;
                                            }
                              Severity: Major
                              Found in docs/js/google-code-prettify.js - About 45 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return charsetPart.charCodeAt(1);
                                Severity: Major
                                Found in docs/js/google-code-prettify.js - About 30 mins to fix

                                  There are no issues that match your filters.

                                  Category
                                  Status