1
1
import javascript
2
2
import semmle.javascript.frameworks.React
3
3
4
- query predicate test_getADirectStateAccess ( ReactComponent c , DataFlow:: SourceNode res ) {
4
+ query predicate getADirectStateAccess ( ReactComponent c , DataFlow:: SourceNode res ) {
5
5
res = c .getADirectStateAccess ( )
6
6
}
7
7
8
- query predicate test_ReactComponent_getInstanceMethod ( ReactComponent c , string n , Function res ) {
8
+ query predicate getInstanceMethod ( ReactComponent c , string n , Function res ) {
9
9
res = c .getInstanceMethod ( n )
10
10
}
11
11
12
- query predicate test_react ( DataFlow:: ValueNode nd ) { react ( ) .flowsTo ( nd ) }
12
+ query predicate reactLibraryRef ( DataFlow:: ValueNode nd ) { react ( ) .flowsTo ( nd ) }
13
13
14
- query predicate test_ReactComponent_getAPreviousStateSource (
15
- ReactComponent c , DataFlow:: SourceNode res
16
- ) {
14
+ query predicate getAPreviousStateSource ( ReactComponent c , DataFlow:: SourceNode res ) {
17
15
res = c .getAPreviousStateSource ( )
18
16
}
19
17
20
- query predicate test_ReactComponent_ref ( ReactComponent c , DataFlow:: Node res ) { res = c .ref ( ) }
18
+ query predicate reactComponentRef ( ReactComponent c , DataFlow:: Node res ) { res = c .ref ( ) }
21
19
22
- query predicate test_ReactComponent_getACandidateStateSource (
23
- ReactComponent c , DataFlow:: SourceNode res
24
- ) {
20
+ query predicate getACandidateStateSource ( ReactComponent c , DataFlow:: SourceNode res ) {
25
21
res = c .getACandidateStateSource ( )
26
22
}
27
23
28
- query predicate test_ReactComponent_getADirectPropsSource ( ReactComponent c , DataFlow:: SourceNode res ) {
24
+ query predicate getADirectPropsSource ( ReactComponent c , DataFlow:: SourceNode res ) {
29
25
res = c .getADirectPropsAccess ( )
30
26
}
31
27
32
- query predicate test_ReactComponent_getACandidatePropsValue ( DataFlow:: Node res ) {
28
+ query predicate getACandidatePropsValue ( DataFlow:: Node res ) {
33
29
exists ( ReactComponent c | res = c .getACandidatePropsValue ( _) )
34
30
}
35
31
36
- query predicate test_ReactComponent ( ReactComponent c ) { any ( ) }
32
+ query predicate reactComponent ( ReactComponent c ) { any ( ) }
37
33
38
- query predicate test_ReactComponent_getAPropRead ( ReactComponent c , string n , DataFlow:: PropRead res ) {
34
+ query predicate getAPropRead ( ReactComponent c , string n , DataFlow:: PropRead res ) {
39
35
res = c .getAPropRead ( n )
40
36
}
41
37
42
- query predicate test_JSXname ( JsxElement element , JsxName jsxname , string name , string type ) {
38
+ query predicate jsxName ( JsxElement element , JsxName jsxname , string name , string type ) {
43
39
name = jsxname .getValue ( ) and
44
40
(
45
41
jsxname instanceof Identifier and type = "Identifier"
@@ -53,7 +49,7 @@ query predicate test_JSXname(JsxElement element, JsxName jsxname, string name, s
53
49
element .getNameExpr ( ) = jsxname
54
50
}
55
51
56
- query ThisExpr test_JsxName_this ( JsxElement element ) { result .getParentExpr + ( ) = element }
52
+ query ThisExpr jsxNameThis ( JsxElement element ) { result .getParentExpr + ( ) = element }
57
53
58
54
query DataFlow:: SourceNode locationSource ( ) { result = DOM:: locationSource ( ) }
59
55
0 commit comments