mazerte/generator-footguard

View on GitHub

Showing 21 of 21 total issues

File prettify.js has 902 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 app/templates/src/styleguide/public/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 app/templates/src/styleguide/public/prettify.js - About 7 hrs to fix

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

        function numberLines(node, opt_startLineNum) {
          var nocode = /(?:^|\s)nocode(?:\s|$)/;
          var lineBreak = /\r\n?|\n/;
        
          var document = node.ownerDocument;
      Severity: Major
      Found in app/templates/src/styleguide/public/prettify.js - About 3 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 app/templates/src/styleguide/public/prettify.js - About 3 hrs to fix

          Function sourceDecorator has 78 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 app/templates/src/styleguide/public/prettify.js - About 3 hrs to fix

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

              function recombineTagsAndDecorations(job) {
                var isIE = /\bMSIE\b/.test(navigator.userAgent);
                var newlineRe = /\n/g;
              
                var source = job.sourceCode;
            Severity: Major
            Found in app/templates/src/styleguide/public/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 app/templates/src/styleguide/public/prettify.js - About 2 hrs to fix

                Function allowAnywhereFoldCaseAndRenumberGroups has 65 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 app/templates/src/styleguide/public/prettify.js - About 2 hrs to fix

                  Function prettyPrint has 64 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 app/templates/src/styleguide/public/prettify.js - About 2 hrs to fix

                    Function caseFoldCharset has 61 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 app/templates/src/styleguide/public/prettify.js - About 2 hrs to fix

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

                        function extractSourceSpans(node) {
                          var nocode = /(?:^|\s)nocode(?:\s|$)/;
                        
                          var chunks = [];
                          var length = 0;
                      Severity: Minor
                      Found in app/templates/src/styleguide/public/prettify.js - About 1 hr to fix

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

                            function doWork() {
                              var endTime = (window['PR_SHOULD_USE_CONTINUATION'] ?
                                             clock['now']() + 250 /* ms */ :
                                             Infinity);
                              for (; k < elements.length && clock['now']() < endTime; k++) {
                        Severity: Minor
                        Found in app/templates/src/styleguide/public/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 app/templates/src/styleguide/public/prettify.js - About 1 hr to fix

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

                            Generator.prototype.createTestFile = function createTestFile() {
                              var dest = path.join(this.folder, this.name);
                              this.createTest('unit', 'test_unit.coffee', dest);
                            };
                            Severity: Major
                            Found in test-unit/index.js and 2 other locations - About 1 hr to fix
                            test-functional/index.js on lines 14..17
                            test-integration/index.js on lines 14..17

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

                            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 3 locations. Consider refactoring.
                            Open

                            Generator.prototype.createTestFile = function createTestFile() {
                              var dest = path.join(this.folder, this.name);
                              this.createTest('functional', 'test_functional.coffee', dest);
                            };
                            Severity: Major
                            Found in test-functional/index.js and 2 other locations - About 1 hr to fix
                            test-integration/index.js on lines 14..17
                            test-unit/index.js on lines 14..17

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

                            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 3 locations. Consider refactoring.
                            Open

                            Generator.prototype.createTestFile = function createTestFile() {
                              var dest = path.join(this.folder, this.name);
                              this.createTest('integration', 'test_integration.coffee', dest);
                            };
                            Severity: Major
                            Found in test-integration/index.js and 2 other locations - About 1 hr to fix
                            test-functional/index.js on lines 14..17
                            test-unit/index.js on lines 14..17

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

                            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

                            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 app/templates/src/styleguide/public/prettify.js - About 1 hr to fix

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

                              Generator.prototype.createModelFiles = function createModelFiles() {
                                this.template('model.coffee', this.getElementDest('model'));
                              
                                this.createElementTest('model');
                              };
                              Severity: Minor
                              Found in model/index.js and 1 other location - About 55 mins to fix
                              helper/index.js on lines 26..30

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

                              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

                              Generator.prototype.createHelperFiles = function createHelperFiles() {
                                this.template('helper.coffee', this.getElementDest('helper'));
                              
                                this.createElementTest('helper');
                              };
                              Severity: Minor
                              Found in helper/index.js and 1 other location - About 55 mins to fix
                              model/index.js on lines 33..37

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

                              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

                              Avoid deeply nested control flow statements.
                              Open

                                            if (match) {
                                              style = patternParts[0];
                                              break;
                                            }
                              Severity: Major
                              Found in app/templates/src/styleguide/public/prettify.js - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language