mirror of
https://github.com/github/codeql.git
synced 2026-03-28 02:08:17 +01:00
The old query uses `pointsTo` to limit the sinks to methods on lists and dictionaries. That constraint is omitted here which could hurt performance.
24 lines
713 B
Plaintext
24 lines
713 B
Plaintext
/**
|
|
* @name Modification of parameter with default
|
|
* @description Modifying the default value of a parameter can lead to unexpected
|
|
* results.
|
|
* @kind path-problem
|
|
* @tags reliability
|
|
* maintainability
|
|
* @problem.severity error
|
|
* @sub-severity low
|
|
* @precision high
|
|
* @id py/modification-of-default-value
|
|
*/
|
|
|
|
import python
|
|
import semmle.python.functions.ModificationOfParameterWithDefault
|
|
import DataFlow::PathGraph
|
|
|
|
from
|
|
ModificationOfParameterWithDefault::Configuration config, DataFlow::PathNode source,
|
|
DataFlow::PathNode sink
|
|
where config.hasFlowPath(source, sink)
|
|
select sink.getNode(), source, sink, "$@ flows to here and is mutated.", source.getNode(),
|
|
"Default value"
|