Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 07ffa9f

Browse files
committed
Python: More documentation
1 parent e54c925 commit 07ffa9f

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

python/ql/src/semmle/python/ApiGraphs.qll

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ module API {
6060
/**
6161
* Gets a node representing member `m` of this API component.
6262
*
63-
* For example, modules have an `exports` member representing their exports, and objects have
64-
* their properties as members.
63+
* For example, a member can be:
64+
*
65+
* - A submodule of a module
66+
* - An attribute of an object
6567
*/
6668
bindingset[m]
6769
bindingset[result]
@@ -235,7 +237,11 @@ module API {
235237
MkRoot() or
236238
/** An abstract representative for imports of the module called `name`. */
237239
MkModuleImport(string name) {
238-
imports(_, name) or name = any(ImportExpr e | not e.isRelative()).getAnImportedModuleName()
240+
imports(_, name)
241+
or
242+
// When we `import foo.bar.baz` we want to create API graph nodes also for the prefixes
243+
// `foo` and `foo.bar`:
244+
name = any(ImportExpr e | not e.isRelative()).getAnImportedModuleName()
239245
} or
240246
/** A use of an API member at the node `nd`. */
241247
MkUse(DataFlow::Node nd) { use(_, _, nd) }

0 commit comments

Comments
 (0)