From f4e36432ae4169dfa097fc2c3959a2df0261b754 Mon Sep 17 00:00:00 2001 From: wangzemei Date: Fri, 6 Jun 2025 09:24:42 +0800 Subject: [PATCH] + [story#75279] add the getResult for the count_of_bug_in_severity_in_execution metric. --- .../scale/count_of_bug_in_severity_in_execution.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/module/metric/calc/execution/scale/count_of_bug_in_severity_in_execution.php b/module/metric/calc/execution/scale/count_of_bug_in_severity_in_execution.php index 1c633b9157..ffcf2ae450 100644 --- a/module/metric/calc/execution/scale/count_of_bug_in_severity_in_execution.php +++ b/module/metric/calc/execution/scale/count_of_bug_in_severity_in_execution.php @@ -12,4 +12,17 @@ class count_of_bug_in_severity_in_execution extends baseCalc if(!isset($this->result[$row->severity])) $this->result[$row->severity] = array(); $this->result[$row->severity][$row->id] = $row->id; } + + public function getResult($options = array()) + { + foreach($this->result as $severity => $bugs) + { + if(!is_array($bugs)) continue; + + $this->result[$severity] = count($bugs); + } + + $records = $this->getRecords(array('severity', 'value')); + return $this->filterByOptions($records, $options); + } }