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

Method getStatus

src/telemetry/index.ts:235–254  ·  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

233 * DO_NOT_TRACK=1 > CODEGRAPH_TELEMETRY=0|1 > stored config > default on.
234 */
235 getStatus(): TelemetryStatus {
236 const config = this.readConfig();
237 const machineId = config?.machine_id ?? null;
238 const dnt = this.env.DO_NOT_TRACK;
239 if (dnt !== undefined && dnt !== '' && dnt !== '0' && dnt.toLowerCase() !== 'false') {
240 this.clearPending();
241 return { enabled: false, decidedBy: 'DO_NOT_TRACK', machineId, configPath: this.configPath };
242 }
243 const forced = this.env.CODEGRAPH_TELEMETRY;
244 if (forced !== undefined && forced !== '') {
245 const on = forced !== '0' && forced.toLowerCase() !== 'false';
246 if (!on) this.clearPending();
247 return { enabled: on, decidedBy: 'CODEGRAPH_TELEMETRY', machineId, configPath: this.configPath };
248 }
249 if (config) {
250 if (!config.enabled) this.clearPending();
251 return { enabled: config.enabled, decidedBy: 'config', machineId, configPath: this.configPath };
252 }
253 return { enabled: true, decidedBy: 'default', machineId, configPath: this.configPath };
254 }
255
256 isEnabled(): boolean {
257 return this.getStatus().enabled;

Callers 9

isEnabledMethod · 0.95
flushNowMethod · 0.95
canUseIdentityMethod · 0.95
persistSyncMethod · 0.95
recoverStaleClaimsMethod · 0.95
runInstallerWithOptionsFunction · 0.80
mainFunction · 0.80
telemetry.test.tsFile · 0.80

Calls 2

readConfigMethod · 0.95
clearPendingMethod · 0.95

Tested by

no test coverage detected