diff --git a/src/Frontend.php b/src/Frontend.php
index 6fbd8b0..8b668b5 100644
--- a/src/Frontend.php
+++ b/src/Frontend.php
@@ -1,207 +1,207 @@
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
namespace Legoktm\CoverMe;
use Legoktm\CloverDiff\CloverXml;
class Frontend {
const COVER_GOOD = 90;
const COVER_BAD = 50;
/**
* @var CoverLogIndex
*/
private $coverLogIndex;
/**
* @var PerformanceLogIndex
*/
private $perfLogIndex;
public function __construct() {
$this->coverLogIndex = new CoverLogIndex();
$this->perfLogIndex = new PerformanceLogIndex();
}
private function select() {
$selected = isset( $_GET['repo'] ) ? $_GET['repo'] : null;
$list = $this->coverLogIndex->getExtensionList();
$html = <<
HTML;
foreach ( $list as $ext ) {
$isSelected = $selected === "Extension:$ext" ? ' selected' : '';
$html .= " \n";
}
return $html . "\n";
}
private function typeSelect( $selected ) {
$list = $this->perfLogIndex->getTypes();
$html = <<
HTML;
foreach ( $list as $type ) {
$isSelected = $selected === $type ? ' selected' : '';
$html .= " \n";
}
return $html . "\n";
}
private function progressBar( $percent ) {
- if ( $percent > self::COVER_GOOD ) {
+ if ( $percent >= self::COVER_GOOD ) {
$color = 'success';
} elseif ( $percent < self::COVER_BAD ) {
$color = 'danger';
} else {
$color = 'warning';
}
$minWidth = $percent >= 10 ? '3em' : '2em';
return <<
CoverMe helps you find the most impactful areas to increase test coverage.
It sorts functions by how often they are called in Wikimedia production, and
annotates them with how much test coverage each has. You can sort by repository
and entry point (index.php, api.php, etc.).
{$eRepo}: {$eType}
{$body}
Source code
available under the terms of the AGPL v3, or any later version. Loaded in {$this->profileTime()} seconds.