mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Rename moduleImport to getTopLevelMember
This commit is contained in:
@@ -212,13 +212,15 @@ module API {
|
||||
Root root() { any() }
|
||||
|
||||
/**
|
||||
* Gets a node corresponding to an import of top-level module `m`.
|
||||
* Gets a node corresponding to a top-level member `m` (typically a module).
|
||||
*
|
||||
* This is equivalent to `root().getAMember("m")`.
|
||||
*
|
||||
* Note: You should only use this predicate for top level modules or classes. If you want nodes corresponding to a nested module or class,
|
||||
* you should use `.getMember` on the parent module/class. For example, for nodes corresponding to the class `Gem::Version`,
|
||||
* use `moduleImport("Gem").getMember("Version")`.
|
||||
* use `getTopLevelMember("Gem").getMember("Version")`.
|
||||
*/
|
||||
Node moduleImport(string m) { result = root().getMember(m) }
|
||||
Node getTopLevelMember(string m) { result = root().getMember(m) }
|
||||
|
||||
/**
|
||||
* Provides the actual implementation of API graphs, cached for performance.
|
||||
|
||||
@@ -49,7 +49,7 @@ class PermissionArgument extends DataFlow::Node {
|
||||
|
||||
PermissionArgument() {
|
||||
exists(string methodName |
|
||||
call = API::moduleImport(["File", "FileUtils"]).getAMethodCall(methodName)
|
||||
call = API::getTopLevelMember(["File", "FileUtils"]).getAMethodCall(methodName)
|
||||
|
|
||||
methodName in ["chmod", "chmod_R", "lchmod"] and this = call.getArgument(0)
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user