Analyze TypeScript and HTML files to identify hardcoded API endpoints that may require refactoring.
- A TypeScript source file
- Its corresponding HTML template file
Extract and analyze all string literals and template literals that appear to be API URLs or endpoints.
Do not include strings that are:
- Used for analytics or logging
- Related to navigation or routing
- Technical identifiers:
- Comments
- CSS classes
- Image sources
- Date/time formats
- Empty strings
- Icon names
- Device modes
- Storage keys
- Existing environment variable references
- State keys
- Form control names
- Strings inside "innerHTML" bindings
### Analysis Summary
- Total endpoints discovered: <count>
- Hardcoded endpoints: <count>
- Endpoints needing review: <count>Group by file path, each entry containing:
- Endpoint string with line number
- Full context (variable/function/element name)
- Usage assessment and confidence level
- Clickable source reference
Example format:
-
"https://api.example.com/v1/users"
- Location: src/app/example.service.ts:27
- Context: UserService.getUsers
- Assessment: Hardcoded API endpoint (High confidence)
-
"/api/v2/orders"
- Location: src/app/example.component.ts:58
- Context: OrderComponent.fetchOrders
- Assessment: Relative API endpoint (Medium confidence)
- List ambiguous endpoints separately
- Flag endpoints inside configuration objects for review
- Request user confirmation for uncertain cases
- Maintain original string context
- Provide clickable file references
Do not modify source files unless explicitly requested.