Skip to content

Commit e81fba3

Browse files
Eshani Parulekarccojocar
authored andcommitted
refactor(G304): remove unused trackJoin helper; no functional change
1 parent ab078db commit e81fba3

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

rules/readfile.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,6 @@ func (r *readfile) trackFilepathClean(n ast.Node) {
9494
}
9595
}
9696

97-
// trackJoin records when a Join() call result is assigned to an identifier
98-
// example: fullPath := filepath.Join(baseDir, cleanPath)
99-
func (r *readfile) trackJoin(n ast.Node) {
100-
// n is expected to be a *ast.CallExpr (Join(...)) but the assignment is a different node.
101-
// We will look for an enclosing AssignStmt if provided (the caller passes n which is the call)
102-
if joinCall, ok := n.(*ast.CallExpr); ok && len(joinCall.Args) > 0 {
103-
// We don't have direct access to the enclosing assignment here (since Match receives call exprs),
104-
// so the practical approach is: when Match sees a Join call used in an assignment, it should call this helper
105-
// with the assignment node. For simplicity, we will expect the caller to pass an AssignStmt.
106-
_ = joinCall // caller should call trackJoin on the AssignStmt (see Match where we call it)
107-
}
108-
}
109-
11097
// trackJoinAssignStmt tracks assignments where RHS is a Join(...) call and LHS is an identifier
11198
func (r *readfile) trackJoinAssignStmt(node *ast.AssignStmt, c *gosec.Context) {
11299
if len(node.Rhs) == 0 {

0 commit comments

Comments
 (0)