From b227e0f3868690b8f15fa0c6760a1da8e75cba2a Mon Sep 17 00:00:00 2001 From: qixinzhi Date: Tue, 26 Sep 2023 06:01:34 +0000 Subject: [PATCH] * Fix execution metric. --- .../rate/rate_of_finished_story_in_execution.php | 16 ++++++++-------- .../count_of_finished_story_in_execution.php | 8 ++++---- .../count_of_invalid_story_in_execution.php | 8 ++++---- .../scale/count_of_story_in_execution.php | 8 ++++---- .../scale/count_of_valid_story_in_execution.php | 8 ++++---- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/module/metric/calc/execution/rate/rate_of_finished_story_in_execution.php b/module/metric/calc/execution/rate/rate_of_finished_story_in_execution.php index 462c3c2e83..57035f78e9 100644 --- a/module/metric/calc/execution/rate/rate_of_finished_story_in_execution.php +++ b/module/metric/calc/execution/rate/rate_of_finished_story_in_execution.php @@ -30,27 +30,27 @@ class rate_of_finished_story_in_execution extends baseCalc public function calculate($row) { - $project = $row->project; + $execution = $row->project; $closedReason = $row->closedReason; - if(!isset($this->result[$project])) + if(!isset($this->result[$execution])) { - $this->result[$project]['finished'] = 0; - $this->result[$project]['valid'] = 0; + $this->result[$execution]['finished'] = 0; + $this->result[$execution]['valid'] = 0; } - if($closedReason == 'done') $this->result[$project]['finished'] += 1; - if(!in_array($row->closedReason, array('duplicate','willnotdo','bydesign'))) $this->result[$project]['valid'] += 1; + if($closedReason == 'done') $this->result[$execution]['finished'] += 1; + if(!in_array($row->closedReason, array('duplicate','willnotdo','bydesign'))) $this->result[$execution]['valid'] += 1; } public function getResult($options = array()) { $records = array(); - foreach($this->result as $project => $value) + foreach($this->result as $execution => $value) { $finished = $value['finished']; $valid = $value['valid']; $ratio = $valid == 0 ? 0 : round($finished / $valid, 4); - $records[] = array('project' => $project, 'value' => $ratio); + $records[] = array('execution' => $execution, 'value' => $ratio); } return $this->filterByOptions($records, $options); } diff --git a/module/metric/calc/execution/scale/count_of_finished_story_in_execution.php b/module/metric/calc/execution/scale/count_of_finished_story_in_execution.php index d3dfba8b4d..ef081b5941 100644 --- a/module/metric/calc/execution/scale/count_of_finished_story_in_execution.php +++ b/module/metric/calc/execution/scale/count_of_finished_story_in_execution.php @@ -30,14 +30,14 @@ class count_of_finished_story_in_execution extends baseCalc public function calculate($row) { - $project = $row->project; - if(!isset($this->result[$project])) $this->result[$project] = 0; - if($row->closedReason == 'done') $this->result[$project] += 1; + $execution = $row->project; + if(!isset($this->result[$execution])) $this->result[$execution] = 0; + if($row->closedReason == 'done') $this->result[$execution] += 1; } public function getResult($options = array()) { - $records = $this->getRecords(array('project', 'value')); + $records = $this->getRecords(array('execution', 'value')); return $this->filterByOptions($records, $options); } } diff --git a/module/metric/calc/execution/scale/count_of_invalid_story_in_execution.php b/module/metric/calc/execution/scale/count_of_invalid_story_in_execution.php index 3d4cda1ac4..8074a8c6e6 100644 --- a/module/metric/calc/execution/scale/count_of_invalid_story_in_execution.php +++ b/module/metric/calc/execution/scale/count_of_invalid_story_in_execution.php @@ -30,14 +30,14 @@ class count_of_invalid_story_in_execution extends baseCalc public function calculate($row) { - $project = $row->project; - if(!isset($this->result[$project])) $this->result[$project] = 0; - if(in_array($row->closedReason, array('duplicate','willnotdo','bydesign'))) $this->result[$project] += 1; + $execution = $row->project; + if(!isset($this->result[$execution])) $this->result[$execution] = 0; + if(in_array($row->closedReason, array('duplicate','willnotdo','bydesign'))) $this->result[$execution] += 1; } public function getResult($options = array()) { - $records = $this->getRecords(array('project', 'value')); + $records = $this->getRecords(array('execution', 'value')); return $this->filterByOptions($records, $options); } } diff --git a/module/metric/calc/execution/scale/count_of_story_in_execution.php b/module/metric/calc/execution/scale/count_of_story_in_execution.php index 7db24f68ba..c3f0f7891e 100644 --- a/module/metric/calc/execution/scale/count_of_story_in_execution.php +++ b/module/metric/calc/execution/scale/count_of_story_in_execution.php @@ -30,14 +30,14 @@ class count_of_story_in_execution extends baseCalc public function calculate($row) { - $project = $row->project; - if(!isset($this->result[$project])) $this->result[$project] = 0; - $this->result[$project] += 1; + $execution = $row->project; + if(!isset($this->result[$execution])) $this->result[$execution] = 0; + $this->result[$execution] += 1; } public function getResult($options = array()) { - $records = $this->getRecords(array('project', 'value')); + $records = $this->getRecords(array('execution', 'value')); return $this->filterByOptions($records, $options); } } diff --git a/module/metric/calc/execution/scale/count_of_valid_story_in_execution.php b/module/metric/calc/execution/scale/count_of_valid_story_in_execution.php index 84ec6ff030..606d966c03 100644 --- a/module/metric/calc/execution/scale/count_of_valid_story_in_execution.php +++ b/module/metric/calc/execution/scale/count_of_valid_story_in_execution.php @@ -30,14 +30,14 @@ class count_of_valid_story_in_execution extends baseCalc public function calculate($row) { - $project = $row->project; - if(!isset($this->result[$project])) $this->result[$project] = 0; - if(!in_array($row->closedReason, array('duplicate','willnotdo','bydesign'))) $this->result[$project] += 1; + $execution = $row->project; + if(!isset($this->result[$execution])) $this->result[$execution] = 0; + if(!in_array($row->closedReason, array('duplicate','willnotdo','bydesign'))) $this->result[$execution] += 1; } public function getResult($options = array()) { - $records = $this->getRecords(array('project', 'value')); + $records = $this->getRecords(array('execution', 'value')); return $this->filterByOptions($records, $options); } }