Merge pull request #15473 from github/koesie10/ruby-model-only-public-methods

Ruby: Only generate models for public methods
This commit is contained in:
Harry Maclean
2024-01-31 09:27:27 +00:00
committed by GitHub

View File

@@ -43,6 +43,7 @@ string getArgumentPath(DataFlow::ParameterNode paramNode) {
*/
predicate pathToMethod(DataFlow::MethodNode method, string type, string path) {
method.getLocation().getFile() instanceof RelevantFile and
method.isPublic() and // only public methods are modeled
exists(DataFlow::ModuleNode mod, string methodName |
method = mod.getOwnInstanceMethod(methodName) and
if methodName = "initialize"