mining aws serverless repository

45 views
Skip to first unread message

manu audi

unread,
Apr 6, 2020, 3:56:10 PM4/6/20
to Boa Language and Infrastructure User Forum
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;
      }
});

thank you

Robert Dyer

unread,
Apr 6, 2020, 4:02:26 PM4/6/20
to Boa Language and Infrastructure User Forum
Hi Manu,

AWS lambda launched in November 2014.

So given our dataset was generated in 2015, it is entirely possible there were no open source repositories using lambda at that point in time.

I think the logic of you query looks ok.  So that is my suspicion.

- Robert

manu audi

unread,
Apr 6, 2020, 4:20:08 PM4/6/20
to Boa Language and Infrastructure User Forum
Thank you for your quick reply. I have another question. I ran it on October 2019 dataset and not on 2015 dataset.  

Robert Dyer

unread,
Apr 6, 2020, 4:21:43 PM4/6/20
to Boa Language and Infrastructure User Forum
Your confusion is understandable.  See here about that dataset:


Specifically it mentions "Data source: GitHub (identical data to September 2015 dataset)".  So that dataset's name is somewhat misleading, and I apologize for that.

- Robert

manu audi

unread,
Apr 6, 2020, 4:26:46 PM4/6/20
to Boa Language and Infrastructure User Forum
Thanks for your swift reply again and helping me out.


On Monday, April 6, 2020 at 9:56:10 PM UTC+2, manu audi wrote:
Reply all
Reply to author
Forward
0 new messages