tbranyen/combyne

View on GitHub

Showing 19 of 19 total issues

File tree.js has 408 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * A tree representation of the template tokens.
 *
 * @module tree
 */
Severity: Minor
Found in lib/tree.js - About 5 hrs to fix

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

    define(function(require, exports, module) {
      "use strict";
    
      /**
       * Retrieves a partial locally registered, or via the parent.
    Severity: Major
    Found in lib/shared/get_partial.js and 1 other location - About 3 hrs to fix
    lib/shared/get_filter.js on lines 6..27

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

    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

    define(function(require, exports, module) {
      "use strict";
    
      /**
       * Retrieves a filter locally registered, or via the parent.
    Severity: Major
    Found in lib/shared/get_filter.js and 1 other location - About 3 hrs to fix
    lib/shared/get_partial.js on lines 6..27

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

    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

    define(function(require, exports, module) {
      "use strict";
    
      // This polyfill isn't necessary.
      if (String.prototype.trim) {
    Severity: Major
    Found in lib/support/string/trim.js and 1 other location - About 2 hrs to fix
    lib/support/string/trim_left.js on lines 6..25

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

    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

    define(function(require, exports, module) {
      "use strict";
    
      // This polyfill isn't necessary.
      if (String.prototype.trimLeft) {
    Severity: Major
    Found in lib/support/string/trim_left.js and 1 other location - About 2 hrs to fix
    lib/support/string/trim.js on lines 6..25

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

    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 constructConditional has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      Tree.prototype.constructConditional = function(root, kind) {
        root.type = root.type || "ConditionalExpression";
        root.conditions = root.conditions || [];
    
        var prev = {};
    Severity: Major
    Found in lib/tree.js - About 2 hrs to fix

      Function constructEach has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        Tree.prototype.constructEach = function(root) {
          root.type = "LoopExpression";
          root.conditions = [];
      
          // Find the left side identifier.
      Severity: Major
      Found in lib/tree.js - About 2 hrs to fix

        Function make has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          Tree.prototype.make = function(root, END) {
            root = root || this.root;
        
            var node, result, prev, next;
            var index = 0;
        Severity: Major
        Found in lib/tree.js - About 2 hrs to fix

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

            Tree.prototype.constructProperty = function(encoded) {
              var propertyDescriptor = {
                type: encoded ? "Property" : "RawProperty",
                value: "",
                args: [],
          Severity: Minor
          Found in lib/tree.js - About 1 hr to fix

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

              Tree.prototype.constructFilter = function(root) {
                var current = {
                  type: "Filter",
                  args: []
                };
            Severity: Minor
            Found in lib/tree.js - About 1 hr to fix

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

                function Compiler(tree) {
                  this.tree = tree;
                  this.string = "";
              
                  // Optimization pass will flatten large templates to result in faster
              Severity: Minor
              Found in lib/compiler.js - About 1 hr to fix

                Function map has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function map(obj, index, value, data, iterator) {
                    var isArrayLike = type(obj) === "arguments" || type(obj) === "nodelist";
                    var isArray = Array.isArray(obj) || isArrayLike;
                    var output = [];
                    var dataObject;
                Severity: Minor
                Found in lib/shared/map.js - About 1 hr to fix

                  Function compileProperty has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    Compiler.prototype.compileProperty = function(node, encode) {
                      var identifier = node.value;
                  
                      // Normalize string property values that contain single or double quotes.
                      if (identifier.indexOf("'") === -1 && identifier.indexOf("\"") === -1) {
                  Severity: Minor
                  Found in lib/compiler.js - About 1 hr to fix

                    Function constructExtend has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      Tree.prototype.constructExtend = function(root) {
                        root.type = "ExtendExpression";
                    
                        // What to return to the compiler.
                        var value = {
                    Severity: Minor
                    Found in lib/tree.js - About 1 hr to fix

                      Function process has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        Compiler.prototype.process = function(nodes, keyVal) {
                          var commands = [];
                      
                          // Parse the Tree and execute the respective compile to JavaScript method.
                          nodes.map(function(node, index) {
                      Severity: Minor
                      Found in lib/compiler.js - About 1 hr to fix

                        Function constructExpression has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          Tree.prototype.constructExpression = function(root, END) {
                            var expressionRoot = {
                              nodes: []
                            };
                        
                        
                        Severity: Minor
                        Found in lib/tree.js - About 1 hr to fix

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

                            Tree.prototype.constructPartial = function(root) {
                              root.type = "PartialExpression";
                          
                              // By default isolate the partial from the parent's data.
                              root.value = "";
                          Severity: Minor
                          Found in lib/tree.js - About 1 hr to fix

                            Function escape has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              Grammar.prototype.escape = function() {
                                // Order matters here.
                                var grammar = [
                                  "START_RAW",
                                  "START_PROP",
                            Severity: Minor
                            Found in lib/grammar.js - About 1 hr to fix

                              Function map has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                function map(obj, index, value, data, iterator) {
                              Severity: Minor
                              Found in lib/shared/map.js - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language