File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed
python/ql/src/semmle/python Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ class File extends Container {
7474 string getContents ( ) { file_contents ( this , result ) }
7575
7676 /** Holds if this file is likely to get executed directly, and thus act as an entry point for execution. */
77- predicate maybeExecutedDirectly ( ) {
77+ predicate isPossibleEntryPoint ( ) {
7878 // Only consider files in the source code, and not things like the standard library
7979 exists ( this .getRelativePath ( ) ) and
8080 (
@@ -148,9 +148,6 @@ class Folder extends Container {
148148 this .getBaseName ( ) .regexpMatch ( "[^\\d\\W]\\w*" ) and
149149 result = this .getParent ( ) .getImportRoot ( n )
150150 }
151-
152- /** Holds if execution may start in a file in this directory. */
153- predicate mayContainEntryPoint ( ) { any ( File f | f .getParent ( ) = this ) .maybeExecutedDirectly ( ) }
154151}
155152
156153/**
Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ private predicate transitively_imported_from_entry_point(File file) {
211211 importer .getParent ( ) = file .getParent ( ) and
212212 exists ( ImportExpr i | i .getLocation ( ) .getFile ( ) = importer and i .getName ( ) = file .getStem ( ) )
213213 |
214- importer .maybeExecutedDirectly ( ) or transitively_imported_from_entry_point ( importer )
214+ importer .isPossibleEntryPoint ( ) or transitively_imported_from_entry_point ( importer )
215215 )
216216}
217217
You can’t perform that action at this time.
0 commit comments