docs/api/phpdoc/js/jquery.xml2json.js
Function xml2json
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
xml2json: function(xml, extended) {
if(!xml) return {}; // quick fail
//### PARSER LIBRARY
// Core function
Function parseXML
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseXML(node, simple){
if(!node) return null;
var txt = '', obj = null, att = null;
var nt = node.nodeType, nn = jsVar(node.localName || node.nodeName);
var nv = node.text || node.nodeValue || '';
Consider simplifying this complex logical expression. Open
Open
;if(window.jQuery) (function($){
// Add function to jQuery namespace
$.extend({
Avoid deeply nested control flow statements. Open
Open
if(obj[cnn]){
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>f',cnn,'ARRAY']);
// http://forum.jquery.com/topic/jquery-jquery-xml2json-problems-when-siblings-of-the-same-tagname-only-have-a-textnode-as-a-child
if(!obj[cnn].length) obj[cnn] = myArr(obj[cnn]);
Avoid deeply nested control flow statements. Open
Open
if(cnv.match(/^\s+$/)){
/*DBG*/ //if(window.console) console.log(['x2j',nn,'node>c',cnn,'WHITE-SPACE (ignore)']);
return;
};