MaibornWolff / codecharta

CodeCharta is a visualization tool that transforms complex software architecture and code metrics into interactive, customizable visual maps, empowering everyone to communicate and analyze your codebase. Improve code quality, maintainability, and architectural decisions
https://maibornwolff.github.io/codecharta/
BSD 3-Clause "New" or "Revised" License
195 stars 30 forks source link

Merge multiple projects files into one fat .cc.json #3743

Open Richargh opened 2 months ago

Richargh commented 2 months ago

Feature request

Description

As an auditor, I want to merge multiple project files for separate services into one fat file with folders per project so that it's easier to load and share them.

Context

Let's say you have an audit where a team has divided their code up into 20 repositories. #3742 makes it already easier to merge these. But it is a bit tiresome to load them in codecharta and share the files. It would be much nicer if you could merge all 20 (or 50 or 100) of these files into one big file. Perhaps these files are organized like this:

├📁 merge
├─📄 prj1.merge.cc.json                
├─📄 ...
├─📄 prj20.merge.cc.json               

Internally the files are structure like

# prj1.merge.cc.json
root
- src/
- pom.xml

and

# prj2.merge.cc.json
root
- src/
- pom.xml

If I were to blindly merge files on the same level then files like pom.xml would override each other and src/ would end up in a very strange state.

It would be much nicer if the output of this merge could be:

# all.merge.cc.json
root
- prj1
- - src/
- - pom.xml
- prj2
- - src/
- - pom.xml

Acceptance criteria

Assumptions & Exclusions

Development notes (optional Task Breakdown)

Open questions

phanlezz commented 1 week ago

What would be the behavior like if there are two prj1 files present (multiple files with the same prefix)? Maybe this is a sub-mode for --mimo ? I think it would not be too much work to remove the single file checks and modify the file output of MIMO to implement this feature. @Richargh

Richargh commented 1 week ago

@phanlezz you mean like the following?

├📁 merge
├─📄 prj1.git.cc.json
├─📄 prj1.sonar.cc.json                
├─📄 prj2.merge.cc.json
├─📄 ...
├─📄 prj20.merge.cc.json               

I'd say it would be nice if --fat complained and aborted then. Maybe the user forgot to merge the two prj1 files beforehand.

Richargh commented 1 week ago

For now at least, I would keep --mimo and --fat seperate. They fulfil different purposes during a health check and I hope the code is clearer when we keep them separate.