How to set the new code period to the last green quality gate

We are using Sonarqube 8.0 and TFS together with gated checkins. So when I check in a version of the code that makes the quality gate red, we break the build and the checkin gets rejected. But if I check in the exact same code again, sonarqube only analyses the new code and therefore the gate is green again, as there is no difference to the last analysis, which was red. So we where thinking to make the “New Code Period” the last green analysis, but this does not seem possible. I can only choose “Previous” “Periods of days” and “Specific”. To me this does not make all too much sense, as I only want to see what is changing to my current checkin. Maybe we have to analyse the master branch and only set the analysis to check versus a specific version of the master branch, but that seems like a lot of work to always select a new version when we merge to master.

I know the analysis works better with pull requests to master from private projects, but we do not have git here, so this is no option right now.

Is there a good way to keep our dev branches clean with sonarqube? Right now it feels a little useless in combination with TFS and a single DEV branch…