MCPcopy Create free account
hub / github.com/Facets-cloud/flow / projectTaskCounts

Function projectTaskCounts

internal/app/list.go:935–962  ·  view source on GitHub ↗
(db *sql.DB, projectSlug string)

Source from the content-addressed store, hash-verified

933}
934
935func projectTaskCounts(db *sql.DB, projectSlug string) (taskCounts, error) {
936 var c taskCounts
937 rows, err := db.Query(
938 `SELECT status, COUNT(*) FROM tasks
939 WHERE project_slug = ? AND archived_at IS NULL
940 GROUP BY status`, projectSlug)
941 if err != nil {
942 return c, err
943 }
944 defer rows.Close()
945 for rows.Next() {
946 var s string
947 var n int
948 if err := rows.Scan(&s, &n); err != nil {
949 return c, err
950 }
951 c.total += n
952 switch s {
953 case "in-progress":
954 c.inProg += n
955 case "backlog":
956 c.backlog += n
957 case "done":
958 c.done += n
959 }
960 }
961 return c, rows.Err()
962}
963
964func statusAbbrev(status string) string {
965 switch status {

Callers 1

listProjectsCmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected