MCPcopy Create free account
hub / github.com/davidkingzyb/SCAST / traverseVariable

Function traverseVariable

js/SCASTTS.js:293–320  ·  view source on GitHub ↗
(variable,file)

Source from the content-addressed store, hash-verified

291 }
292
293 function traverseVariable(variable,file){
294 if(r.showMethod)return
295 // console.log('traverse var',variable)
296 _doBody(variable,file)
297 function _doBody(node,file){
298 if(!node.body)return
299 for(let n of node.body){
300 n._file=file
301 n._flow_id=n.value+'_'+node._flow_id
302 n._flow_from=node._flow_id
303 if(r.FlowNode[n._flow_id])continue
304 r.FlowNode[n._flow_id]=n
305 if(r.FlowFilter[n._flow_id]&&(n.type=="NewExpression"||n.type=="CallExpression")){
306 if(n.type=="NewExpression"){
307 n._flow_str=` ${n._flow_id}[${n.value}]\nclick ${n._flow_id} "javascript:void(onFlowClick('${n._flow_id}','${file}'))"\n`
308 r.FDPNode[n._flow_id]={id:n._flow_id,w:n.value.length*gD3fontSize/1.6,text:n.value}
309 }else{
310 n._flow_str=` ${n._flow_id}([${n.value}])\nclick ${n._flow_id} "javascript:void(onFlowClick('${n._flow_id}','${file}'))"\n`
311 r.FDPNode[n._flow_id]={id:n._flow_id,w:n.value.length*gD3fontSize/1.6+gD3fontSize*2,text:n.value+'()'}
312 }
313 r.Flow+=n._flow_str;
314 }else if(n.type=="Expression"){
315 n._flow_id=node._flow_id
316 _doBody(n,file)
317 }
318 }
319 }
320 }
321 }
322
323 function analysisD3(node,file){

Callers 2

analysisMermaidFunction · 0.70
_doBodyFunction · 0.70

Calls 1

_doBodyFunction · 0.70

Tested by

no test coverage detected