Irrelevant PR comments for the code smells

Hi Team,
I have code change and merging to the main branch, but Sonarqube has detected some code smells for different files and populated in the PR.please find the screenshot

But file change is as below

can you please help with this ,why it is showing the different file code smells [quality gate is used only for the new code]

Hi,

This is difficult to diagnose without more information, but at a guess, there’s something strange going on with the checkout. Would you care to share your job log, starting from the checkout?

 
Ann