cs-au-dk / jelly

JavaScript/TypeScript static analyzer for call graph construction, library usage pattern matching, and vulnerability exposure analysis
MIT License
317 stars 22 forks source link

Maximum Callstack Size exceeded on opening the cg.html file #1

Closed anlauren closed 1 year ago

anlauren commented 1 year ago

Hello, I was eager to try out this tool today on a React App that needs cleaning up, i managed to run the command jelly -j cg.json -m cg.html ./src -b ./ --ignore-dependencies, but when opening the html file i'm getting the following:

cytoscape.min.js:29 Uncaught RangeError: Maximum call stack size exceeded
    at new Zo (cytoscape.min.js:29:74836)
    at $o.spawn (cytoscape.min.js:29:75060)
    at Qe.<anonymous> (cytoscape.min.js:29:31530)
    at Qe.children (cytoscape.min.js:29:30694)
    at Qe.descendants (cytoscape.min.js:29:32139)
    at Qe.dirtyStyleCache (cytoscape.min.js:29:63716)
    at bs.checkTriggers (cytoscape.min.js:32:19950)
    at p (cytoscape.min.js:32:15454)
    at bs.applyParsedProperty (cytoscape.min.js:32:17820)
    at bs.applyContextStyle (cytoscape.min.js:32:13077)

I'm guessing i've analysed too many files for the browser to handle, but it could be something else 🤔

amoeller commented 1 year ago

Looks like the analyzer completed but the visualizer, which is based on Cytoscape.js, can't handle the large call graph. Try with a smaller program.

anlauren commented 1 year ago

Yep it works with a rather small other project. Do you happen to know a tool out there that happens to be able to support bigger projects?

amoeller commented 1 year ago

For visualizing huge graphs? No, sorry. But a better approach is probably to tweak the generation of the HTML file (in src/output/visualizer.ts) such that it includes information only for selected packages or modules. Pull requests are welcome :-)