I want to develop a plugin which can be used to find session used in our code means whether code is stateless or stateful

I want to develop a sonar plugin for our PCF to check statefull nature of our code (12 factor)which can be used to find session used in our code means whether code is stateless or statefull,whether our code follow 12 factor or not.

if any one can give some relevant solution