MaibornWolff / MaibornWolff/codecharta

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

Open
#3,642 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug pr-analysis
Dominant language
TypeScript
Stars
529
Forks
56
Avg merge
7h 17m
Merged PRs (30d)
34

Description

# 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)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the linked actual_csvimport.cc.json from the CSVimporter and inspect how AttributeDescriptors are consumed by the visualization, starting with the legend panel and tooltip logic. Done means CSVimporter-generated descriptors no longer produce empty UI titles and the default metric descriptions are used when extended metadata is absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.