New project setup with non-desired "main" branch now doesn't scan entire codebase for initial scan

I’m trying to set up new scan projects. Initially, the “master” branch was targeted but this isn’t what we want, we want it targeting develop because that is where all our changes get folded in. Master is just for when we deploy to prod and we need the analysis far upstream of that for obvious reasons.

So per guidance on other forum questions, I deleted the “develop” branch in sonar cloud (which was incidentally incorrectly marked as short-lived) and changed the name of the main branch to “develop”

Now, the problem I’m having is I don’t have any scan of the full codebase. When I run the pipeline it says there are no changed lines of code so I have no baseline (and no bugs, no smells etc). I have “Previous version” set as the New code type, but I’m wondering if I have to use days and put some ridiculous number of days longer than the age of the project to make sure it picks up the entire codebase, and then change it later? Or is there a better way of doing this?

  • ALM used Azure DevOps
  • CI system used: Azure Devops pipelines → Bitbucket Cloud repo
  • Monorepo with two projects: one .NET, one JS

Thanks in advance

No matter what, when you analyze the main branch you should receive a full analysis of your code.

Can you share a screenshot of what you’re seeing on your develop branch?