File tree Expand file tree Collapse file tree
ql/src/queries/performance Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /**
2+ * @name Missing `noinline` or `nomagic` annotation
3+ * @description When a predicate is factored out to improve join-ordering, it should be marked as `noinline` or `nomagic`.
4+ * @kind problem
5+ * @problem.severity error
6+ * @id ql/missing-noinline
7+ * @tags performance
8+ * @precision high
9+ */
10+
11+ import ql
12+
13+ from QLDoc doc , Predicate decl
14+ where
15+ doc .getContents ( ) .matches ( [ "%join order%" , "%join-order%" ] ) and
16+ decl .getQLDoc ( ) = doc and
17+ not decl .getAnAnnotation ( ) instanceof NoInline and
18+ not decl .getAnAnnotation ( ) instanceof NoMagic and
19+ not decl .getAnAnnotation ( ) instanceof NoOpt and
20+ // If it's marked as inline it's probably because the QLDoc says something like
21+ // "this predicate is inlined because it gives a better join-order".
22+ not decl .getAnAnnotation ( ) instanceof Inline
23+ select decl , "This predicate might be inlined."
You can’t perform that action at this time.
0 commit comments