def GetListPeopleIRC(startdate, enddate): fields = "DISTINCT(pup.uuid) as id, count(irclog.id) total" tables = GetTablesOwnUniqueIdsIRC() filters = GetFiltersOwnUniqueIdsIRC() filters += " AND irclog.type='COMMENT' " filters += " GROUP BY nick ORDER BY total desc" q = GetSQLGlobal('date', fields, tables, filters, startdate, enddate) return (ExecuteQuery(q))
def GetListPeopleMediaWiki (startdate, enddate) : fields = "DISTINCT(pup.uuid) as id, count(wiki_pages_revs.id) total" tables = GetTablesOwnUniqueIdsMediaWiki() filters = GetFiltersOwnUniqueIdsMediaWiki() filters += " GROUP BY user ORDER BY total desc" q = GetSQLGlobal('date',fields,tables, filters, startdate, enddate) data = ExecuteQuery(q) return (data)
def GetListPeopleMLS(startdate, enddate): fields = "DISTINCT(pup.uuid) as id, count(m.message_ID) total" tables = GetTablesOwnUniqueIdsMLS() filters = GetFiltersOwnUniqueIdsMLS() filters += " GROUP BY id ORDER BY total desc" q = GetSQLGlobal('first_date', fields, tables, filters, startdate, enddate) data = ExecuteQuery(q) return (data)
def GetPeopleListITS(startdate, enddate): fields = "DISTINCT(pup.uuid) as pid, count(c.id) as total" tables = GetTablesOwnUniqueIdsITS() filters = GetFiltersOwnUniqueIdsITS() filters += " GROUP BY pid ORDER BY total desc" q = GetSQLGlobal('changed_on', fields, tables, filters, startdate, enddate) data = ExecuteQuery(q) return (data)
def GetPeopleListSCM(startdate, enddate): fields = "DISTINCT(pup.uuid) as pid, COUNT(distinct(s.id)) as total" tables = GetTablesOwnUniqueIdsSCM() filters = GetFiltersOwnUniqueIdsSCM() filters += " GROUP BY pid ORDER BY total desc, pid" q = GetSQLGlobal('s.author_date', fields, tables, filters, startdate, enddate) data = ExecuteQuery(q) return (data)
def GetPeopleListSCR (startdate, enddate, bots): filter_bots = "" for bot in bots: filter_bots += " name<>'"+bot+"' and " fields = "DISTINCT(pup.uuid) as id, count(i.id) as total, name" tables = GetTablesOwnUniqueIdsSCR('issues') + ", people" filters = filter_bots filters += GetFiltersOwnUniqueIdsSCR('issues')+ " and people.id = pup.people_id" filters += " GROUP BY id ORDER BY total desc" q = GetSQLGlobal('submitted_on', fields, tables, filters, startdate, enddate) return(ExecuteQuery(q))
def GetQueryPeopleMediaWiki (developer_id, period, startdate, enddate, evol) : fields = "COUNT(wiki_pages_revs.id) AS revisions" tables = GetTablesOwnUniqueIdsMediaWiki() filters = GetFiltersOwnUniqueIdsMediaWiki() + " AND pup.uuid = '" + str(developer_id) + "'" if (evol) : q = GetSQLPeriod(period,'date', fields, tables, filters, startdate, enddate) else : fields += ",DATE_FORMAT (min(date),'%Y-%m-%d') as first_date, "+\ "DATE_FORMAT (max(date),'%Y-%m-%d') as last_date" q = GetSQLGlobal('date', fields, tables, filters, startdate, enddate) return (q)
def GetPeopleQuerySCRSubmissions (developer_id, period, startdate, enddate, evol): fields = "COUNT(i.id) AS submissions" tables = GetTablesOwnUniqueIdsSCR('issues') filters = GetFiltersOwnUniqueIdsSCR('issues')+ " AND pup.uuid = '"+ str(developer_id) +"'" if (evol): q = GetSQLPeriod(period,'submitted_on', fields, tables, filters, startdate, enddate) else: fields = fields + \ ",DATE_FORMAT (min(submitted_on),'%Y-%m-%d') as first_date, "+\ " DATE_FORMAT (max(submitted_on),'%Y-%m-%d') as last_date" q = GetSQLGlobal('submitted_on', fields, tables, filters, startdate, enddate) return (q)
def GetPeopleQuerySCRChanges (developer_id, period, startdate, enddate, evol): fields = "COUNT(c.id) AS changes" tables = GetTablesOwnUniqueIdsSCR() filters = GetFiltersOwnUniqueIdsSCR()+ " AND pup.uuid = '"+ str(developer_id) + "'" if (evol): q = GetSQLPeriod(period,'changed_on', fields, tables, filters, startdate, enddate) else: fields = fields + \ ",DATE_FORMAT (min(changed_on),'%Y-%m-%d') as first_date, "+\ " DATE_FORMAT (max(changed_on),'%Y-%m-%d') as last_date" q = GetSQLGlobal('changed_on', fields, tables, filters, startdate, enddate) return (q)
def GetPeopleQuerySCM(developer_id, period, startdate, enddate, evol): fields = 'COUNT(distinct(s.id)) AS commits' tables = GetTablesOwnUniqueIdsSCM() filters = GetFiltersOwnUniqueIdsSCM() filters += " AND pup.uuid='" + str(developer_id) + "'" if (evol): q = GetSQLPeriod(period, 's.author_date', fields, tables, filters, startdate, enddate) else: fields += ",DATE_FORMAT (min(s.author_date),'%Y-%m-%d') as first_date, "+\ "DATE_FORMAT (max(s.author_date),'%Y-%m-%d') as last_date" q = GetSQLGlobal('s.author_date', fields, tables, filters, startdate, enddate) return (q)
def GetQueryPeopleIRC(developer_id, period, startdate, enddate, evol): fields = "COUNT(irclog.id) AS sent" tables = GetTablesOwnUniqueIdsIRC() filters = GetFiltersOwnUniqueIdsIRC() + " AND pup.uuid = '" + str( developer_id) + "'" filters += " AND irclog.type='COMMENT'" if (evol): q = GetSQLPeriod(period, 'date', fields, tables, filters, startdate, enddate) else: fields = fields + \ ",DATE_FORMAT (min(date),'%Y-%m-%d') as first_date,"+\ " DATE_FORMAT (max(date),'%Y-%m-%d') as last_date" q = GetSQLGlobal('date', fields, tables, filters, startdate, enddate) return (q)
def GetQueryPeopleMLS(developer_id, period, startdate, enddate, evol): fields = "COUNT(m.message_ID) AS sent" tables = GetTablesOwnUniqueIdsMLS() filters = GetFiltersOwnUniqueIdsMLS() + "AND pup.uuid = '" + str( developer_id) + "'" if (evol): q = GetSQLPeriod(period, 'first_date', fields, tables, filters, startdate, enddate) else: fields = fields +\ ",DATE_FORMAT (min(first_date),'%Y-%m-%d') as first_date, "+\ "DATE_FORMAT (max(first_date),'%Y-%m-%d') as last_date" q = GetSQLGlobal('first_date', fields, tables, filters, startdate, enddate) return (q)
def GetPeopleQueryITS (developer_id, period, startdate, enddate, evol, closed_condition) : fields = " COUNT(distinct(c.issue_id)) AS closed" tables = GetTablesOwnUniqueIdsITS() filters = GetFiltersOwnUniqueIdsITS() + " AND pup.uuid = '"+ str(developer_id)+"'" filters += " AND "+ closed_condition if (evol) : q = GetSQLPeriod(period,'changed_on', fields, tables, filters, startdate, enddate) else : fields += ",DATE_FORMAT (min(changed_on),'%Y-%m-%d') as first_date, "+\ "DATE_FORMAT (max(changed_on),'%Y-%m-%d') as last_date" q = GetSQLGlobal('changed_on', fields, tables, filters, startdate, enddate) return (q)
def GetPeopleQuerySCR (developer_id, period, startdate, enddate, evol): fields = "COUNT(c.id) AS closed" tables = GetTablesOwnUniqueIdsSCR() filters = GetFiltersOwnUniqueIdsSCR()+ " AND pup.uuid = '"+ str(developer_id) + "'" # Just closed, not all changes filters += "AND (new_value='MERGED' OR new_value='ABANDONED')" if (evol): q = GetSQLPeriod(period,'changed_on', fields, tables, filters, startdate, enddate) else: fields = fields + \ ",DATE_FORMAT (min(changed_on),'%Y-%m-%d') as first_date, "+\ " DATE_FORMAT (max(changed_on),'%Y-%m-%d') as last_date" q = GetSQLGlobal('changed_on', fields, tables, filters, startdate, enddate) return (q)
def get_people_query(developer_id, startdate, enddate, evol=False, period=None): query_builder = Pullpo.get_query_builder() fields = 'COUNT(distinct(pr.id)) AS submissions' tables = 'pull_requests pr, people_uidentities pup' filters = 'pr.user_id = pup.people_id' filters += " AND pup.uuid='" + str(developer_id) + "'" if (evol): q = GetSQLPeriod(period, 'pr.created_at', fields, tables, filters, startdate, enddate) else: fields += ",DATE_FORMAT (min(pr.created_at),'%Y-%m-%d') as first_date, "+\ "DATE_FORMAT (max(pr.created_at),'%Y-%m-%d') as last_date" q = GetSQLGlobal('pr.created_at', fields, tables, filters, startdate, enddate) data = ExecuteQuery(q) return (data)
def get_date_end(startdate, enddate, identities_db, type_analysis): fields = "DATE_FORMAT(MAX(date),'%Y-%m-%d') AS last_date" tables = "wiki_pages_revs" filters = "" q = GetSQLGlobal('date',fields, tables, filters, startdate, enddate) return ExecuteQuery(q)