Language: JavaScript
Label: safe
CWE: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Code:
L.cell.id,L.text),Q=!1);Q||A++;N++});console.log("states checked",N,"invalid",A)}));d.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var l=null!=d.pages&&null!=d.getCurrentFile()?d.getCurrentFile().getAnonymizedXmlForPages(d.pages):"";l=new TextareaDialog(d,"Paste Data:",l,function(n){if(0<n.length)try{var z=function(L){function U(Z){if(null==X[Z]){if(X[Z]=!0,null!=H[Z]){for(;0<H[Z].length;){var Y=H[Z].pop();U(Y)}delete H[Z]}}else mxLog.debug(g+": Visited: "+Z)}var g=L.parentNode.id,
y=L.childNodes;L={};for(var H={},O=null,P={},V=0;V<y.length;V++){var R=y[V];if(null!=R.id&&0<R.id.length)if(null==L[R.id]){L[R.id]=R.id;var W=R.getAttribute("parent");null==W?null!=O?mxLog.debug(g+": Multiple roots: "+R.id):O=R.id:(null==H[W]&&(H[W]=[]),H[W].push(R.id))}else P[R.id]=R.id}y=Object.keys(P);0<y.length?(y=g+": "+y.length+" Duplicates: "+y.join(", "),mxLog.debug(y+" (see console)")):mxLog.debug(g+": Checked");var X={};null==O?mxLog.debug(g+": No root"):(U(O),Object.keys(X).length!=Object.keys(L).length&&
(mxLog.debug(g+": Invalid tree: (see console)"),console.log(g+": Invalid tree",H)))};"<"!=n.charAt(0)&&(n=Graph.decompress(n),mxLog.debug("See console for uncompressed XML"),console.log("xml",n));var E=mxUtils.parseXml(n),A=d.getPagesForNode(E.documentElement,"mxGraphModel");if(null!=A&&0<A.length)try{var N=d.getHashValueForPages(A);mxLog.debug("Checksum: ",N)}catch(L){mxLog.debug("Error: ",L.message)}else mxLog.debug("No pages found for checksum");var Q=E.getElementsByTagName("root");for(n=0;n<Q.length;n++)z(Q[n]);