Open Pyrrha opened 1 year ago
Hello @Pyrrha
I've just faced the same problem and the only help found so far is your own unanswered question!
I have had a look to the …/code2flow/javascript.py
file, and it appears that the related line (n 33) makes a test that may not be protected enough.
I just tried to replace it as follow:
--- /[…]/lib/python3.10/site-packages/code2flow/javascript.py.original 2024-03-05 14:49:51.895071571 +0100
+++ /[…]/lib/python3.10/site-packages/code2flow/javascript.py 2024-03-05 14:42:55.807765683 +0100
@@ -31,5 +31,5 @@ def walk(tree):
if type(tree) == list:
for el in tree:
- if el.get('type'):
+ if el and el.get('type'):
ret.append(el)
ret += walk(el)
(just adds a test to check if el
could be equal to None
…)
By the way, that fixed the problem for me in some cases, but code2flow
still crashes in some other cases.
Hope this helps.
Hello @bbailleux,
Thanks for your help, I did not use this tool for my need since I opened this issue. However I'll keep your answer if I use this tool in the future 😄
You maybe should open a PR to share your fix for the others?
Thanks!
Hello,
For my first use, after successfully fighting with dependencies, I ran into this error:
Steps to reproduce:
code2flow *.js workflows/*.js bin/*.js --output out.dot
in corresponding arborescence rootI used a collection of JS files, separated into multiple folders. As the code stated, I suspect a bug inside the tool itself. Is there anything to fix this?
Thanks