By now, there is a specific analyzer available especiallyspecifically for such a task: https://github.com/DotNetAnalyzers/BannedApiAnalyzer
You have to define a ruleset in BannedSymbols.txtBannedSymbols.txt. In your case, BannedSymbols.txt would contain something like
M:Microsoft.SharePoint.SPListItemCollection.GetItemById(System.Int32);Potential performance problems
T:System.Net.Mail.SmtpClient;Use OurCompany.FancyClient instead
