MCPcopy Create free account
hub / github.com/driangle/taskmd / collectReportData

Function collectReportData

apps/cli/internal/cli/report_collect.go:33–62  ·  view source on GitHub ↗
(tasks []*model.Task, groupBy string, includeGraph bool)

Source from the content-addressed store, hash-verified

31}
32
33func collectReportData(tasks []*model.Task, groupBy string, includeGraph bool) (*reportData, error) {
34 m := metrics.Calculate(tasks)
35
36 grouped, err := board.GroupTasks(tasks, groupBy)
37 if err != nil {
38 return nil, err
39 }
40
41 taskMap := buildTaskMap(tasks)
42
43 blocked := findBlockedTasks(tasks, taskMap)
44 critical := findCriticalPathTasks(tasks, taskMap)
45
46 data := &reportData{
47 Metrics: m,
48 GroupedTasks: grouped,
49 GroupBy: groupBy,
50 CriticalPath: critical,
51 BlockedTasks: blocked,
52 IncludeGraph: includeGraph,
53 }
54
55 if includeGraph {
56 g := graph.NewGraph(tasks)
57 data.GraphMermaid = g.ToMermaid("")
58 data.GraphJSON = g.ToJSON()
59 }
60
61 return data, nil
62}
63
64func findBlockedTasks(tasks []*model.Task, taskMap map[string]*model.Task) []reportTask {
65 var blocked []reportTask

Callers 1

runReportFunction · 0.85

Calls 5

ToMermaidMethod · 0.95
ToJSONMethod · 0.95
buildTaskMapFunction · 0.85
findBlockedTasksFunction · 0.85
findCriticalPathTasksFunction · 0.85

Tested by

no test coverage detected