273// scc's analysis modes (ULOC, line-length, per-file table) are gated by
274// process-wide globals. The report mode flips them on inside a single
275▶// invocation; we snapshot and restore via defer so panics, errors, or
276// in-process re-entrancy don't leak state into a later scc call.
277type reportFlagState struct {
· · ·
307// snapshotted and restored via defer, but callers should not assume the
308// flags retain their on-entry values during the call.
309▶func CollectReportData(path string) (ReportData, error) {
310 start := time.Now()
311
· · ·
474// rollup and a flat per-file slice. Reuses aggregateLanguageSummary by
475// feeding it the same FileJobs through a buffered channel.
476▶func walkAndAggregate(path string) ([]*FileJob, []LanguageSummary, Totals, error) {
477 if path == "" {
478 path = "."
· · ·
482 info, err := os.Stat(fpath)
483 if err != nil {
484▶ return nil, nil, Totals{}, fmt.Errorf("file or directory could not be read: %s", fpath)
485 }
486
· · ·
501 if len(dirPaths) > 0 {
502 fileWalker := gocodewalker.NewParallelFileWalker(dirPaths, potentialFilesQueue)
503▶ fileWalker.SetErrorHandler(func(e error) bool {
504 printError(e.Error())
505 return true
+ 4 more matches in this file