From ca2deb2774a97c4215451a0b4f5709da21e466ee Mon Sep 17 00:00:00 2001 From: liyang Date: Tue, 17 Dec 2024 13:09:36 +0800 Subject: [PATCH] * [task#134798] add count issue metrics. --- .../metric/calc/system/qc/count_of_issue.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/module/metric/calc/system/qc/count_of_issue.php b/module/metric/calc/system/qc/count_of_issue.php index d99963ec2f..3a942ab16a 100755 --- a/module/metric/calc/system/qc/count_of_issue.php +++ b/module/metric/calc/system/qc/count_of_issue.php @@ -18,3 +18,22 @@ * @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_issue extends baseCalc +{ + public $dataset = 'getRepoIssues'; + + public $fieldList = array(); + + public $result = 0; + + public function calculate($row) + { + if(!empty($row)) $this->result += 1; + } + + public function getResult($options = array()) + { + $records = $this->getRecords(array('value')); + return $this->filterByOptions($records, $options); + } +}