UNPKG

agentsqripts

Version:

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

40 lines (38 loc) 2 kB
/** * @file Centralized pattern detection system aggregating specialized detection functions * @description Single responsibility: Provide unified access to pattern detection capabilities * * This aggregation module consolidates pattern detection functions from specialized * single-responsibility modules to provide comprehensive code pattern analysis capabilities. * It serves as the central access point for loop detection, conditional analysis, * and code structure identification used across multiple AgentSqripts analyzers. * * Design rationale: * - Unified interface simplifies pattern detection integration across analyzers * - Specialized function imports maintain Single Responsibility Principle compliance * - Modular organization enables independent testing and maintenance of detection logic * - Centralized access prevents scattered imports and ensures consistent pattern detection * - Comprehensive coverage from basic loops to complex conditional structures * * Pattern detection domains: * - Loop patterns: Fixed loops, unbounded loops, and loop body analysis * - Conditional patterns: Early exit detection and control flow analysis * - Structural patterns: Code organization and iteration pattern identification * - Issue collection: Systematic gathering and processing of detected patterns */ const isLoopPattern = require('./pattern-detector/loop/isLoopPattern'); const isSmallFixedLoop = require('./pattern-detector/loop/isSmallFixedLoop'); const isUnboundedLoop = require('./pattern-detector/loop/isUnboundedLoop'); const hasEarlyExit = require('./pattern-detector/conditions/hasEarlyExit'); const getLoopBodyRange = require('./pattern-detector/loop/getLoopBodyRange'); const iterateLines = require('./pattern-detector/iterateLines'); const collectIssues = require('./pattern-detector/collectIssues'); module.exports = { isLoopPattern, isSmallFixedLoop, isUnboundedLoop, hasEarlyExit, getLoopBodyRange, iterateLines, collectIssues };