CartoDB/cartodb20

View on GitHub
lib/build/mustache.js

Summary

Maintainability
D
1 day
Test Coverage

File mustache.js has 413 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * mustache.js - Logic-less {{mustache}} templates with JavaScript
 * http://github.com/janl/mustache.js
 */

Severity: Minor
Found in lib/build/mustache.js - About 5 hrs to fix

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

      function parse(template, tags) {
        tags = tags || exports.tags;
    
        var tagRes = escapeTags(tags);
        var scanner = new Scanner(template);
    Severity: Major
    Found in lib/build/mustache.js - About 2 hrs to fix

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

        function nestTokens(tokens) {
          var tree = [];
          var collector = tree;
          var sections = [];
          var token, section;
      Severity: Minor
      Found in lib/build/mustache.js - About 1 hr to fix

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

          function compileTokens(tokens, returnBody) {
            var body = ['""'];
            var token, method, escape;
        
            for (var i = 0, len = tokens.length; i < len; ++i) {
        Severity: Minor
        Found in lib/build/mustache.js - About 1 hr to fix

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

            Context.prototype.lookup = function (name) {
              var value = this._cache[name];
          
              if (!value) {
                if (name === ".") {
          Severity: Minor
          Found in lib/build/mustache.js - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                        while (value && i < names.length) {
                          value = value[names[i++]];
                        }
            Severity: Major
            Found in lib/build/mustache.js - About 45 mins to fix

              Avoid too many return statements within this function.
              Open

                  return "";
              Severity: Major
              Found in lib/build/mustache.js - About 30 mins to fix

                There are no issues that match your filters.

                Category
                Status