Skip to content

Commit a359b1b

Browse files
Adding metadata
1 parent 453d669 commit a359b1b

File tree

1 file changed

+10
-8
lines changed
  • .github/codeql/custom-queries/python

1 file changed

+10
-8
lines changed

.github/codeql/custom-queries/python/rmtree.ql

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
import python
21
/*
3-
* Identify use of rmtree from shutil
4-
*
5-
* shutil.rmtree(...)
6-
*
2+
* @id python/call-to-shutil-rmtree
3+
* @name Identify use of rmtree from shutil
4+
* @description We have specific ways to delete files - this query
5+
* notifies when there are calls to `shutil.rmtree` so
6+
* that we can revue how deletion is done.
7+
* @kind problem
8+
* @problem.severity warning
9+
* @precision high
10+
* @tags correctness
711
*
812
*/
913

10-
// from PythonFunctionValue rmtree, CallNode call
11-
// where rmtree.getName() = "rmtree" and rmtree.getACall() = call
12-
// select rmtree.getName(), rmtree.getClass()
14+
import python
1315

1416
from ControlFlowNode call, Value eval
1517
where eval = Value::named("shutil.rmtree") and

0 commit comments

Comments
 (0)