(project scanner.Project, max int)
| 553 | } |
| 554 | |
| 555 | func capBlastRadiusProject(project scanner.Project, max int) scanner.Project { |
| 556 | if max >= len(project.Files) { |
| 557 | return project |
| 558 | } |
| 559 | project.Files = append([]scanner.FileInfo(nil), project.Files[:max]...) |
| 560 | // Impact is an independent, usage-sorted list keyed by basename; filter it to |
| 561 | // the files actually shown rather than slicing it by the changed-file cap, |
| 562 | // which would drop or mis-attribute the diff impact footer. |
| 563 | project.Impact = filterImpactToShownFiles(project.Impact, project.Files) |
| 564 | return project |
| 565 | } |
| 566 | |
| 567 | // filterImpactToShownFiles keeps only impact entries whose basename matches a |
| 568 | // shown changed file (or its directory, for package-style imports). |
no test coverage detected