Hi there!
I was wondering if there is a way to compare metrics of two different projects branch by branch somehow. A chart or a diagram would be best. This would be super helpful to our bosses as it would allow them compare code quality between all projects in a portfolio.
You’ve clued onto an important word. Portfolios are a feature coming with the Enterprise Edition of SonarQube and above, and are meant for this purpose (high level overview targeting manager-level positions)
Portfolios are an Enterprise Edition feature. If you need to pull data to generate aggregate reports on your own, the Web API (documentation linked in the footer of your instance) is available.