+ Add metric for repo issue.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* 按系统统计代码库待处理问题总数。
|
||||
* Count of pending issue.
|
||||
*
|
||||
* 范围:system
|
||||
* 对象:codebase
|
||||
* 目的:qc
|
||||
* 度量名称:按系统统计代码库待处理问题总数
|
||||
* 单位:系统统计的代码库待处理问题总数是指所有代码库中尚未解决的问题数量的统计,它反映了代码库的健康状况和存在的潜在问题数量,通过对问题总数的监控和分析,可以及时发现并解决和解决问题,提高软件开发过程的效率和质量。
|
||||
* 描述:所有代码库的未关闭代码问题个数求和
|
||||
不统计删除的问题
|
||||
不统计删除的代码库里的问题
|
||||
* 定义:realtime;
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @author qixinzhi <qixinzhi@easycorp.ltd>
|
||||
* @package
|
||||
* @uses func
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @Link https://www.zentao.net
|
||||
*/
|
||||
class count_of_pending_issue extends baseCalc
|
||||
{
|
||||
public $dataset = 'getPendingRepoIssues';
|
||||
|
||||
public $fieldList = array('t1.id');
|
||||
|
||||
public $result = 0;
|
||||
|
||||
public function calculate($row)
|
||||
{
|
||||
$this->result += 1;
|
||||
}
|
||||
|
||||
public function getResult($options = array())
|
||||
{
|
||||
$records = $this->getRecords(array('value'));
|
||||
return $this->filterByOptions($records, $options);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
|
||||
title=count_of_pending_issue
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 7) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 4) . '/calc.class.php';
|
||||
|
||||
zdTable('bug')->config('bug_repo', true, 4)->gen(10);
|
||||
|
||||
$metric = new metricTest();
|
||||
$calc = $metric->calcMetric(__FILE__);
|
||||
|
||||
r($calc->getResult()) && p('0:value') && e('6'); // 测试代码库待处理问题数。
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
title: zt_bug
|
||||
author: Yanyi Cao
|
||||
version: "1.0"
|
||||
fields:
|
||||
- field: id
|
||||
range: 1-10000
|
||||
- field: product
|
||||
range: 1-10{8}
|
||||
- field: openedDate
|
||||
range: "20100101 000000-20210101 230000:10D"
|
||||
type: timestamp
|
||||
format: YYYY-MM-DD hh:mm:ss
|
||||
- field: resolvedDate
|
||||
range: "20110101 000000-20210101 230000:10D"
|
||||
type: timestamp
|
||||
format: YYYY-MM-DD hh:mm:ss
|
||||
- field: closedDate
|
||||
range: "20120101 000000-20220101 230000:10D"
|
||||
type: timestamp
|
||||
format: YYYY-MM-DD hh:mm:ss
|
||||
- field: severity
|
||||
range: 1{10},2{10},3{5},4{3}
|
||||
- field: deleted
|
||||
range: 0{4},1{4}
|
||||
- field: repo
|
||||
range: 1-10
|
||||
- field: type
|
||||
range: codeimprovement
|
||||
- field: lines
|
||||
range: '`1,2`, `3,3`, `1,3`'
|
||||
- field: v2
|
||||
range: master
|
||||
...
|
||||
Reference in New Issue
Block a user