Filtering Python, Ruby, and JS repos by framework

56 views
Skip to first unread message

Luke Soldano

unread,
Nov 8, 2015, 1:13:56 PM11/8/15
to Boa Language and Infrastructure User Forum
Hey!

I am fairly new to Boa and am working on a MSR project having to do with different web frameworks used by different languages. I need to pull out repo URLs of repos using the corresponding frameworks (EG Django for Python, Rails for Ruby, and Angular for JS). I was able to do this with Java for the Spring framework by reading the import statements, but this same concept hasn't worked for me with the other languages. Is this possible for the aforementioned languages, and if so can I get some advice on how to do it or what I should change to make it work? I am posting the code I used for the Spring framework below for anyone in the future who might need help with it.

# Counting the number of active Java projects with SVN
p:Project = input;

committers: output sum[int] of int;
java_projects: output sum of int;
java_repos: output sum of int;
empty_list: output collection [int] of string;
spring_projects: output sum of int;
spring_project_committers: output sum[int] of int;
spring_projects_commiters_gt4_commits: output sum[int] of int;
spring_projects_commiters_gt4_commits_gt_20: output sum[int] of int;
spring_projects_commiters_gt4_commits_gt_20_url: output collection of string;

empty := false;
names: map[string] of bool;
index := 0;
count :=0;

spring := false;
declarations : map[string] of bool;

visit(p, visitor {
  before n: Project -> {
    ifall (i: int; !match(`^java$`, lowercase(n.programming_languages[i])))
      stop;
  }
  before n: Person -> {
      names[n.real_name] = true;
  }

  after cr: CodeRepository -> {
    java_repos << 1;
    if (len(names) == 0) {
      empty = true;
    }
    if (spring)
    {
      spring_projects << 1;
      spring_project_committers[len(names)] << 1;
      if (len(names) > 4) {
        spring_projects_commiters_gt4_commits[len(cr.revisions)] << 1;
        if (len(cr.revisions) > 20){
          spring_projects_commiters_gt4_commits_gt_20[len(declarations)] << 1;
 spring_projects_commiters_gt4_commits_gt_20_url << cr.url;
        }
      }
    }
    clear(names);
  }
  after n: Project -> {
    java_projects << 1;
    if (empty)
    {
      index = index + 1;
    }
  }
   # look for imports
  before node: ASTRoot ->
      exists(j: int; match("^org\\.springframework\\.”, node.imports[j])) {
      spring = true;
      }

  # look for FQN
  before node: Type ->
      if (match("^org\\.springframework\\.”, node.name)) {
      spring = true;
      stop;
      }
});

Robert E Dyer

unread,
Nov 8, 2015, 1:18:46 PM11/8/15
to boa-...@googlegroups.com
Hi Luke,

At the moment Boa’s datasets only include source code (ASTs) for the Java source languages.  We are working to add support for additional languages (Javascript and PHP are coming soon).

- Robert

--
More information about Boa: http://boa.cs.iastate.edu/
---
You received this message because you are subscribed to the Google Groups "Boa Language and Infrastructure User Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to boa-user+u...@googlegroups.com.
To post to this group, send email to boa-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

________________________________________________
Robert Dyer | Assistant Professor | Department of Computer Science
BGSU | rd...@bgsu.edu | 419.372.3469 | 244 Hayes | Bowling Green, OH

Want to mine ultra-large-scale software repositories with minimal initial
investment? Check out Boa! http://boa.cs.iastate.edu/

Luke Soldano

unread,
Nov 8, 2015, 2:25:34 PM11/8/15
to Boa Language and Infrastructure User Forum
Hey Rob,

Thanks for the quick response! How soon is soon?

Cheers
~ Luke

Robert E Dyer

unread,
Nov 8, 2015, 2:27:12 PM11/8/15
to boa-...@googlegroups.com
Hi Luke,

Hopefully the next dataset generation will include these.  But that may be in spring (3-4 months).

- Robert
Reply all
Reply to author
Forward
0 new messages