Can we create custom rule using control flow graph & data flow analysis

Currently I can see that we can write custom rules using AST , It would be good if I am able to create rule using control flow graph . Do we have it already ??

Which language are you talking about?

For Java