MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / include_target_outranks

Function include_target_outranks

src/pipeline/pass_pkgmap.c:1888–1908  ·  view source on GitHub ↗

Total order among nodes whose file path ends with the include path. The * by-name hits arrive in node-registration order, which under parallel * extraction is the workers' merge order and differs run to run; taking the * first hit made `#include ` target include/linux/device.h in * one index of the kernel and tools/virtio/linux/device.h in the next (5,821 * IMPORTS edges moved

Source from the content-addressed store, hash-verified

1886 * (include/ over tools/virtio/), then the smaller path, then the smaller QN
1887 * — a function of the candidate set alone (O9). */
1888static bool include_target_outranks(const cbm_gbuf_node_t *cand, const cbm_gbuf_node_t *best) {
1889 if (!best) {
1890 return true;
1891 }
1892 bool cand_file = strcmp(cand->label, "File") == 0;
1893 bool best_file = strcmp(best->label, "File") == 0;
1894 if (cand_file != best_file) {
1895 return cand_file;
1896 }
1897 int cd = include_path_depth(cand->file_path);
1898 int bd = include_path_depth(best->file_path);
1899 if (cd != bd) {
1900 return cd < bd;
1901 }
1902 int by_path = strcmp(cand->file_path, best->file_path);
1903 if (by_path != 0) {
1904 return by_path < 0;
1905 }
1906 return cand->qualified_name && best->qualified_name &&
1907 strcmp(cand->qualified_name, best->qualified_name) < 0;
1908}
1909
1910static const cbm_gbuf_node_t *resolve_exact_file_node(const cbm_pipeline_ctx_t *ctx,
1911 const char *file_path,

Callers 1

resolve_exact_file_nodeFunction · 0.85

Calls 1

include_path_depthFunction · 0.85

Tested by

no test coverage detected