From 6ddc2596fc7d00af06963fb2ae243e7132e660fc Mon Sep 17 00:00:00 2001 From: Rasmus Wriedt Larsen Date: Fri, 22 Sep 2023 11:21:36 +0200 Subject: [PATCH] SubclassFinder: don't include site-packages --- .../semmle/python/frameworks/internal/SubclassFinder.qll | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/python/ql/lib/semmle/python/frameworks/internal/SubclassFinder.qll b/python/ql/lib/semmle/python/frameworks/internal/SubclassFinder.qll index b2036bef955..5aa039a9f26 100644 --- a/python/ql/lib/semmle/python/frameworks/internal/SubclassFinder.qll +++ b/python/ql/lib/semmle/python/frameworks/internal/SubclassFinder.qll @@ -112,12 +112,8 @@ module NotExposed { } predicate isAllowedModule(Module mod) { - // for now, we only want to model things in site-packages (since we know these are - // libraries used by real code) - mod.getFile().getAbsolutePath().matches("%/site-packages/%") - or - // for CI testing - mod.getFile().getRelativePath().matches("%/find_subclass_test.py") + // don't include anything found in site-packages + exists(mod.getFile().getRelativePath()) } predicate isTestCode(AstNode ast) {