diff --git a/config/locales/en.yml b/config/locales/en.yml index 4c918964a7..f32c61870e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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 diff --git a/lib/git_stats/git_data/repo.rb b/lib/git_stats/git_data/repo.rb index efece77a8b..5fd2440f34 100644 --- a/lib/git_stats/git_data/repo.rb +++ b/lib/git_stats/git_data/repo.rb @@ -39,10 +39,6 @@ def tree @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 @@ def comments_count_by_date }].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 @@ def project_name 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) diff --git a/lib/git_stats/stats_view/charts/charts.rb b/lib/git_stats/stats_view/charts/charts.rb index f12fdcb55c..5b94c03374 100644 --- a/lib/git_stats/stats_view/charts/charts.rb +++ b/lib/git_stats/stats_view/charts/charts.rb @@ -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 diff --git a/lib/git_stats/stats_view/charts/repo_charts.rb b/lib/git_stats/stats_view/charts/repo_charts.rb index 7413211d2d..3b61722594 100644 --- a/lib/git_stats/stats_view/charts/repo_charts.rb +++ b/lib/git_stats/stats_view/charts/repo_charts.rb @@ -27,26 +27,6 @@ def lines_by_extension 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( diff --git a/templates/files/_files.haml b/templates/files/_files.haml index 67ad0f36ea..fd234f55ef 100644 --- a/templates/files/_files.haml +++ b/templates/files/_files.haml @@ -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) diff --git a/templates/files/by_extension_by_date.haml b/templates/files/by_extension_by_date.haml deleted file mode 100644 index d31c9220e9..0000000000 --- a/templates/files/by_extension_by_date.haml +++ /dev/null @@ -1 +0,0 @@ -= render_partial('files/_files', page: :files_by_extension_by_date) diff --git a/templates/lines/_lines.haml b/templates/lines/_lines.haml index fea1fc0a09..81292e1056 100644 --- a/templates/lines/_lines.haml +++ b/templates/lines/_lines.haml @@ -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) diff --git a/templates/lines/by_extension_by_date.haml b/templates/lines/by_extension_by_date.haml deleted file mode 100644 index 7969e4cb38..0000000000 --- a/templates/lines/by_extension_by_date.haml +++ /dev/null @@ -1 +0,0 @@ -= render_partial('lines/_lines', page: :lines_by_extension_by_date)