I ran the following script for getting repositories which have implemented amazon aws lambda. I am not getting any repositories as output. Can you please check the code and tell me what is wrong here. Does that mean that there are no repositories using that import statement? I am looking for com.amazonaws.services.lambda.
# Counting the number of Java repositories containing amazon aws lambda
p:Project = input;
java_projects: output sum of int;
java_repos: output sum of int;
empty_list: output collection [int] of string;
aws_projects: output sum of int;
aws_projects_urls: output collection of string;
empty := false;
index := 0;
count :=0;
amazon := false;
declarations : map[string] of bool;
visit(p, visitor {
before n: Project -> {
ifall (i: int; !match(`^java$`, lowercase(n.programming_languages[i])))
stop;
}
after cr: CodeRepository -> {
java_repos << 1;
if (amazon)
{
aws_projects_urls << cr.url;
aws_projects << 1;
}
}
after n: Project -> {
java_projects << 1;
if (empty)
{
index = index + 1;
}
}
# look for imports
before node: ASTRoot ->
exists(j: int; match("^com\\.amazonaws\\.services\\.lambda\\.", node.imports[j])) {
amazon = true;
}
# look for FQN
before node: Type ->
if (match("^com\\.amazonaws\\.services\\.lambda\\.",
node.name)) {
amazon = true;
stop;
}
});