MCPcopy Index your code
hub / github.com/github/git-sizer / contents

Method contents

sizes/output.go:467–607  ·  view source on GitHub ↗
(refGroups []RefGroup)

Source from the content-addressed store, hash-verified

465}
466
467func (s *HistorySize) contents(refGroups []RefGroup) tableContents {
468 S := newSection
469 I := newItem
470 metric := counts.Metric
471 binary := counts.Binary
472
473 //nolint:prealloc // The length is not known in advance.
474 var rgis []tableContents
475 for _, rg := range refGroups {
476 if rg.Symbol == "" {
477 continue
478 }
479 count, ok := s.ReferenceGroups[rg.Symbol]
480 if !ok {
481 continue
482 }
483 rgi := I(
484 fmt.Sprintf("refgroup.%s", rg.Symbol), rg.Name,
485 fmt.Sprintf("The number of references in group '%s'", rg.Symbol),
486 nil, *count, metric, "", 25000,
487 )
488 indent := strings.Count(string(rg.Symbol), ".")
489 rgis = append(rgis, rgi.Indented(indent))
490 }
491
492 return S(
493 "",
494 S(
495 "Overall repository size",
496 S(
497 "Commits",
498 I("uniqueCommitCount", "Count",
499 "The total number of distinct commit objects",
500 nil, s.UniqueCommitCount, metric, "", 500e3),
501 I("uniqueCommitSize", "Total size",
502 "The total size of all commit objects",
503 nil, s.UniqueCommitSize, binary, "B", 250e6),
504 ),
505
506 S(
507 "Trees",
508 I("uniqueTreeCount", "Count",
509 "The total number of distinct tree objects",
510 nil, s.UniqueTreeCount, metric, "", 1.5e6),
511 I("uniqueTreeSize", "Total size",
512 "The total size of all distinct tree objects",
513 nil, s.UniqueTreeSize, binary, "B", 2e9),
514 I("uniqueTreeEntries", "Total tree entries",
515 "The total number of entries in all distinct tree objects",
516 nil, s.UniqueTreeEntries, metric, "", 50e6),
517 ),
518
519 S(
520 "Blobs",
521 I("uniqueBlobCount", "Count",
522 "The total number of distinct blob objects",
523 nil, s.UniqueBlobCount, metric, "", 1.5e6),
524 I("uniqueBlobSize", "Total size",

Callers 2

TableStringMethod · 0.95
JSONMethod · 0.95

Calls 1

IndentedMethod · 0.80

Tested by

no test coverage detected