MCPcopy Index your code
hub / github.com/colbymchenry/codegraph / getStatus

Method getStatus

src/telemetry/index.ts:187–203  ·  view source on GitHub ↗

* Resolution order (first match wins) — keep in sync with TELEMETRY.md: * DO_NOT_TRACK=1 > CODEGRAPH_TELEMETRY=0|1 > stored config > default on.

()

Source from the content-addressed store, hash-verified

185 * DO_NOT_TRACK=1 > CODEGRAPH_TELEMETRY=0|1 > stored config > default on.
186 */
187 getStatus(): TelemetryStatus {
188 const config = this.readConfig();
189 const machineId = config?.machine_id ?? null;
190 const dnt = this.env.DO_NOT_TRACK;
191 if (dnt !== undefined && dnt !== '' && dnt !== '0' && dnt.toLowerCase() !== 'false') {
192 return { enabled: false, decidedBy: 'DO_NOT_TRACK', machineId, configPath: this.configPath };
193 }
194 const forced = this.env.CODEGRAPH_TELEMETRY;
195 if (forced !== undefined && forced !== '') {
196 const on = forced !== '0' && forced.toLowerCase() !== 'false';
197 return { enabled: on, decidedBy: 'CODEGRAPH_TELEMETRY', machineId, configPath: this.configPath };
198 }
199 if (config) {
200 return { enabled: config.enabled, decidedBy: 'config', machineId, configPath: this.configPath };
201 }
202 return { enabled: true, decidedBy: 'default', machineId, configPath: this.configPath };
203 }
204
205 isEnabled(): boolean {
206 return this.getStatus().enabled;

Callers 4

isEnabledMethod · 0.95
runInstallerWithOptionsFunction · 0.80
mainFunction · 0.80
telemetry.test.tsFile · 0.80

Calls 1

readConfigMethod · 0.95

Tested by

no test coverage detected