Skip to content

Commit

Permalink
refs #57 make sure always a change of at least 2 visits is required. …
Browse files Browse the repository at this point in the history
…Added icon license information, will move the information later
  • Loading branch information
tsteur committed Mar 7, 2014
1 parent 1ce543a commit fc6fe7f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/Insights/InsightReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function generateMoverAndShaker($reportMetadata, $period, $date, $lastDat
$minNewPercent = 5;
}

if ($totalValue < 100) {
if ($totalValue < 200) {
// force at least a change of 2 visits
$minMoversPercent = (int) ceil(2 / ($totalValue / 100));
$minNewPercent = max($minNewPercent, $minMoversPercent);
Expand Down
5 changes: 5 additions & 0 deletions plugins/Insights/images/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
idea.png
========
Link: https://www.iconfinder.com/icons/6074/brainstorm_bulb_idea_jabber_light_icon
License: GPL
By: Alessandro Rei - http://www.kde-look.org/usermanager/search.php?username=mentalrey
8 changes: 8 additions & 0 deletions plugins/Insights/templates/table_row.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
</span>
</td>

{% if row.getColumn('isMover') %}
{% set typeOfChange = 'Moved'; %}
{% elseif row.getColumn('isNew') %}
{% set typeOfChange = 'New'; %}
{% elseif row.getColumn('isDisappeared') %}
{% set typeOfChange = 'Disappeared'; %}
{% endif %}

{% if row.getColumn('grown') %}
<td>+{{ row.getColumn('difference') }}</td>
<td class="grown">+{{ row.getColumn('growth_percent') }}</td>
Expand Down
4 changes: 2 additions & 2 deletions plugins/Insights/tests/InsightReportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public function test_generateMoversAndShakers_ParameterCalculation()
$this->assertEquals(10, $metadata['minNewPercent']);
$this->assertEquals(8, $metadata['minDisappearedPercent']);

$report = $this->generateMoverAndShaker(150, 50);
$report = $this->generateMoverAndShaker(300, 100);
$metadata = $report->getAllTableMetadata();

$this->assertEquals(240, $metadata['minGrowthPercentPositive']);
Expand All @@ -383,7 +383,7 @@ public function test_generateMoversAndShakers_ParameterCalculation()
$this->assertEquals(7, $metadata['minDisappearedPercent']);


$report = $this->generateMoverAndShaker(150, 300);
$report = $this->generateMoverAndShaker(300, 600);
$metadata = $report->getAllTableMetadata();

$this->assertEquals(70, $metadata['minGrowthPercentPositive']);
Expand Down

0 comments on commit fc6fe7f

Please sign in to comment.