Different result of analysis for different branch

Hello Team,

We recently encountered a problem, where-in we saw that the analysis ran on 1 branch passed the quality gates and on another branch, the quality gate was failed, wherein both the branch has the same code

We pushed the code in our development branch and the analysis was executed, the quality gate passed without any error.
Then we raised the Pull Request against our Release branch the Quality gate was failed at that point, and the reason was Maintainability rating was raised from E

Our Quality gate thresholds are set as below:

Analysis Logs:

4_Run Code Analysis.txt (15.5 KB) [5_Publish Quality Gate Result.txt|attachment]
(upload://8kLS7PFffow5W1RP4ZADA2DGYfT.txt) (994 Bytes) 3_Prepare analysis on SonarQube.txt (808 Bytes)

This was the only error that was raised during the analysis and this set the maintainability rating to E.

When I am trying to reproduce the same in my machine with the same file, it says the maintainability rating as A and doesn’t fail the build.

Please help me understand if it is a glitch in the system? or how do we avoid getting this same in the future?

I am adding my colleague will followup along with me @sohailshaikh001


Is the issue about refactoring the method exists in the feature branch? Perhaps the code is not considered to be “new” in the feature branch, so the criteria about New Code doesn’t apply?
What is the New Code Period that is defined in the feature branch?

Thanks, @dmeneses for your response.
The new code period for both the branches was set on the same date(Aug 7, 2020).

So both the branches QG should have failed, rite?