253// scc's analysis modes (ULOC, line-length, per-file table) are gated by
254// process-wide globals. The report mode flips them on inside a single
255▶// invocation; we snapshot and restore via defer so panics, errors, or
256// in-process re-entrancy don't leak state into a later scc call.
257type reportFlagState struct {
· · ·
284// snapshotted and restored via defer, but callers should not assume the
285// flags retain their on-entry values during the call.
286▶func CollectReportData(path string) (ReportData, error) {
287 start := time.Now()
288
· · ·
439// rollup and a flat per-file slice. Reuses aggregateLanguageSummary by
440// feeding it the same FileJobs through a buffered channel.
441▶func walkAndAggregate(path string) ([]*FileJob, []LanguageSummary, Totals, error) {
442 if path == "" {
443 path = "."
· · ·
447 info, err := os.Stat(fpath)
448 if err != nil {
449▶ return nil, nil, Totals{}, fmt.Errorf("file or directory could not be read: %s", fpath)
450 }
451
· · ·
466 if len(dirPaths) > 0 {
467 fileWalker := gocodewalker.NewParallelFileWalker(dirPaths, potentialFilesQueue)
468▶ fileWalker.SetErrorHandler(func(e error) bool {
469 printError(e.Error())
470 return true
+ 4 more matches in this file