Track uses of disallowed methods

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) 8.2 Community version
  • what are you trying to achieve
    I want to track if a specific method is being called in my application using the Rule template “Track uses of disallowed methods” and unable trace it.
  • what have you tried so far to achieve this
    I created a new custom rule based on the rule template “Track uses of disallowed methods”. The rule unable to track the usage of that method.
    Below is the information I gave during rule creation
    methodname : test
    Classname : org.opensource.MyClass
    Arguments: java.lang.String

Can someone help ?

Hello @SenthilKumarB,

Welcome to the SonarSource community. :wave:. I hope you’ll like it.
Did you add your custom rule to the quality profile used for the analyzed project ?
If no, that’s probably the problem
If yes, please show me more stuff:

  • A screenshot of your rule
  • An evidence that the rule is in the quality profile used during the project analysis
  • A screenshot of the code snippet where you expect the rule to raise an issue that is not raised (a false negative)

Olivier