Skip to content

Commit 0eaeb3b

Browse files
committed
Rename moduleImport to getTopLevelMember
1 parent 8451286 commit 0eaeb3b

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

ql/src/codeql_ruby/ApiGraphs.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,15 @@ module API {
212212
Root root() { any() }
213213

214214
/**
215-
* Gets a node corresponding to an import of top-level module `m`.
215+
* Gets a node corresponding to a top-level member `m` (typically a module).
216+
*
217+
* This is equivalent to `root().getAMember("m")`.
216218
*
217219
* Note: You should only use this predicate for top level modules or classes. If you want nodes corresponding to a nested module or class,
218220
* you should use `.getMember` on the parent module/class. For example, for nodes corresponding to the class `Gem::Version`,
219-
* use `moduleImport("Gem").getMember("Version")`.
221+
* use `getTopLevelMember("Gem").getMember("Version")`.
220222
*/
221-
Node moduleImport(string m) { result = root().getMember(m) }
223+
Node getTopLevelMember(string m) { result = root().getMember(m) }
222224

223225
/**
224226
* Provides the actual implementation of API graphs, cached for performance.

ql/src/queries/security/cwe-732/WeakFilePermissions.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class PermissionArgument extends DataFlow::Node {
4949

5050
PermissionArgument() {
5151
exists(string methodName |
52-
call = API::moduleImport(["File", "FileUtils"]).getAMethodCall(methodName)
52+
call = API::getTopLevelMember(["File", "FileUtils"]).getAMethodCall(methodName)
5353
|
5454
methodName in ["chmod", "chmod_R", "lchmod"] and this = call.getArgument(0)
5555
or

0 commit comments

Comments
 (0)