Is it possible to scan multiple git repos as a single project in SonarQube?

Our web application is scattered across multiple git projects that gets combined into a single application during deployment.

Today, we just clone them into a single root folder and scan them using the SonarQube scanner. This works fine, but it doesn’t seem to understand the “new code” correctly; the New Code feature reports the Baselined bugs again – as new bugs – even if a there is a line change somewhere else in the code, possibly because it doesn’t understand the git blame correctly.

Example:

Commit 1:

a = a # baseline reports this as a bug

Commit 2:

# Added a comment.
a = a # new code reports this as a bug

This doesn’t seem to happen for a single git repo (the root folder has a .git in it), it only seems to happen for multiple repos scanned as a single project.

Root
|-- Project 1
|   `-- .git
`-- Project 2
    `-- .git

Can SonarQube scan multiple git repos, and also understand the git history correctly so that everything – including the New Code feature – works correctly?


SonarQube Version: 7.4

Hello @nishantvarma,

This is now a quite old version of SQ and many improvements have been made since then. Can you try the same on a fresh new SQ 8.5? I never tried this scenario myself but I don’t think it should be a problem.

Cheers

1 Like

Thanks, @Antoine. I will give that a try and update here.

1 Like