Merging two sonar reports from the same project

I am using sonarqube version 8.7 for my client. I have a huge codebase, which is legacy of course, with 40M+ lines of code.

I was trying to generate sonar report for the java files of the whole project in Teamcity but it fails either with OutOfMemoryException or TimeoutException. It turns out that we have a module that is having layers connecting to database (DAO layer) and because of that module only, we are getting these errors.

So what I did was, separated that layer using sonar.exclusion and generated two reports, with different project keys, one for that particular DAO layer and other for rest of the project. It is taking long time for DAO layer but lets assume it’s fine given that codebase is huge.

Now I want to show this report in bitbucket too. But the obstacle is that we can not fetch sonar reports from multiple project keys. Rather it needs only single report per project that is not possible for me to generate as of now.

Now there can be two ways, one can be that I somehow generate separate reports and merge them into one project key. Other way would be to fetch the report from multiple project keys into bitbucket.

Can you help me in achieving any of the above solution or maybe any other approach that is feasible and results in same way that I want?


Welcome to the community!

First, your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

8.7 → 8.9.4 → 9.2.2 (last step optional)

You may find the Upgrade Guide helpful.

Regarding your question, it sounds like you’re looking for monorepo support for PR decoration. That starts in Enterprise Edition($$).