codecharta
codecharta copied to clipboard
cc.json[.gz] is empty
Bug
Expected Behavior
WHEN I run cssh tokeiimporter myproject.tokei.json -o myproject.tokei.cc.json
THEN a valid `myproject.tokei.cc.json[.gz]' is created
Actual Behavior
The 'myproject.tokei.cc.json` is empty
Screenshots
Steps to Reproduce the Problem
5 min Generic Metrics Quickstart
Specifications
- is released in online-demo: no
- CodeCharta Version: 1.122.0
- OS: Win 11
- Browser: Chrome
PS.: Feel free to contact me via MW Teams. ;-)
I contacted you.
I did some digging and I think, that there might be a problem with the produced paths by Tokei under Windows. Our Importer seems to struggle with them, and not parse them correctly as paths, but as file names.
As a quick workaround: It should be possible to replace all \\
with /
inside the Tokei JSON file and then import it.
It should be possible to replace all \ with / inside the Tokei JSON file and then import it.
I confirm that this works.
There are two problems here which we need to investigate:
- Created archives with the tokeiimporter are empty
- When using the tokeiimporter with a windows based Tokei JSON file, the output can't be displayed in visualization
How (1) and (2) are intertwined is currently unknown. For (2) it needs to be analyzed if the problem is in the cc.json file produced by tokeiiimporter or if the visualization struggles with windows paths. For (1) the circumstances when this happens are currently unknown
Update: Let's focus in this issue on the second point, as the first one can't be reproduced, and it might be a side effect of the second point. If the situation changes, we can update the issue or create a new one.
I did some more testing:
Tokei used double backslash as path-separator on Windows. When imported with our module, this must be specified with a single backslash. Furthermore, the single backslash can escape the last quotes "
which can lead to miss interpretation of the entered command.
It is possible to remove the quotes.
I will try to improve our importer here, so that double backslashes can be understood correctly or the separator could be determined automatically