Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path Unification for better merging #3495

Open
phanlezz opened this issue Feb 16, 2024 · 2 comments
Open

Path Unification for better merging #3495

phanlezz opened this issue Feb 16, 2024 · 2 comments
Labels
pr-analysis Issues that touch the analysis pr(oject). priority:high Set by PO

Comments

@phanlezz
Copy link
Collaborator

Path Unification

modules as in importer / parser

All modules of the analysis should produces similar paths if possible for the same code.
As a user I want to merge a variety of used modules, without modifying paths/roots of files.

The motivation for this issue was the sonar importer, which unfortunately currently nests the paths additionally, but it should be checked to what extent this also affects the other modules.

One approach could be to develop an automatic merge mode that tries to find a lowest common denominator across multiple project files. This mode should allow paths to be matched and folders to be nested correctly without manual input.

A short example:

- root
- - a
- - b

- someKey
- - root
- - a
- - b

- b 

should all get merged without user input to:

- root
- - a
- - b

Open questions

Modify modules or automatic merge

Side note

unification might be the wrong term.

@phanlezz phanlezz added the pr-analysis Issues that touch the analysis pr(oject). label Feb 16, 2024
@ChristianHuehn ChristianHuehn added the priority:high Set by PO label Sep 24, 2024
@Richargh
Copy link

Richargh commented Oct 1, 2024

The motivation for this issue was the sonar importer, which unfortunately currently nests the paths additionally

@phanlezz If that is the main motivation, wouldn't it then be better to work on the sonar importer and not touch the merge? If sonar returns a single root folder and that contains the other stuff:

- root
- - theprojectname
- - - src/
- - - something.else

then instead return:

- root
- - src/
- - something.else

If sonar instead returns

- root
- - anotherfolder
- - theprojectname
- - - src/
- - - something.else

Then return that because there must be some reason.

Wouldn't that solve most problems and be the easiest to implement?

PS: The tokeiimporter has the same problem and could be fixed in a similar way. tokei codecharta -o json > codecharta.tokei.json and ccsh tokeiimporter codecharta.tokei.json -o codecharta.tokei.cc.json.gz will return a file with the contents:

root
- codecharta
- - analysis
- - gh-pages
- - visualization
- - package.json

But it would be much better if it returned:

root
- analysis
- gh-pages
- visualization
- package.json

@phanlezz
Copy link
Collaborator Author

phanlezz commented Oct 1, 2024

I agree, that the answer to the question, that I asked, is to modify the existing parsers to produce similar structures. After that, we can look into the topic of automatic merging, and if it is something useful to have as a tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-analysis Issues that touch the analysis pr(oject). priority:high Set by PO
Projects
None yet
Development

No branches or pull requests

3 participants