siad007/versioncontrol_hg

View on GitHub
docs/api/phpdoc/js/jquery.xml2json.js

Summary

Maintainability
C
1 day
Test Coverage

Function xml2json has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  xml2json: function(xml, extended) {
   if(!xml) return {}; // quick fail
   
   //### PARSER LIBRARY
   // Core function
Severity: Major
Found in docs/api/phpdoc/js/jquery.xml2json.js - About 3 hrs to fix

    Function parseXML has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    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 || '';
    Severity: Major
    Found in docs/api/phpdoc/js/jquery.xml2json.js - About 2 hrs to fix

      Consider simplifying this complex logical expression.
      Open

      ;if(window.jQuery) (function($){
       
       // Add function to jQuery namespace
       $.extend({
        
      Severity: Critical
      Found in docs/api/phpdoc/js/jquery.xml2json.js - About 1 hr to fix

        Avoid deeply nested control flow statements.
        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]);
        Severity: Major
        Found in docs/api/phpdoc/js/jquery.xml2json.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                  if(cnv.match(/^\s+$/)){
                   /*DBG*/ //if(window.console) console.log(['x2j',nn,'node>c',cnn,'WHITE-SPACE (ignore)']);
                   return;
                  };
          Severity: Major
          Found in docs/api/phpdoc/js/jquery.xml2json.js - About 45 mins to fix

            There are no issues that match your filters.

            Category
            Status