* Add test case and remove unused function.

This commit is contained in:
caoyanyi
2023-01-29 13:58:40 +08:00
parent 7fbd6d958a
commit 152ec6b49c
6 changed files with 156 additions and 44 deletions
-38
View File
@@ -3763,44 +3763,6 @@ class executionModel extends model
return $data;
}
/**
* Get CFD statistics.
*
* @param int $executionID
* @param array $dateList
* @param string $type
* @access public
* @return void
*/
public function getCFDStatistics($executionID, $dateList, $type)
{
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $type);
$kanbanData = array_shift($kanbanData);
$cycleTime = array();
foreach($kanbanData->groups as $group)
{
foreach($group->lanes as $lane)
{
if(!isset($lane->items['closed'])) continue;
foreach($lane->items['closed'] as $item)
{
$diffTime = $type == 'story' ? strtotime($item['lastEditedDate']) - strtotime($item['openedDate']) : strtotime($item['closedDate']) - strtotime($item['openedDate']);
$day = round($diffTime / (3600 * 24), 1);
if($day > 0) $cycleTime[$item['id']] = $day;
}
}
}
$itemCount = count($cycleTime);
if(!$itemCount) return array('', '');
$cycleTimeAvg = round(array_sum($cycleTime) / $itemCount, 1);
$throughput = round(($itemCount * 7) / $cycleTimeAvg, 1) . "{$this->lang->execution->kanbanCardsUnit}/" . $this->lang->execution->week;
return array($cycleTimeAvg, $throughput);
}
/**
* Get taskes by search.
*