MaibornWolff / codecharta

CodeCharta visualizes multiple code metrics using 3D tree maps.
https://maibornwolff.github.io/codecharta/
BSD 3-Clause "New" or "Revised" License
178 stars 30 forks source link

`ccsh` CSVimporter produces almost empty AttributeDescriptors, which break tooltip logic in the Visualization #3642

Open phanlezz opened 2 weeks ago

phanlezz commented 2 weeks ago

CSVimporter produces almost empty AttributeDescriptors, disrupts UI in visualization

Expected Behavior

cc.json generated by CSVimporter WHEN loading it into the front end THEN I would expect to get default metric description (e.g. in the legend), as the parser does not provide extended metadata > ℹ️ Key Point: Default Metric Descriptions won't get used, altho they are more excessive in this case ℹ️ ## Actual Behavior The empty strings from the AttributeDescriptors get used to build titles, tooltips, etc. ## Screenshots ![grafik](https://github.com/MaibornWolff/codecharta/assets/65733509/8cf31d36-b9f8-4a89-bb16-a7fc3d5adb80) ![grafik](https://github.com/MaibornWolff/codecharta/assets/65733509/737119bd-5f46-4969-aee3-f103fc6d0162) ## Dev Comments We put the direction in the AttributeDescriptors, but every other field is empty. Because the Visualization assumes that there is a description if there is an entry in the AttributeDescriptors Map, it builds up the title etc. from empty strings. 1. We could change the behavior in the analysis, so that the Descriptors won't be included in CSVimporter (directions would be missing) 1. - To mitigate that issue, we could evaluate moving the direction to attributeTypes instead of AttributeDescriptions. 1. We could include an empty string check in the Visualization, so that it is able to fall back to the metricTitles.ts to build UI elements ## Steps to Reproduce the Problem 1. Use the CSVimporter (tested with the golden_test example file) > [actual_csvimport.cc.json](https://github.com/user-attachments/files/15836865/actual_csvimport.cc.json) > Caution: The MCC entry got already removed for testing purposes! 1. Load into visualization 1. Check legend panel ## Specifications - is released in [online-demo](https://maibornwolff.github.io/codecharta/visualization/app/index.html?file=codecharta.cc.json.gz&file=codecharta_analysis.cc.json.gz): yes - CodeCharta Version: 1.126.0 - OS: Windows (irrelevant) - Browser: Firefox (irrelevant)