mirror of
https://github.com/tomgi/git_stats.git
synced 2024-12-22 05:22:16 +01:00
Revert "Add files/lines by extension by date"
This reverts commit 9005f4d0d0
.
This commit is contained in:
parent
dd71d58f97
commit
227d33ccd1
8 changed files with 4 additions and 83 deletions
|
@ -61,5 +61,3 @@ en:
|
|||
insertions_by_date: Lines added by date
|
||||
deletions_by_date: Lines deleted by date
|
||||
changed_lines_by_date: Changed lines by date
|
||||
lines_by_extension_by_date: Lines per extension by date
|
||||
files_by_extension_by_date: Files per extension by date
|
||||
|
|
|
@ -39,10 +39,6 @@ module GitStats
|
|||
@tree ||= Tree.new(repo: self, relative_path: @tree_path)
|
||||
end
|
||||
|
||||
def command_memoization
|
||||
@command_memoization_map ||= {}
|
||||
end
|
||||
|
||||
def authors
|
||||
@authors ||= run_and_parse("git shortlog -se #{commit_range} #{tree_path}").map do |author|
|
||||
Author.new(repo: self, name: author[:name], email: author[:email])
|
||||
|
@ -99,44 +95,6 @@ module GitStats
|
|||
}].fill_empty_days!(aggregated: true)
|
||||
end
|
||||
|
||||
def files_by_extension_by_date
|
||||
file_counts_by_date_by_extension = {}
|
||||
extensions_sums = {}
|
||||
commits.map do |commit|
|
||||
commit.files_by_extension_count.map do |ext, count|
|
||||
extensions_sums[ext] ||= 0;
|
||||
extensions_sums[ext] = count;
|
||||
file_counts_by_date_by_extension[ext] ||= {};
|
||||
file_counts_by_date_by_extension[ext][commit.date.to_date] = extensions_sums[ext]
|
||||
end
|
||||
end
|
||||
@multi_data_file_counts_by_date ||= file_counts_by_date_by_extension.map { |ext, data|
|
||||
{
|
||||
name: ext || "NO EXTENSION",
|
||||
data: data.fill_empty_days!(aggregated:true)
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
def lines_by_extension_by_date
|
||||
lines_by_date_by_extension = {}
|
||||
extensions_sums = {}
|
||||
commits.map do |commit|
|
||||
commit.lines_by_extension.map do |ext, count|
|
||||
extensions_sums[ext] ||= 0;
|
||||
extensions_sums[ext] = count;
|
||||
lines_by_date_by_extension[ext] ||= {};
|
||||
lines_by_date_by_extension[ext][commit.date.to_date] = extensions_sums[ext]
|
||||
end
|
||||
end
|
||||
@multi_data_lines_by_date ||= lines_by_date_by_extension.map { |ext, data|
|
||||
{
|
||||
name: ext || "NO EXTENSION",
|
||||
data: data.fill_empty_days!(aggregated:true)
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
def last_commit
|
||||
commits.last
|
||||
end
|
||||
|
@ -166,14 +124,9 @@ module GitStats
|
|||
end
|
||||
|
||||
def run(command)
|
||||
if (command_memoization[command])
|
||||
command_memoization[command]
|
||||
else
|
||||
result = command_runner.run(path, command)
|
||||
invoke_command_observers(command, result)
|
||||
command_memoization[command] = result
|
||||
result
|
||||
end
|
||||
result = command_runner.run(path, command)
|
||||
invoke_command_observers(command, result)
|
||||
result
|
||||
end
|
||||
|
||||
def run_and_parse(command)
|
||||
|
|
|
@ -3,7 +3,7 @@ module GitStats
|
|||
module StatsView
|
||||
module Charts
|
||||
class All
|
||||
delegate :files_by_extension, :files_by_extension_by_date, :lines_by_extension, :lines_by_extension_by_date, :files_by_date, :lines_by_date, :comments_by_date, to: :repo_charts
|
||||
delegate :files_by_extension, :lines_by_extension, :files_by_date, :lines_by_date, :comments_by_date, to: :repo_charts
|
||||
|
||||
delegate :commits_sum_by_author_by_date, :changed_lines_by_author_by_date,
|
||||
:insertions_by_author_by_date, :deletions_by_author_by_date, to: :authors_charts
|
||||
|
|
|
@ -27,26 +27,6 @@ module GitStats
|
|||
end
|
||||
end
|
||||
|
||||
def files_by_extension_by_date
|
||||
Chart.new do |f|
|
||||
f.multi_date_chart(
|
||||
data: @repo.files_by_extension_by_date,
|
||||
title: :files_by_extension_by_date.t,
|
||||
y_text: :files.t
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def lines_by_extension_by_date
|
||||
Chart.new do |f|
|
||||
f.multi_date_chart(
|
||||
data: @repo.lines_by_extension_by_date,
|
||||
title: :lines_by_extension_by_date.t,
|
||||
y_text: :files.t
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def files_by_date
|
||||
Chart.new do |f|
|
||||
f.date_chart(
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
%a{:href => 'by_date.html'}= :files_by_date.t
|
||||
%li{class: page == :files_by_extension ? "active" : ""}
|
||||
%a{:href => 'by_extension.html'}= :files_by_extension.t
|
||||
%li{class: page == :files_by_extension_by_date ? "active" : ""}
|
||||
%a{:href => 'by_extension_by_date.html'}= :files_by_extension_by_date.t
|
||||
|
||||
.tab-content
|
||||
.tab-pane.active
|
||||
|
@ -15,5 +13,3 @@
|
|||
= high_stock("files_by_date", charts.files_by_date)
|
||||
- elsif page == :files_by_extension
|
||||
= high_chart("files_by_extension", charts.files_by_extension)
|
||||
- elsif page == :files_by_extension_by_date
|
||||
= high_stock("files_by_extension_by_date", charts.files_by_extension_by_date)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
= render_partial('files/_files', page: :files_by_extension_by_date)
|
|
@ -4,8 +4,6 @@
|
|||
%a{:href => 'by_date.html'}= :lines_by_date.t
|
||||
%li{class: page == :lines_by_extension ? "active" : ""}
|
||||
%a{:href => 'by_extension.html'}= :lines_by_extension.t
|
||||
%li{class: page == :lines_by_extension_by_date ? "active" : ""}
|
||||
%a{:href => 'by_extension_by_date.html'}= :lines_by_extension_by_date.t
|
||||
|
||||
.tab-content
|
||||
.tab-pane.active
|
||||
|
@ -15,5 +13,3 @@
|
|||
= high_stock("lines_by_date", charts.lines_by_date)
|
||||
- elsif page == :lines_by_extension
|
||||
= high_chart("lines_by_extension", charts.lines_by_extension)
|
||||
- elsif page == :lines_by_extension_by_date
|
||||
= high_stock("lines_by_extension_by_date", charts.lines_by_extension_by_date)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
= render_partial('lines/_lines', page: :lines_by_extension_by_date)
|
Loading…
Reference in a new issue