question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: Exported cc.json include data that is not supposed to be there

See original GitHub issue

Bug

Expected Behavior

  • The node of "type": "Folder" has empty "attributes": { }
  • The node of "type": "File" does not have the attribute unary
  • The node of "type": "File" does not have the "origin": "sample1.cc.json"

The visualization is not supposed to modify the "nodes": [] or "edges": []. These are generated by the analysis. More specifically the problems are:

  • A folder is not supposed to have any attributes. The Visualization is supposed to either sum or average the "file"s inside a “folder” but should not store these values in the cc.json.
  • The unary attribute is a virtual attribute that is 1 for each “file”. It’s not supposed to be in the cc.json.
  • The origin is very useful to differentiate in Multiple Mode where the file came from. It’s weird to have it when I opened the file in Single Mode.

Now for the bigger question: If I had openend multiple files in Multiple Mode should the “origin” be there for each “file”? I don’t think it should. Currently the download button in Multiple Mode can be used to merge files but that was never the intention of *Multiple Mode. Merging files is supposed to be done by analysis and the merge filter. I think we should disable the download button for Multiple and Delta Mode because it’s unclear what the resulting file will contain.

Actual Behavior

When I save a cc.json from the visualization it includes data it’s not supposed to include:

  • The node of "type": "Folder" has "attributes": { "unary": 4, "avgCommits": 146, "rloc": 600, ... }
  • The node of "type": "File" has this "attributes": { "unary": 4 }
  • The node of "type": "File" has this "origin": "sample1.cc.json"

Steps to Reproduce the Problem

  1. Open CodeCharta with mini-map
  2. Press the download button
  3. Press save

Specifications

  • Version: 1.32.0
  • Platform: Web
  • Subsystem: Visualization
  • Browser: Firefox

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
fatihicommented, Nov 7, 2019

I’m with @alschmut here, the file is not intended to be read manually. If someone still wants to do that, there are programs that format json automatically.

0reactions
alschmutcommented, Nov 9, 2019

Short side note: I imported a cc.json file with 1.5MB after using the analysis and when I exported that map, it had 8.6MB. So while removing duplicated data with this issue, we should also consider minimizing the file size by removing whitespace/line breaks etc.

With this issue implemented, I just shortly wanna mention, how much smaller in size our exported files just got. When I imported the same 1.5MB cc.json file and exported it afterwards, it had surprisingly just 1.3MB. I don’t have an answer to why it is even smaller than 1.5MB, but I guess its a pretty good improvement from exporting a file which had 8.6MB before.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve react export error for JSON in react js?
1 Answer. Save this answer. Show activity on this post. The reason you are getting an error is because it is trying to...
Read more >
Misleading error that module does not provide export #32137
cjs' does not provide an export named 'name' which is only "true" because ES modules aren't allowed to import CJS named exports. The...
Read more >
1944733 – [RFE] There is no option to do an incremental ...
Bug 1944733 - [RFE] There is no option to do an incremental content view export using 'hammer content-view version export'.
Read more >
How to prevent ExportString from reencoding diacritics when ...
1. After you Export to JSON, try doing BinaryReadList on the file and comparing the bytes you see with ToCharacterCode on the string...
Read more >
768470 - Export and import memory reporter data as JSON
This patch just serializes the memory reports as JSON text and then deserializes them before continuing, as a basic proof of context. There's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found