Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#66093] Reduce Abc Metric

Tobias Dillmanndd2fcc68fb75
diff --git a/app/models/acts_as_customizable/calculated_value.rb b/app/models/acts_as_customizable/calculated_value.rb
index 4b2cc5e9772..ed208385500 100644
--- a/app/models/acts_as_customizable/calculated_value.rb
+++ b/app/models/acts_as_customizable/calculated_value.rb
@@ -115,6 +115,10 @@ module ActsAsCustomizable::CalculatedValue
# When no value could be calculated, but all required variables in the formula are present,
# we must assume that a mathematical error occurred:
+ create_mathematical_errors(calculated_fields_without_value, cvs_with_errors)
+ end
+
+ def create_mathematical_errors(calculated_fields_without_value, cvs_with_errors = [])
calculated_fields_without_value.each do |cf|
# Skip if we already created an error for this calculated value
next if cvs_with_errors.include?(cf.id)