UNPKG

agentsqripts

Version:

Comprehensive static code analysis toolkit for identifying technical debt, security vulnerabilities, performance issues, and code quality problems

63 lines (61 loc) 3.13 kB
/** * @file Missing endpoint detector for frontend-backend integration analysis * @description Single responsibility: Identify frontend API calls without corresponding backend endpoints * * This module implements cross-reference analysis to identify frontend API calls that * lack corresponding backend endpoint implementations. This analysis helps detect * integration gaps that could cause runtime failures, incomplete feature implementations, * or deployment issues when frontend and backend are developed independently. * * Design rationale: * - Cross-reference analysis prevents runtime integration failures * - Route normalization enables accurate endpoint matching despite format variations * - Method-aware comparison ensures complete endpoint coverage validation * - Currently implemented as stub for future comprehensive analysis implementation */ /** * Detect missing backend endpoints using cross-reference analysis (implementation pending) * * Technical function: Cross-reference frontend calls against backend endpoints to identify gaps * * Implementation rationale (planned): * - Route normalization will handle path parameter variations and trailing slashes * - Method-specific matching will ensure GET /users doesn't satisfy POST /users calls * - Fuzzy matching will handle slight route variations between frontend and backend * - Priority scoring will rank missing endpoints by usage frequency and criticality * * Analysis strategy (planned): * - Normalize both frontend call routes and backend endpoint routes * - Create lookup map of backend endpoints by method and normalized route * - Iterate through frontend calls to identify unmatched requests * - Generate detailed mismatch reports with location and impact information * * Missing endpoint patterns to detect: * - Exact route mismatches: frontend calls /api/user but backend has /api/users * - Method mismatches: frontend POST but backend only supports GET * - Missing CRUD operations: frontend expects full REST API but backend partial * - Version mismatches: frontend calls /v2/api but backend only implements /v1/api * * Integration gap impact assessment: * - Critical: Authentication and core functionality endpoints * - High: Data modification and creation endpoints * - Medium: Data retrieval endpoints with workarounds * - Low: Optional features and enhancement endpoints * * @param {Array<Object>} frontendCalls - Frontend API calls with method, route, file, line * @param {Array<Object>} backendEndpoints - Backend endpoints with method, route, file * @returns {Array<Object>} Missing endpoint analysis results (currently empty - implementation pending) * @example * const missing = detectMissingEndpoints([ * { method: 'POST', route: '/api/users', file: 'UserForm.jsx', line: 15 } * ], [ * { method: 'GET', route: '/api/users', file: 'users.js' } * ]); * // Should return: [{ method: 'POST', route: '/api/users', severity: 'HIGH', ... }] */ function detectMissingEndpoints(frontendCalls, backendEndpoints) { return []; } module.exports = { detectMissingEndpoints };