Merge branch 'sprint/tsj_uinttest' into 'master'

* Add test case and remove unused function.

See merge request easycorp/zentaopms!6788
This commit is contained in:
王怡栋
2023-01-29 06:37:57 +00:00
8 changed files with 311 additions and 44 deletions
-2
View File
@@ -1531,8 +1531,6 @@ class execution extends control
}
$dateList = date::getDateList($begin, $end, 'Y-m-d', $withWeekend == 'false'? 'noweekend' : '');
//list($cycleTimeAvg, $throughput) = $this->execution->getCFDStatistics($executionID, $dateList, $type);
$chartData = $this->execution->buildCFDData($executionID, $dateList, $type);
if(isset($chartData['line'])) $chartData['line'] = array_reverse($chartData['line']);
-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.
*