classRestApiCallableextendsCallable { RestApiCallable(){ (this.getDeclaringType().getName().regexpMatch(".+Controller") or this.getDeclaringType().getName().regexpMatch(".+Resource") or this.getDeclaringType().getName().regexpMatch(".+Impl")) and not this.getDeclaringType().getName().regexpMatch(".+DaoImpl") } }
classRestApiCallableextendsCallable { RestApiCallable(){ (this.getDeclaringType().getName().regexpMatch(".+Controller") or this.getDeclaringType().getName().regexpMatch(".+Resource") or this.getDeclaringType().getName().regexpMatch(".+Impl")) and not this.getDeclaringType().getName().regexpMatch(".+DaoImpl") } } query predicate edge(Method source,Callable sink) { source.calls(sink) } from DangerousMethod sink,RestApiCallable source where edge(source, sink.getCaller()) select source,source.getQualifiedName(),sink,sink.getCaller().getQualifiedName()
} } classRestApiCallableextendsCallable { RestApiCallable(){ (this.getDeclaringType().getName().regexpMatch(".+Controller") or this.getDeclaringType().getName().regexpMatch(".+Resource") or this.getDeclaringType().getName().regexpMatch(".+Impl")) and not this.getDeclaringType().getName().regexpMatch(".+DaoImpl") } } query predicate edge(Method source,Callable sink) { exists(Interface interface,Callable able | interface = sink.getDeclaringType().getASupertype() and not interfaceinstanceof TypeObject | able = interface.getAMethod() and able.getName() = sink.getName() and source.calls(able) ) } from DangerousMethod sink,RestApiCallable source,RestApiCallable source2 where edge(source, sink.getCaller()) and edge(source2,source) select source2,source2.getQualifiedName(),source,source.getQualifiedName(),sink,sink.getCaller().getQualifiedName()