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