@@ -8,23 +8,17 @@ import go
8
8
* Provides classes for working with concepts from the [`clevergo.tech/clevergo@v0.5.2`](https://pkg.go.dev/clevergo.tech/clevergo@v0.5.2) package.
9
9
*/
10
10
private module CleverGo {
11
- /** Gets the package path. */
12
- bindingset [ result ]
13
- string packagePath ( ) {
14
- result = package ( [ "clevergo.tech/clevergo" , "github.com/clevergo/clevergo" ] , "" )
15
- }
16
-
17
11
/**
18
12
* Provides models of untrusted flow sources.
19
13
*/
20
14
private class UntrustedSources extends UntrustedFlowSource:: Range {
21
15
UntrustedSources ( ) {
22
16
// Methods on types of package: clevergo.tech/clevergo@v0.5.2
23
- exists ( string methodName , Method mtd , FunctionOutput outp |
24
- this = outp .getExitNode ( mtd .getACall ( ) )
17
+ exists ( string receiverName , string methodName , Method mtd , FunctionOutput outp |
18
+ this = outp .getExitNode ( mtd .getACall ( ) ) and
19
+ mtd .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , receiverName , methodName )
25
20
|
26
- // Receiver: Context
27
- mtd .hasQualifiedName ( packagePath ( ) , "Context" , methodName ) and
21
+ receiverName = "Context" and
28
22
(
29
23
// Method: func (*Context).BasicAuth() (username string, password string, ok bool)
30
24
methodName = "BasicAuth" and
@@ -59,8 +53,7 @@ private module CleverGo {
59
53
outp .isResult ( )
60
54
)
61
55
or
62
- // Receiver: Params
63
- mtd .hasQualifiedName ( packagePath ( ) , "Params" , methodName ) and
56
+ receiverName = "Params" and
64
57
(
65
58
// Method: func (Params).String(name string) string
66
59
methodName = "String" and
@@ -73,7 +66,7 @@ private module CleverGo {
73
66
this = outp .getExitNode ( mtd .getACall ( ) )
74
67
|
75
68
// Interface: Decoder
76
- mtd .implements ( packagePath ( ) , "Decoder" , methodName ) and
69
+ mtd .implements ( package ( "clevergo.tech/clevergo" , "" ) , "Decoder" , methodName ) and
77
70
(
78
71
// Method: func (Decoder).Decode(req *net/http.Request, v interface{}) error
79
72
methodName = "Decode" and
@@ -84,16 +77,18 @@ private module CleverGo {
84
77
// Structs of package: clevergo.tech/clevergo@v0.5.2
85
78
exists ( DataFlow:: Field fld |
86
79
// Struct: Context
87
- fld .hasQualifiedName ( packagePath ( ) , "Context" , "Params" )
80
+ fld .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "Context" , "Params" )
88
81
or
89
82
// Struct: Param
90
- fld .hasQualifiedName ( packagePath ( ) , "Param" , [ "Key" , "Value" ] )
83
+ fld .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "Param" , [ "Key" , "Value" ] )
91
84
|
92
85
this = fld .getARead ( )
93
86
)
94
87
or
95
88
// Types of package: clevergo.tech/clevergo@v0.5.2
96
- exists ( ValueEntity v | v .getType ( ) .hasQualifiedName ( packagePath ( ) , "Params" ) |
89
+ exists ( ValueEntity v |
90
+ v .getType ( ) .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "Params" )
91
+ |
97
92
this = v .getARead ( )
98
93
)
99
94
}
@@ -108,7 +103,7 @@ private module CleverGo {
108
103
// Taint-tracking models for package: clevergo.tech/clevergo@v0.5.2
109
104
(
110
105
// Function: func CleanPath(p string) string
111
- this .hasQualifiedName ( packagePath ( ) , "CleanPath" ) and
106
+ this .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "CleanPath" ) and
112
107
inp .isParameter ( 0 ) and
113
108
out .isResult ( )
114
109
)
@@ -129,19 +124,19 @@ private module CleverGo {
129
124
(
130
125
// Receiver: Application
131
126
// Method: func (*Application).RouteURL(name string, args ...string) (*net/url.URL, error)
132
- this .hasQualifiedName ( packagePath ( ) , "Application" , "RouteURL" ) and
127
+ this .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "Application" , "RouteURL" ) and
133
128
inp .isParameter ( _) and
134
129
out .isResult ( 0 )
135
130
or
136
131
// Receiver: Decoder
137
132
// Method: func (Decoder).Decode(req *net/http.Request, v interface{}) error
138
- this .implements ( packagePath ( ) , "Decoder" , "Decode" ) and
133
+ this .implements ( package ( "clevergo.tech/clevergo" , "" ) , "Decoder" , "Decode" ) and
139
134
inp .isParameter ( 0 ) and
140
135
out .isParameter ( 1 )
141
136
or
142
137
// Receiver: Renderer
143
138
// Method: func (Renderer).Render(w io.Writer, name string, data interface{}, c *Context) error
144
- this .implements ( packagePath ( ) , "Renderer" , "Render" ) and
139
+ this .implements ( package ( "clevergo.tech/clevergo" , "" ) , "Renderer" , "Render" ) and
145
140
inp .isParameter ( 2 ) and
146
141
out .isParameter ( 0 )
147
142
)
0 commit comments