github_repo_statistics 2.2.29 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2992ae14c4b2bab0ffc8cdee2c5c2e33a0b7dcc08f2fdb62b194975e944dd625
|
4
|
+
data.tar.gz: 43837ce970edb37d1f52fc88a97a4799d7cf72d33057788d06e71bee9e90e4e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1566d02371061b2a29bd5177438c5fc399c0e554144f110940b686b865c6f7959ca7f7bd54db700ae4745725d430457ec7508c8eb5be0ebf3cbd682c5efca3d
|
7
|
+
data.tar.gz: f13509d5a8de4daa42c02a5194b3814a75d2110b15ab63b0cfb503ac6d2a76aa75d9d1a496b613b723e6f3596ea0d113ba59577f738ae501a1b2d762161a03dd
|
@@ -181,6 +181,10 @@ class GithubRepoStatistics
|
|
181
181
|
`git log origin/master --pretty=format:"%s" --since="#{start_date}" --until="#{end_date}" -- "#{file}"`
|
182
182
|
end
|
183
183
|
|
184
|
+
def new_changes?(file:)
|
185
|
+
git_commit_info(file:, start_date: DateTime.now - 1, end_date: DateTime.now) == "" ? false : true
|
186
|
+
end
|
187
|
+
|
184
188
|
def analyze_changed_files(uniq_code_files_with_changes:, start_date:, end_date:)
|
185
189
|
all_teams = []
|
186
190
|
cross_teams_count = 0
|
@@ -330,15 +334,16 @@ class GithubRepoStatistics
|
|
330
334
|
commits = line.last.last
|
331
335
|
owner = find_owner(file:)
|
332
336
|
prs = line.last[1]
|
337
|
+
new_change = new_changes?(file:)
|
333
338
|
|
334
|
-
hotspot_output << [file.gsub(@directory_path, ''), contributors, lines_of_code, commits, owner, prs]
|
339
|
+
hotspot_output << [file.gsub(@directory_path, ''), new_change, contributors, lines_of_code, commits, owner, prs]
|
335
340
|
end
|
336
341
|
|
337
|
-
hotspot_output.sort_by! { |row| -row[
|
342
|
+
hotspot_output.sort_by! { |row| -row[3] }
|
338
343
|
|
339
344
|
if FILE_OUTPUT
|
340
345
|
CSV.open('hotspot.csv', 'w') do |csv|
|
341
|
-
csv << ['File', 'Contributors', 'Lines', 'Commits', 'Owner', 'PRs']
|
346
|
+
csv << ['File', 'New change', 'Contributors', 'Lines', 'Commits', 'Owner', 'PRs']
|
342
347
|
hotspot_output.each do |row|
|
343
348
|
csv << row
|
344
349
|
end
|
@@ -346,7 +351,7 @@ class GithubRepoStatistics
|
|
346
351
|
else
|
347
352
|
puts "\n *Hotspot files(#{filtered_top_touched_files.count}):*\n"
|
348
353
|
hotspot_output.each do |row|
|
349
|
-
puts " #{row[0]} Contributors: #{row[1]}
|
354
|
+
puts " #{row[0]} Contributors: #{row[1]} New change: #{row[2]} Lines: #{row[3]} Commits: #{row[4]} Owner: #{row[5]} PRs: #{row[6]}"
|
350
355
|
end
|
351
356
|
end
|
352
357
|
end
|