GetCompletionPercentage returns the percentage of completed stories.
()
| 2230 | |
| 2231 | // GetCompletionPercentage returns the percentage of completed stories. |
| 2232 | func (a *App) GetCompletionPercentage() float64 { |
| 2233 | if len(a.prd.UserStories) == 0 { |
| 2234 | return 100.0 |
| 2235 | } |
| 2236 | var completed int |
| 2237 | for _, s := range a.prd.UserStories { |
| 2238 | if s.Passes { |
| 2239 | completed++ |
| 2240 | } |
| 2241 | } |
| 2242 | return float64(completed) / float64(len(a.prd.UserStories)) * 100.0 |
| 2243 | } |
| 2244 | |
| 2245 | // GetLastActivity returns the last activity message. |
| 2246 | func (a *App) GetLastActivity() string { |