MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / isLowValueFile

Function isLowValueFile

src/db/queries.ts:40–46  ·  view source on GitHub ↗

* 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>)

Source from the content-addressed store, hash-verified

38 * to catch it (#1500).
39 */
40function 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
48const SQLITE_PARAM_CHUNK_SIZE = 500;
49

Callers 3

computeDominantFileMethod · 0.85
getTopRouteFileMethod · 0.85
getRoutingManifestMethod · 0.85

Calls 3

isTestFileFunction · 0.90
isGeneratedFileFunction · 0.90
hasMethod · 0.80

Tested by

no test coverage detected