Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/view/PHUIDiffTableOfContentsItemView.php
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | public function renderChangesetLines() { | ||||
return pht('%d line(s)', $line_count); | return pht('%d line(s)', $line_count); | ||||
} | } | ||||
public function renderCoverage() { | public function renderCoverage() { | ||||
$not_applicable = '-'; | $not_applicable = '-'; | ||||
$coverage = $this->getCoverage(); | $coverage = $this->getCoverage(); | ||||
if (!strlen($coverage)) { | if (!phutil_nonempty_string($coverage)) { | ||||
return $not_applicable; | return $not_applicable; | ||||
} | } | ||||
$covered = substr_count($coverage, 'C'); | $covered = substr_count($coverage, 'C'); | ||||
$not_covered = substr_count($coverage, 'U'); | $not_covered = substr_count($coverage, 'U'); | ||||
if (!$not_covered && !$covered) { | if (!$not_covered && !$covered) { | ||||
return $not_applicable; | return $not_applicable; | ||||
} | } | ||||
return sprintf('%d%%', 100 * ($covered / ($covered + $not_covered))); | return sprintf('%d%%', 100 * ($covered / ($covered + $not_covered))); | ||||
} | } | ||||
public function renderModifiedCoverage() { | public function renderModifiedCoverage() { | ||||
$not_applicable = '-'; | $not_applicable = '-'; | ||||
$coverage = $this->getCoverage(); | $coverage = $this->getCoverage(); | ||||
if (!strlen($coverage)) { | if (!phutil_nonempty_string($coverage)) { | ||||
return $not_applicable; | return $not_applicable; | ||||
} | } | ||||
if ($this->getIsVisible()) { | if ($this->getIsVisible()) { | ||||
$label = pht('Loading...'); | $label = pht('Loading...'); | ||||
} else { | } else { | ||||
$label = pht('?'); | $label = pht('?'); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0