5import (
6 "encoding/csv"
7▶ "errors"
8 "fmt"
9 "os"
· · ·
408//
409// target accepts the same forms as --coupling-for and is validated against HEAD
410▶// before the walk, so a caller passing a bad path gets an immediate error rather
411// than paying for a full traversal first.
412func CouplingForJSONReport(repoPath, target string, limit int) (string, error) {
· · ·
412▶func CouplingForJSONReport(repoPath, target string, limit int) (string, error) {
413 resolved, err := resolveCouplingTarget(repoPath, target)
414 if err != nil {
· · ·
426// which needs the rendered data rather than stdout side effects. A limit > 0
427// caps the pair list (strongest first); limit <= 0 returns every pair.
428▶func CouplingJSONReport(repoPath string, limit int) (string, error) {
429 observer := newCouplingObserver()
430 if _, err := runHistory(repoPath, observer); err != nil {
· · ·
441// object.Tree.Files().ForEach surfaces whatever the callback returns, so it is
442// compared back at the call site and discarded.
443▶var errStopTreeWalk = errors.New("stop tree walk")
444
445// couplingTargetCandidates returns the repo-relative forms to try for a
+ 31 more matches in this file