Skip to content

[Export Audit] Dead export: extractDomain exported from log-parser.ts but never used in production code #3807

@github-actions

Description

@github-actions

API Surface Issue

Category

Unused export

Summary

  • File: src/logs/log-parser.ts
  • Symbol: extractDomain (line 108)
  • Issue: extractDomain is exported as a public API symbol but is never imported by any production code — only log-parser.test.ts references it.

Evidence

$ grep -rw "extractDomain" src --include="*.ts"
src/logs/log-parser.ts:108:export function extractDomain(url: string, host: string, method: string): string {
src/logs/log-parser.ts:  (used internally via parseLogLine and parseAuditJsonlLine calls within the same file)
src/logs/log-parser.test.ts: (test-only imports and direct calls)

The function is called internally within log-parser.ts itself (inside parseLogLine and parseAuditJsonlLine) but is not imported by any other production module. The src/logs/index.ts barrel was cleaned up (issue #3025) and does not re-export it, but the export keyword on the definition itself remains.

Recommended Fix

Remove the export keyword from extractDomain in src/logs/log-parser.ts:

// Before
export function extractDomain(url: string, host: string, method: string): string {

// After
function extractDomain(url: string, host: string, method: string): string {

The test in log-parser.test.ts that directly calls extractDomain should be updated to test the behaviour indirectly via parseLogLine instead — this keeps the implementation detail internal and tests the public contract.

Impact

  • Dead code risk: Low (function executes correctly, but unnecessarily widens the public contract)
  • Maintenance burden: Low (small function, but every unnecessary public export must be preserved across refactors)

Detected by Export Audit workflow. Triggered by push to main on 2026-05-25

Generated by API Surface & Export Audit · sonnet46 2.1M ·

  • expires on Jun 24, 2026, 7:05 PM UTC

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions