* Adjust for SonarQube questions.
This commit is contained in:
+10
-17
@@ -1549,7 +1549,7 @@ class productModel extends model
|
||||
}
|
||||
|
||||
$casesCount = $this->productTao->getStoryCasesCount($storyIdList);
|
||||
$rate = count($stories) == 0 || $rateCount == 0 ? 0 : round($casesCount / $rateCount, 2);
|
||||
$rate = empty($stories) || $rateCount == 0 ? 0 : round($casesCount / $rateCount, 2);
|
||||
|
||||
$storyCommon = $this->lang->SRCommon;
|
||||
if($storyType == 'requirement') $storyCommon = $this->lang->URCommon;
|
||||
@@ -1704,20 +1704,20 @@ class productModel extends model
|
||||
$link = helper::createLink($module, $method, "productID=%s" . ($branch ? "&branch=%s" : ''));
|
||||
}
|
||||
}
|
||||
else if($module == 'productplan' || $module == 'release')
|
||||
elseif($module == 'productplan' || $module == 'release')
|
||||
{
|
||||
if($method != 'browse' && $method != 'create') $method = 'browse';
|
||||
$link = helper::createLink($module, $method, "productID=%s" . ($branch ? "&branch=%s" : ''));
|
||||
}
|
||||
else if($module == 'tree')
|
||||
elseif($module == 'tree')
|
||||
{
|
||||
$link = helper::createLink($module, $method, "productID=%s&type=$extra¤tModuleID=0" . ($branch ? "&branch=%s" : ''));
|
||||
}
|
||||
else if($module == 'branch')
|
||||
elseif($module == 'branch')
|
||||
{
|
||||
$link = helper::createLink($module, $method, "productID=%s");
|
||||
}
|
||||
else if($module == 'doc' or $module == 'api')
|
||||
elseif($module == 'doc' or $module == 'api')
|
||||
{
|
||||
$link = helper::createLink('doc', 'productSpace', "objectID=%s");
|
||||
}
|
||||
@@ -1782,8 +1782,7 @@ class productModel extends model
|
||||
*/
|
||||
public function setParamsForLink($module, $link, $projectID, $productID)
|
||||
{
|
||||
$linkHtml = strpos('programplan', $module) !== false ? sprintf($link, $projectID, $productID) : sprintf($link, $productID);
|
||||
return $linkHtml;
|
||||
return strpos('programplan', $module) !== false ? sprintf($link, $projectID, $productID) : sprintf($link, $productID);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1872,7 +1871,7 @@ class productModel extends model
|
||||
|
||||
if($key == 'planList')
|
||||
{
|
||||
foreach($data as $productID => $plan)
|
||||
foreach($data as $plan)
|
||||
{
|
||||
!empty($plan) && array_map(function($planItem)
|
||||
{
|
||||
@@ -1889,11 +1888,7 @@ class productModel extends model
|
||||
public function buildRows($productStructure, $params = array())
|
||||
{
|
||||
$programLines = zget($params, 'programLines', array());
|
||||
$users = zget($params, 'users', array());
|
||||
$usersAvatar = zget($params, 'usersAvatar', array());
|
||||
$userIdPairs = zget($params, 'userIdPairs', array());
|
||||
|
||||
$rows = array();
|
||||
$rows = array();
|
||||
foreach($productStructure as $programID => $program)
|
||||
{
|
||||
if($programID and $this->config->systemMode == 'ALM') $rows[] = $this->buildRowData($programID, $program, 'program', $params);
|
||||
@@ -1936,10 +1931,8 @@ class productModel extends model
|
||||
|
||||
public function buildRowData($id, $data, $type = 'program', $params = array())
|
||||
{
|
||||
$programLines = zget($params, 'programLines', array());
|
||||
$users = zget($params, 'users', array());
|
||||
$usersAvatar = zget($params, 'usersAvatar', array());
|
||||
$userIdPairs = zget($params, 'userIdPairs', array());
|
||||
$users = zget($params, 'users', array());
|
||||
$usersAvatar = zget($params, 'usersAvatar', array());
|
||||
|
||||
$row = new stdclass();
|
||||
$row->id = $id;
|
||||
|
||||
@@ -690,7 +690,6 @@ class productTao extends productModel
|
||||
protected function getGroupRoadmapData(int $productID, string $branch, int $count): array
|
||||
{
|
||||
$roadmap = array();
|
||||
$total = 0;
|
||||
$return = false;
|
||||
|
||||
/* Get product plans. */
|
||||
@@ -803,7 +802,7 @@ class productTao extends productModel
|
||||
$roadmap = $this->processRoadmap($roadmap, $branch);
|
||||
$return = true;
|
||||
break;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -342,7 +342,7 @@ class storyTao extends storyModel
|
||||
$parents = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($parents)->andWhere('deleted')->eq(0)->fetchAll('id');
|
||||
}
|
||||
|
||||
foreach($stories as $storyID => $story)
|
||||
foreach($stories as $story)
|
||||
{
|
||||
/* Export story linkstories. */
|
||||
if(isset($children[$story->id])) $story->linkStories = implode(',', array_column($children[$story->id], 'title'));
|
||||
@@ -399,7 +399,7 @@ class storyTao extends storyModel
|
||||
/* 获取查询条件。 */
|
||||
$rawModule = $this->app->rawModule;
|
||||
$this->loadModel('search')->setQuery($rawModule == 'projectstory' ? 'story' : 'executionStory', $queryID);
|
||||
if($this->session->executionStoryQuery == false) $this->session->set('executionStoryQuery', ' 1 = 1');
|
||||
if(!$this->session->executionStoryQuery) $this->session->set('executionStoryQuery', ' 1 = 1');
|
||||
if($rawModule == 'projectstory') $this->session->set('executionStoryQuery', $this->session->storyQuery);
|
||||
|
||||
/* 处理查询条件。 */
|
||||
|
||||
Reference in New Issue
Block a user