* Files that should not be candidates for "dominant file" detection: tests, * examples 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>)
| 38 | * to catch it (#1500). |
| 39 | */ |
| 40 | function isLowValueFile(filePath: string, generated?: ReadonlySet<string>): boolean { |
| 41 | if (generated?.has(filePath)) return true; |
| 42 | // Tests, examples, fixtures and benchmarks by the engine's own reading — |
| 43 | // LLVM's `unittests/`, Google's `foo_unittest.cc`, a C++ `FooTest.cpp` — |
| 44 | // plus the singular `__test__/` some projects use. |
| 45 | return isTestFile(filePath) || /(?:^|\/)__test__\//i.test(filePath) || isGeneratedFile(filePath); |
| 46 | } |
| 47 | |
| 48 | const SQLITE_PARAM_CHUNK_SIZE = 500; |
| 49 |
no test coverage detected