wikimedia/mediawiki-core

View on GitHub
resources/lib/mustache/mustache.js

Summary

Maintainability
D
1 day
Test Coverage

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

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  typeof define === 'function' && define.amd ? define(factory) :
  (global = global || self, global.Mustache = factory());
}(this, (function () { 'use strict';
Severity: Minor
Found in resources/lib/mustache/mustache.js - About 7 hrs to fix

    Function parseTemplate has 102 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function parseTemplate (template, tags) {
        if (!template)
          return [];
        var lineHasNonSpace = false;
        var sections = [];     // Stack to hold section tokens
    Severity: Major
    Found in resources/lib/mustache/mustache.js - About 4 hrs to fix

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

        Context.prototype.lookup = function lookup (name) {
          var cache = this.cache;
      
          var value;
          if (cache.hasOwnProperty(name)) {
      Severity: Minor
      Found in resources/lib/mustache/mustache.js - About 1 hr to fix

        Avoid deeply nested control flow statements.
        Open

                    if (index === names.length - 1)
                      lookupHit = (
                        hasProperty(intermediateValue, names[index])
                        || primitiveHasOwnProperty(intermediateValue, names[index])
                      );
        Severity: Major
        Found in resources/lib/mustache/mustache.js - About 45 mins to fix

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

            Writer.prototype.renderInverted = function renderInverted (token, context, partials, originalTemplate, config) {
          Severity: Minor
          Found in resources/lib/mustache/mustache.js - About 35 mins to fix

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

              Writer.prototype.renderTokens = function renderTokens (tokens, context, partials, originalTemplate, config) {
            Severity: Minor
            Found in resources/lib/mustache/mustache.js - About 35 mins to fix

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

                Writer.prototype.renderSection = function renderSection (token, context, partials, originalTemplate, config) {
              Severity: Minor
              Found in resources/lib/mustache/mustache.js - About 35 mins to fix

                There are no issues that match your filters.

                Category
                Status