-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrq1Figure1.sql
More file actions
59 lines (56 loc) · 1.8 KB
/
rq1Figure1.sql
File metadata and controls
59 lines (56 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
-- June
select cat, sum(t) from
(
select n, total(x)/72519 t from (
select i.name n, total(count)/(SELECT sum(loc) FROM loc WHERE sfid=sf_id)*1000 x from
snapshot s inner join issue3 i on (i.event_id=s.event_id AND sf_id=source_file_id )
where s.event_id in (select id from event where strftime('%m', time/1000, 'unixepoch')="06")
and i.name <> "LawOfDemeter"
group by sf_id, i.name
)
group by n
)
inner join category on issue=n
group by cat;
-- March
select cat, sum(t) from
(
select n, total(x)/129487 t from (
select i.name n, total(count)/(SELECT sum(loc) FROM loc WHERE sfid=sf_id)*1000 x from
snapshot s inner join issue3 i on (i.event_id=s.event_id AND sf_id=source_file_id )
where s.event_id in (select id from event where strftime('%m', time/1000, 'unixepoch')="03")
and i.name <> "LawOfDemeter"
group by sf_id, i.name
)
group by n
)
inner join category on issue=n
group by cat;
-- September
select cat, sum(t) from
(
select n, total(x)/109273 t from (
select i.name n, total(count)/(SELECT sum(loc) FROM loc WHERE sfid=sf_id)*1000 x from
snapshot s inner join issue3 i on (i.event_id=s.event_id AND sf_id=source_file_id )
where s.event_id in (select id from event where strftime('%m', time/1000, 'unixepoch')="09")
and i.name <> "LawOfDemeter"
group by sf_id, i.name
)
group by n
)
inner join category on issue=n
group by cat;
-- December
select cat, sum(t) from
(
select n, total(x)/142681 t from (
select i.name n, total(count)/(SELECT sum(loc) FROM loc WHERE sfid=sf_id)*1000 x from
snapshot s inner join issue3 i on (i.event_id=s.event_id AND sf_id=source_file_id )
where s.event_id in (select id from event where strftime('%m', time/1000, 'unixepoch')="12")
and i.name <> "LawOfDemeter"
group by sf_id, i.name
)
group by n
)
inner join category on issue=n
group by cat;