(variable,file)
| 860 | } |
| 861 | |
| 862 | function traverseVariable(variable,file){ |
| 863 | if(r.showMethod)return |
| 864 | // console.log('traverse var',variable) |
| 865 | _doBody(variable,file) |
| 866 | function _doBody(node,file){ |
| 867 | if(!node.body)return |
| 868 | for(let n of node.body){ |
| 869 | n._file=file |
| 870 | n._flow_id=n.value+'_'+node._flow_id |
| 871 | n._flow_from=node._flow_id |
| 872 | if(r.FlowNode[n._flow_id])continue |
| 873 | r.FlowNode[n._flow_id]=n |
| 874 | if(r.FlowFilter[n._flow_id]&&(n.type=="NewExpression"||n.type=="CallExpression")){ |
| 875 | if(n.type=="NewExpression"){ |
| 876 | r.FlowVarNew[node.value]=n.value |
| 877 | n._flow_str=` ${n._flow_id}[${n.value}]\nclick ${n._flow_id} "javascript:void(onFlowClick('${n._flow_id}','${file}'))"\n` |
| 878 | r.FDPNode[n._flow_id]={id:n._flow_id,w:n.value.length*d3config.fontsize/1.6,text:n.value} |
| 879 | }else{ |
| 880 | n._flow_str=` ${n._flow_id}([${n.value}])\nclick ${n._flow_id} "javascript:void(onFlowClick('${n._flow_id}','${file}'))"\n` |
| 881 | r.FDPNode[n._flow_id]={id:n._flow_id,w:n.value.length*d3config.fontsize/1.6+d3config.fontsize*2,text:n.value+'()'} |
| 882 | } |
| 883 | r.Flow+=n._flow_str; |
| 884 | }else if(n.type=="Expression"){ |
| 885 | n._flow_id=node._flow_id |
| 886 | _doBody(n,file) |
| 887 | } |
| 888 | } |
| 889 | } |
| 890 | } |
| 891 | } |
| 892 | |
| 893 | function analysisD3(node,file){ |
no test coverage detected