pinclub/pinclub

View on GitHub
public/libs/jquery.tmpl.js

Summary

Maintainability
C
1 day
Test Coverage

File jquery.tmpl.js has 365 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery Templates Plugin
 * http://github.com/jquery/jquery-tmpl
 *
 * Copyright Software Freedom Conservancy, Inc.
Severity: Minor
Found in public/libs/jquery.tmpl.js - About 4 hrs to fix

    Function storeTmplItems has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function storeTmplItems( content ) {
            var keySuffix = "_" + cloneIndex, elem, elems, newClonedItems = {}, i, l, m;
            for ( i = 0, l = content.length; i < l; i++ ) {
                if ( (elem = content[i]).nodeType !== 1 ) {
                    continue;
    Severity: Minor
    Found in public/libs/jquery.tmpl.js - About 2 hrs to fix

      Function buildTmplFn has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function buildTmplFn( markup ) {
              return new Function("jQuery","$item",
                  "var $=jQuery,call,_=[],$data=$item.data;" +
      
                  // Introduce the data as local variables using with(){}
      Severity: Minor
      Found in public/libs/jquery.tmpl.js - About 1 hr to fix

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

                function processItemKey( el ) {
                    var pntKey, pntNode = el, pntItem, tmplItem, key;
                    // Ensure that each rendered template inserted into the DOM has its own template item,
                    if ( (key = el.getAttribute( tmplItmAtt ))) {
                        while ( pntNode.parentNode && (pntNode = pntNode.parentNode).nodeType === 1 && !(pntKey = pntNode.getAttribute( tmplItmAtt ))) { }
        Severity: Minor
        Found in public/libs/jquery.tmpl.js - About 1 hr to fix

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

                  tmpl: function( tmpl, data, options, parentItem ) {
                      var ret, topLevel = !parentItem;
                      if ( topLevel ) {
                          // This is a top-level tmpl call (not from a nested template using {{tmpl}})
                          parentItem = topTmplItem;
          Severity: Minor
          Found in public/libs/jquery.tmpl.js - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status