How to use the custom rule to check that there is anywhere can apply design patterns?

Hello guys!
I want to use the custom rule to check that there is anywhere can apply design patterns
like Factory design pattern or Strategy design pattern etc.
But I need some suggestions because I’m not familiar with the SonarQube semanticAPI.
I’d appreciate it if anyone would help me
Can somebody help me, please

my SonarQube version: 8.9.2.46101
the language I use: Java

Thanks a lot!

Hi,

It sounds like you need to implement cross-file checks to make this work…? Unfortunately, that’s not currently supported in custom rules.

 
Ann

What if I put all the classes in one file?
Does this make it simpler?

Ehm… At that point I have no idea. I’ve flagged this for more expert attention.

 
Ann

Thank you so much
Have a nice day!