Analysis issue with Sonar (Analyzing the older code)

Details about sonar server we are using,

  • Developer Edition, Version 9.9.1 LTS (build 69595)
  • SonarQube is deployed in a azure VM (IIS server)

Issue we are facing:

SonarAnalysis was running properly so far, for the past few weeks the analysis show vulnerable for the older code which has been committed years back. Attached image for your reference.

There is no issues in the existing commits, why the sonar analysis is checking for the older code. If so it is vulnerable, why the analysis hasn’t reported this long before.

[Note: we have facing the above issue in recent times when we had 9.2.4 version. So after suggestion from the sonar community, I had updated the Sonar to the new LTS version. Though, even after updating we are still facing this issue]![Sonar_analysis_oldercode|690x301](upload://ailhf4vAn8Da0l7nsJaEB2uc9lP.png)

Kindly acknowledge and help out on the same.

But, even after updating the Sonar latest LTS, it’s still analyzing our old code in our repo. Like 10mos ago, 1yr ago
How can we do this by exclude analysis on the old code? Could you please let us know?