Continue to refactor for readability
@@ -442,6 +442,13 @@ func fileSummarizeShort(input chan *FileJob) string {
str.WriteString(tabularShortBreak)
if !Cocomo {
+ calculateCocomo(sumCode, &str)
+ }
+
+ return str.String()
+}
+
+func calculateCocomo(sumCode int64, str *strings.Builder) {
estimatedEffort := EstimateEffort(int64(sumCode))
estimatedCost := EstimateCost(estimatedEffort, AverageWage)
estimatedScheduleMonths := EstimateScheduleMonths(estimatedEffort)
@@ -455,9 +462,6 @@ func fileSummarizeShort(input chan *FileJob) string {
str.WriteString(tabularShortBreak)
}
- return str.String()
-}
-
func sortLanguageSummary(language []LanguageSummary) []LanguageSummary {
// Cater for the common case of adding plural even for those options that don't make sense
// as its quite common for those who English is not a first language to make a simple mistake
