* Files that should not be candidates for "dominant file" detection: test/spec * files and tool-generated files. Generated files (`*.pb.go`, `*.pulsar.go`, * mock outputs, …) often have huge in-file edge counts that dwarf the real * source — etcd's `rpc.pb.go` has 4× the in-file edges of `server.
(filePath: string, generated?: ReadonlySet<string>)
| 35 | * to catch it (#1500). |
| 36 | */ |
| 37 | function isLowValueFile(filePath: string, generated?: ReadonlySet<string>): boolean { |
| 38 | if (generated?.has(filePath)) return true; |
| 39 | const lp = filePath.toLowerCase(); |
| 40 | return ( |
| 41 | /(?:^|\/)(tests?|__tests?__|spec)\//.test(lp) || |
| 42 | /_test\.go$/.test(lp) || |
| 43 | /(?:^|\/)test_[^/]+\.py$/.test(lp) || |
| 44 | /_test\.py$/.test(lp) || |
| 45 | /_spec\.rb$/.test(lp) || |
| 46 | /_test\.rb$/.test(lp) || |
| 47 | /\.(test|spec)\.[jt]sx?$/.test(lp) || |
| 48 | /(test|spec|tests)\.(java|kt|scala)$/.test(lp) || |
| 49 | /(tests?|spec)\.cs$/.test(lp) || |
| 50 | /tests?\.swift$/.test(lp) || |
| 51 | /_test\.dart$/.test(lp) || |
| 52 | isGeneratedFile(filePath) |
| 53 | ); |
| 54 | } |
| 55 | |
| 56 | const SQLITE_PARAM_CHUNK_SIZE = 500; |
| 57 |
no test coverage detected