From 2bc37f42432d9ddb94b57d3399163245c3e84b95 Mon Sep 17 00:00:00 2001 From: wangzemei Date: Wed, 4 Jun 2025 15:07:45 +0800 Subject: [PATCH 1/3] + [story#75272] add the metrics for fixed bugs. --- .../scale/count_of_fixed_bug_in_execution.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 module/metric/calc/execution/scale/count_of_fixed_bug_in_execution.php diff --git a/module/metric/calc/execution/scale/count_of_fixed_bug_in_execution.php b/module/metric/calc/execution/scale/count_of_fixed_bug_in_execution.php new file mode 100644 index 0000000000..47fc896003 --- /dev/null +++ b/module/metric/calc/execution/scale/count_of_fixed_bug_in_execution.php @@ -0,0 +1,20 @@ + + * @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 + */ From 08dac84a4e5f622f4c5949d244a8276228bf001c Mon Sep 17 00:00:00 2001 From: wangzemei Date: Wed, 4 Jun 2025 15:08:05 +0800 Subject: [PATCH 2/3] + [story#75272] add the metrics for fixed bugs. --- .../scale/count_of_fixed_bug_in_execution.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/module/metric/calc/execution/scale/count_of_fixed_bug_in_execution.php b/module/metric/calc/execution/scale/count_of_fixed_bug_in_execution.php index 47fc896003..adb89ee678 100644 --- a/module/metric/calc/execution/scale/count_of_fixed_bug_in_execution.php +++ b/module/metric/calc/execution/scale/count_of_fixed_bug_in_execution.php @@ -18,3 +18,19 @@ * @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_fixed_bug_in_execution extends baseCalc +{ + public $dataset = 'getExecutionBugs'; + + public $fieldList = array('t1.execution', 't1.status', 't1.resolution'); + + public $result = array(); + + public function calculate($data) + { + $execution = $data->execution; + if(!isset($this->result[$execution])) $this->result[$execution] = 0; + + if($data->status == 'closed' and $data->resolution == 'fixed') $this->result[$execution] += 1; + } +} From bd999721625161c1cb58edf4fe2d1a0f469b38f5 Mon Sep 17 00:00:00 2001 From: wangzemei Date: Wed, 4 Jun 2025 15:08:31 +0800 Subject: [PATCH 3/3] + [story#75272] add the metrics for fixed bugs. --- .../execution/scale/count_of_fixed_bug_in_execution.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module/metric/calc/execution/scale/count_of_fixed_bug_in_execution.php b/module/metric/calc/execution/scale/count_of_fixed_bug_in_execution.php index adb89ee678..96931e9973 100644 --- a/module/metric/calc/execution/scale/count_of_fixed_bug_in_execution.php +++ b/module/metric/calc/execution/scale/count_of_fixed_bug_in_execution.php @@ -33,4 +33,10 @@ class count_of_fixed_bug_in_execution extends baseCalc if($data->status == 'closed' and $data->resolution == 'fixed') $this->result[$execution] += 1; } + + public function getResult($options = null) + { + $records = $this->getRecords(array('execution', 'value')); + return $this->filterByOptions($records, $options); + } }