lib/jquery.planize.js
Function planize
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.fn.planize = function(config) {
var self = jQuery(this);
var processed = false;
var toc = '';
Function process
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var process = function() {
var level = 0;
var levels = [0,0,0,0,0,0,0];
var hLevelText = '';
var prependText = '';
Avoid deeply nested control flow statements. Open
Open
while (level < prevLevel) {
unnest += '</ul>';
prevLevel--;
}
Avoid deeply nested control flow statements. Open
Open
} else if (level > prevLevel) {
log(hLevelText + ', nesting because:' + level + '>' + prevLevel);
toc += '<ul>' + elem;
} else {
log(hLevelText + ', same level (' + level + ')');