MCPcopy Index your code
hub / github.com/coder/coder / classifyCall

Function classifyCall

scripts/intxcheck/analyzer.go:202–214  ·  view source on GitHub ↗
(pass *analysis.Pass, call *ast.CallExpr, outerStore outerStoreMatcher)

Source from the content-addressed store, hash-verified

200)
201
202func classifyCall(pass *analysis.Pass, call *ast.CallExpr, outerStore outerStoreMatcher) (misuseKind, token.Pos) {
203 if receiver := callReceiver(call); receiver != nil && outerStore.matches(pass, receiver) {
204 return misuseDirect, receiver.Pos()
205 }
206
207 for _, arg := range call.Args {
208 if outerStore.matches(pass, arg) {
209 return misusePassThrough, arg.Pos()
210 }
211 }
212
213 return misuseNone, token.NoPos
214}
215
216func bodyUsesOuterStore(pass *analysis.Pass, body *ast.BlockStmt, outerStore outerStoreMatcher) bool {
217 outerStore = outerStore.withAliases(pass, body)

Callers 2

reportCallMisuseFunction · 0.85
bodyUsesOuterStoreFunction · 0.85

Calls 2

callReceiverFunction · 0.85
matchesMethod · 0.80

Tested by

no test coverage detected