mar10/fancytree

View on GitHub
lib/jquery.planize.js

Summary

Maintainability
C
7 hrs
Test Coverage

Function planize has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  jQuery.fn.planize = function(config) {

    var self          = jQuery(this);
    var processed     = false;
    var toc           = '';
Severity: Major
Found in lib/jquery.planize.js - About 3 hrs to fix

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

        var process = function() {
          var level       = 0;
          var levels      = [0,0,0,0,0,0,0];
          var hLevelText  = '';
          var prependText = '';
    Severity: Major
    Found in lib/jquery.planize.js - About 2 hrs to fix

      Avoid deeply nested control flow statements.
      Open

                      while (level < prevLevel) {
                        unnest += '</ul>';
                        prevLevel--;
                      }
      Severity: Major
      Found in lib/jquery.planize.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                      } else if (level > prevLevel) {
                        log(hLevelText + ', nesting because:' + level + '>' + prevLevel);
                        toc += '<ul>' + elem;
                      } else {
                        log(hLevelText + ', same level (' + level + ')');
        Severity: Major
        Found in lib/jquery.planize.js - About 45 mins to fix

          There are no issues that match your filters.

          Category
          Status