https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292020-03-12T09:37:09ZRedmineRedmine - Feature #32856: Bar charts in the spent time reporthttps://www.redmine.org/issues/32856?journal_id=967442020-03-12T09:37:09ZGo MAEDA
<ul><li><strong>Category</strong> changed from <i>UI</i> to <i>Time tracking</i></li><li><strong>Target version</strong> set to <i>Candidate for next major release</i></li></ul> Redmine - Feature #32856: Bar charts in the spent time reporthttps://www.redmine.org/issues/32856?journal_id=1039052021-08-24T01:27:03ZMischa The Evil
<ul></ul><p>I think this could be a good improvement. Even more so now that we also have (similar) charts on the issues summary views introduced with <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Stacked bar charts in the issue details report (Closed)" href="https://www.redmine.org/issues/31418">#31418</a>.<br />Though, OTOH, I think that we should be cautious not to add too much charts to the core and not to add charts that aren't very useful for a large part of the community.<br />So, for example, I'd vote +1 for core integration of Chart.js ports of (some of) the charts historically provided by the <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/PluginGraphs">Graphs plugin</a> by Brad Beattie (<a href="https://github.com/bradbeattie/redmine-graphs-plugin" class="external">GitHub repository</a>), but I'd vote -1 on such a proposal for specific charts supporting Agile/Scrum/etc. methodologies.</p>
<p>Besides the above mentioned considerations there is an additional potential issue that I've already reported as <a class="issue tracker-1 status-1 priority-4 priority-default" title="Defect: Graphs in the Issues Report details are too large. (New)" href="https://www.redmine.org/issues/35670">#35670</a> and more crudely as <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Prints of Issues Report details are messed-up due to the size of the graphs (Closed)" href="https://www.redmine.org/issues/35669">#35669</a> for the charts added per <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Stacked bar charts in the issue details report (Closed)" href="https://www.redmine.org/issues/31418">#31418</a>. I think that if it's decided to integrate these changes, the mentioned issues should be handled first.</p> Redmine - Feature #32856: Bar charts in the spent time reporthttps://www.redmine.org/issues/32856?journal_id=1039262021-08-25T02:46:36ZMischa The Evil
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs feedback</i></li></ul><p>On a second thought I start to doubt if the addition of these charts to the core is a good idea after all. To be precise, I start doubting whether the core should provide <strong>any</strong> charts at all<sup><a href="#fn1">1</a></sup>.</p>
<p>The main reason for my doubt lies in the maintainability of all the code involved. To provide some crude numbers (using a patched <code>stats</code> rake task<sup><a href="#fn2">2</a></sup>) for a (slightly patched) Redmine 4.1.x instance:<br /><pre>
+----------------------+--------+--------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+--------+--------+---------+---------+-----+-------+
| Controllers | 7816 | 5774 | 53 | 476 | 8 | 10 |
| Helpers | 6060 | 4352 | 1 | 366 | 366 | 9 |
| Models | 17891 | 12748 | 95 | 1409 | 14 | 7 |
| JavaScripts | 5886 | 3167 | 0 | 204 | 0 | 13 |
| Libraries | 19128 | 13813 | 151 | 1159 | 7 | 9 |
| Controller tests | 29105 | 23819 | 65 | 1889 | 29 | 10 |
| Helper tests | 3467 | 2607 | 20 | 252 | 12 | 8 |
| Model tests | 31923 | 24395 | 146 | 2623 | 17 | 7 |
| Integration tests | 8905 | 6039 | 98 | 516 | 5 | 9 |
| System tests | 781 | 537 | 6 | 33 | 5 | 14 |
| Extras tests | 517 | 384 | 3 | 54 | 18 | 5 |
+----------------------+--------+--------+---------+---------+-----+-------+
| Total | 131479 | 97635 | 638 | 8981 | 14 | 8 |
+----------------------+--------+--------+---------+---------+-----+-------+
Code LOC: 39854 Test LOC: 57781 Code to Test Ratio: 1:1.4
</pre></p>
<p>Now, compare those numbers with e.g. the same numbers for Basecamp 3 (from ~2016):</p>
<table>
<tr>
<td> <img src="https://pbs.twimg.com/media/Cbl5WS0UsAAptd9?format=png&name=small" style="width:500px;" alt="" /> </td>
</tr>
<tr>
<td> -- Source: DHH on <a href="https://twitter.com/dhh/status/700724641812377602" class="external">Twitter</a> </td>
</tr>
</table>
<p>If you combine all this data and look at the respective size of the supporting development teams and the respective financial and economic capacity, you'll get an idea of what I'm talking about.</p>
<p>It might, as such, be a better choice to defer all charts/graphs to a single, dedicated plugin which could then include the repository graphs from the current core, the charts introduced in the core by <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Stacked bar charts in the issue details report (Closed)" href="https://www.redmine.org/issues/31418">#31418</a>, the charts proposed in this issue and any additional graphs I referred to in my previous post.</p>
<p>I'm interested in hearing about what other people think about this...</p>
<p id="fn1" class="footnote"><sup>1</sup> that includes the long-time present repository graphs. It might be better to remove those completely and only provide a raw textual representation of this data.</p>
<p id="fn2" class="footnote"><sup>2</sup> <a href="#" onclick="$('#collapse-76a721d3-show, #collapse-76a721d3-hide').toggle(); $('#collapse-76a721d3').fadeToggle(150);; return false;" id="collapse-76a721d3-show" class="icon icon-collapsed collapsible">diff of the patch.</a><a href="#" onclick="$('#collapse-76a721d3-show, #collapse-76a721d3-hide').toggle(); $('#collapse-76a721d3').fadeToggle(150);; return false;" id="collapse-76a721d3-hide" class="icon icon-expended collapsible" style="display:none;">diff of the patch.</a><div id="collapse-76a721d3" class="collapsed-text" style="display:none;"><pre><code class="diff syntaxhl"><span class="gh">diff --git "a/lib/tasks/redmine.rake" "b/lib/tasks/redmine.rake"
index db574df16..f036ac1f8 100644
</span><span class="gd">--- "a/lib/tasks/redmine.rake"
</span><span class="gi">+++ "b/lib/tasks/redmine.rake"
</span><span class="p">@@ -15,6 +15,9 @@</span>
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# Custom :stats task
<span class="gi">+task :stats => "redmine:custom_stats"
+
</span> namespace :redmine do
namespace :attachments do
desc 'Removes uploaded files left unattached after one day.'
<span class="p">@@ -196,6 +199,30 @@</span> DESC
end
end
end
<span class="gi">+
+ task :custom_stats do
+ require 'rails/code_statistics'
+
+ ::STATS_DIRECTORIES.clear
+
+ ::STATS_DIRECTORIES << %w(Controllers app/controllers)
+ ::STATS_DIRECTORIES << %w(Helpers app/helpers)
+ ::STATS_DIRECTORIES << %w(Models app/models)
+ # TODO: Enable once on Rails 6.1
+ #::STATS_DIRECTORIES << %w(Views app/views)
+ ::STATS_DIRECTORIES << %w(JavaScripts public/javascripts)
+ # TODO: Enable once on Rails 6.1
+ #::STATS_DIRECTORIES << %w(Stylesheets public/stylesheets)
+ ::STATS_DIRECTORIES << %w(Libraries lib/)
+ ::STATS_DIRECTORIES << %w(Controller\ tests test/functional)
+ ::STATS_DIRECTORIES << %w(Helper\ tests test/helpers)
+ ::STATS_DIRECTORIES << %w(Model\ tests test/unit)
+ ::STATS_DIRECTORIES << %w(Integration\ tests test/integration)
+ ::STATS_DIRECTORIES << %w(System\ tests test/system)
+ ::STATS_DIRECTORIES << %w(Extras\ tests test/extra)
+
+ CodeStatistics::TEST_TYPES << "Extras tests"
+ end
</span> end
# Load plugins' rake tasks
</code></pre></div></p>