Exemple #1
0
def companiesData(period, startdate, enddate, identities_db, destdir, bots, npeople):
    companies  = SCM.companies_name_wo_affs(bots, startdate, enddate)
    companies = companies['name']
    createJSON(companies, destdir+"/scm-companies.json")

    for company in companies:
        company_name = "'"+ company+ "'"
        print (company_name)

        evol_data = SCM.GetSCMEvolutionaryData(period, startdate, enddate, identities_db, ["company", company_name])
        evol_data = completePeriodIds(evol_data)
        createJSON(evol_data, destdir+"/"+company+"-scm-com-evolutionary.json")

        agg = SCM.GetSCMStaticData(period, startdate, enddate, identities_db, ["company", company_name])
        createJSON(agg, destdir+"/"+company+"-scm-com-static.json")

        top_authors = SCM.company_top_authors(company_name, startdate, enddate, npeople)
        createJSON(top_authors, destdir+"/"+company+"-scm-com-top-authors.json", False)

        for i in [2006,2009,2012]:
            data = SCM.company_top_authors_year(company_name, i, npeople)
            createJSON(data, destdir+"/"+company+"-scm-top-authors_"+str(i)+".json", False)

    commits =  SCM.GetCommitsSummaryCompanies(period, startdate, enddate, opts.identities_db, 10)
    createJSON (commits, destdir+"/scm-companies-commits-summary.json")
Exemple #2
0
def countriesData(period, startdate, enddate, identities_db, destdir):
    countries  = SCM.scm_countries_names(identities_db,startdate, enddate)
    countries = countries['name']
    createJSON(countries, destdir+"/scm-countries.json")

    for country in countries:
        print (country)
        country_name = "'"+country+"'"

        evol_data = SCM.GetSCMEvolutionaryData(period, startdate, enddate, identities_db, ["country", country_name])
        evol_data = completePeriodIds(evol_data)
        createJSON (evol_data, destdir+"/"+country+"-scm-cou-evolutionary.json")

        agg = SCM.GetSCMStaticData(period, startdate, enddate, identities_db, ["country", country_name])
        createJSON (agg, destdir+"/"+country+"-scm-cou-static.json")
Exemple #3
0
def aggData(period, startdate, enddate, identities_db, destdir):
    # data = dataFrame2Dict(vizr.GetSCMStaticData(period, startdate, enddate, identities_db))
    data = SCM.GetSCMStaticData(period, startdate, enddate, identities_db, None)
    agg = data
    static_url = SCM.StaticURL()
    agg = dict(agg.items() + static_url.items())

    if ('companies' in reports):
        data = SCM.evol_info_data_companies (startdate, enddate)
        agg = dict(agg.items() + data.items())

    if ('countries' in reports): 
        data = SCM.evol_info_data_countries (startdate, enddate)
        agg = dict(agg.items() + data.items())

    if ('domains' in reports):
        data = SCM.evol_info_data_domains (startdate, enddate)
        agg = dict(agg.items() + data.items())

    data = SCM.GetCodeCommunityStructure(period, startdate, enddate, identities_db)
    agg = dict(agg.items() + data.items())

    # TODO: repeated data
    # data = dataFrame2Dict(vizr.GetDiffCommitsDays(period, enddate, 365))
    # agg = dict(agg.items() + data.items())

    # Tendencies    
    for i in [7,30,365]:
        data = SCM.GetDiffCommitsDays(period, enddate, identities_db, i)
        agg = dict(agg.items() + data.items())
        data = SCM.GetDiffAuthorsDays(period, enddate, identities_db, i)
        agg = dict(agg.items() + data.items())
        data = SCM.GetDiffFilesDays(period, enddate, identities_db, i)
        agg = dict(agg.items() + data.items())
        data = SCM.GetDiffLinesDays(period, enddate, identities_db, i)
        agg = dict(agg.items() + data.items())

    # Last Activity: to be removed
    for i in [7,14,30,60,90,180,365,730]:
        data = SCM.last_activity(i)
        agg = dict(agg.items() + data.items())

    # Fields with wrong data in R
    skip_fields = ['percentage_removed_lines_30','percentage_added_lines_30','diff_netadded_lines_30','diff_netremoved_lines_30']
    createJSON (agg, destdir+"/scm-static.json", True, skip_fields)
Exemple #4
0
def domainsData(period, startdate, enddate, identities_db, destdir):
    domains = SCM.scm_domains_names(identities_db,startdate, enddate)
    domains = domains['name']
    createJSON(domains, destdir+"/scm-domains.json")
    # Some R ts are wrong
    bad_R_json_domains = ['gerrit','gmx','emsenhuber','bitergia']

    for domain in domains :
        domain_name = "'"+domain+"'"
        print (domain_name)

        evol_data = SCM.GetSCMEvolutionaryData(period, startdate, enddate, identities_db, ["domain", domain_name])
        evol_data = completePeriodIds(evol_data)
        if domain in bad_R_json_domains:
            createJSON(evol_data, destdir+"/"+domain+"-scm-dom-evolutionary.json", False)
        else:
            createJSON(evol_data, destdir+"/"+domain+"-scm-dom-evolutionary.json")

        agg = SCM.GetSCMStaticData(period, startdate, enddate, identities_db, ["domain", domain_name])
        createJSON(agg, destdir+ "/"+domain+"-scm-dom-static.json")
Exemple #5
0
def reposData(period, startdate, enddate, identities_db, destdir, conf):
    # repos  = dataFrame2Dict(vizr.repos_name(startdate, enddate))
    repos  = SCM.repos_name(startdate, enddate)
    repos = repos['name']
    if not isinstance(repos, (list)): 
        repos = [repos]
        createJSON(repos, destdir+"/scm-repos.json", False)
    else:
        createJSON(repos, destdir+"/scm-repos.json")

    for repo in repos :
        repo_name = "'"+ repo+ "'"
        print (repo_name)

        evol_data = SCM.GetSCMEvolutionaryData(period, startdate, enddate, identities_db, ["repository", repo_name])
        evol_data = completePeriodIds(evol_data)
        createJSON(evol_data, destdir+"/"+repo+"-scm-rep-evolutionary.json")

        agg = SCM.GetSCMStaticData(period, startdate, enddate, identities_db, ["repository", repo_name])
        createJSON(agg, destdir+"/"+repo+"-scm-rep-static.json")