@@ -354,31 +354,24 @@ private module Pino {
354354 /**
355355 * Gets a logger instance from the `pino` library.
356356 */
357- private DataFlow :: SourceNode pino ( ) {
358- result = pinoApi ( ) . getAnImmediateUse ( )
357+ private API :: Node pino ( ) {
358+ result = pinoApi ( )
359359 or
360360 // `pino` is installed as the "log" property on the request object in `Express` and similar libraries.
361361 // in `Hapi` the property is "logger".
362- exists ( HTTP:: RequestExpr req |
363- result = req .flow ( ) .getALocalSource ( ) .getAPropertyRead ( [ "log" , "logger" ] )
362+ exists ( HTTP:: RequestExpr req , API:: Node reqNode |
363+ reqNode .getAnImmediateUse ( ) = req .flow ( ) .getALocalSource ( ) and
364+ result = reqNode .getMember ( [ "log" , "logger" ] )
364365 )
365366 }
366367
367- /**
368- * Gets a reference to a logger method from the `pino` library.
369- */
370- private DataFlow:: SourceNode pinoCallee ( DataFlow:: TypeTracker t ) {
371- t .startInProp ( [ "trace" , "debug" , "info" , "warn" , "error" , "fatal" ] ) and
372- result = pino ( )
373- or
374- exists ( DataFlow:: TypeTracker t2 | result = pinoCallee ( t2 ) .track ( t2 , t ) )
375- }
376-
377368 /**
378369 * A logging call to the `pino` library.
379370 */
380371 private class PinoCall extends LoggerCall {
381- PinoCall ( ) { this = pinoCallee ( DataFlow:: TypeTracker:: end ( ) ) .getACall ( ) }
372+ PinoCall ( ) {
373+ this = pino ( ) .getMember ( [ "trace" , "debug" , "info" , "warn" , "error" , "fatal" ] ) .getACall ( )
374+ }
382375
383376 override DataFlow:: Node getAMessageComponent ( ) { result = getAnArgument ( ) }
384377 }
0 commit comments