Python: Autoformat everything using qlformat.

Will need subsequent PRs fixing up test failures (due to deprecated
methods moving around), but other than that everything should be
straight-forward.
This commit is contained in:
Taus Brock-Nannestad
2020-07-07 15:43:52 +02:00
parent 993506d781
commit f07a7bf8cf
602 changed files with 26777 additions and 26790 deletions

View File

@@ -13,11 +13,11 @@ import external.VCS
from Module m, int n
where
n =
sum(Commit entry, int churn |
churn = entry.getRecentChurnForFile(m.getFile()) and not artificialChange(entry)
|
churn
) and
exists(m.getMetrics().getNumberOfLinesOfCode())
n =
sum(Commit entry, int churn |
churn = entry.getRecentChurnForFile(m.getFile()) and not artificialChange(entry)
|
churn
) and
exists(m.getMetrics().getNumberOfLinesOfCode())
select m, n order by n desc

View File

@@ -13,11 +13,11 @@ import external.VCS
from Module m, int n
where
n =
sum(Commit entry, int churn |
churn = entry.getRecentAdditionsForFile(m.getFile()) and not artificialChange(entry)
|
churn
) and
exists(m.getMetrics().getNumberOfLinesOfCode())
n =
sum(Commit entry, int churn |
churn = entry.getRecentAdditionsForFile(m.getFile()) and not artificialChange(entry)
|
churn
) and
exists(m.getMetrics().getNumberOfLinesOfCode())
select m, n order by n desc

View File

@@ -13,11 +13,11 @@ import external.VCS
from Module m, int n
where
n =
sum(Commit entry, int churn |
churn = entry.getRecentDeletionsForFile(m.getFile()) and not artificialChange(entry)
|
churn
) and
exists(m.getMetrics().getNumberOfLinesOfCode())
n =
sum(Commit entry, int churn |
churn = entry.getRecentDeletionsForFile(m.getFile()) and not artificialChange(entry)
|
churn
) and
exists(m.getMetrics().getNumberOfLinesOfCode())
select m, n order by n desc

View File

@@ -16,8 +16,8 @@ int committedFiles(Commit commit) { result = count(commit.getAnAffectedFile()) }
from Module m
where exists(m.getMetrics().getNumberOfLinesOfCode())
select m,
avg(Commit commit, int toAvg |
commit.getAnAffectedFile() = m.getFile() and toAvg = committedFiles(commit) - 1
|
toAvg
)
avg(Commit commit, int toAvg |
commit.getAnAffectedFile() = m.getFile() and toAvg = committedFiles(commit) - 1
|
toAvg
)

View File

@@ -12,21 +12,21 @@ import python
import external.VCS
predicate inRange(Commit first, Commit second) {
first.getAnAffectedFile() = second.getAnAffectedFile() and
first != second and
exists(int n |
n = first.getDate().daysTo(second.getDate()) and
n >= 0 and
n < 5
)
first.getAnAffectedFile() = second.getAnAffectedFile() and
first != second and
exists(int n |
n = first.getDate().daysTo(second.getDate()) and
n >= 0 and
n < 5
)
}
int recommitsForFile(File f) {
result =
count(Commit recommit |
f = recommit.getAnAffectedFile() and
exists(Commit prev | inRange(prev, recommit))
)
result =
count(Commit recommit |
f = recommit.getAnAffectedFile() and
exists(Commit prev | inRange(prev, recommit))
)
}
from Module m

View File

@@ -14,11 +14,11 @@ import external.VCS
from Module m
where exists(m.getMetrics().getNumberOfLinesOfCode())
select m,
count(Author author |
exists(Commit e |
e = author.getACommit() and
m.getFile() = e.getAnAffectedFile() and
e.daysToNow() <= 180 and
not artificialChange(e)
)
count(Author author |
exists(Commit e |
e = author.getACommit() and
m.getFile() = e.getAnAffectedFile() and
e.daysToNow() <= 180 and
not artificialChange(e)
)
)

View File

@@ -13,8 +13,8 @@ import external.VCS
from Module m
where
exists(Commit e |
e.getAnAffectedFile() = m.getFile() and e.daysToNow() <= 180 and not artificialChange(e)
) and
exists(m.getMetrics().getNumberOfLinesOfCode())
exists(Commit e |
e.getAnAffectedFile() = m.getFile() and e.daysToNow() <= 180 and not artificialChange(e)
) and
exists(m.getMetrics().getNumberOfLinesOfCode())
select m, 1