Skip to content

Commit f8f5d8f

Browse files
committed
Exclude .pipe detection which are in a test file.
1 parent 5bb29b6 commit f8f5d8f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

javascript/ql/src/Quality/UnhandledStreamPipe.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
import javascript
15+
import semmle.javascript.filters.ClassifyFiles
1516

1617
/**
1718
* A call to the `pipe` method on a Node.js stream.
@@ -270,6 +271,7 @@ where
270271
hasErrorHandlerDownstream(pipeCall) and
271272
not isPipeFollowedByNonStreamAccess(pipeCall) and
272273
not hasNonStreamSourceLikeUsage(pipeCall) and
273-
not hasNonNodeJsStreamSource(pipeCall)
274+
not hasNonNodeJsStreamSource(pipeCall) and
275+
not isTestFile(pipeCall.getFile())
274276
select pipeCall,
275277
"Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped."

0 commit comments

Comments
 (0)