agentsqripts
Version:
Comprehensive static code analysis toolkit for identifying technical debt, security vulnerabilities, performance issues, and code quality problems
44 lines (42 loc) • 1.05 kB
JavaScript
/**
* @file Get template pattern definitions
* @description Single responsibility: Define common template patterns
*/
/**
* Get common template patterns for duplicate detection
*/
function getTemplatePatterns() {
return [
{
name: 'express_route',
indicators: ['router', 'req', 'res', 'next', 'express'],
threshold: 3
},
{
name: 'test_setup',
indicators: ['describe', 'it', 'expect', 'beforeEach', 'afterEach'],
threshold: 3
},
{
name: 'react_component',
indicators: ['useState', 'useEffect', 'props', 'render', 'return'],
threshold: 3
},
{
name: 'error_handler',
indicators: ['catch', 'error', 'throw', 'message', 'stack'],
threshold: 3
},
{
name: 'data_model',
indicators: ['schema', 'model', 'type', 'required', 'default'],
threshold: 3
},
{
name: 'api_endpoint',
indicators: ['fetch', 'axios', 'response', 'data', 'headers'],
threshold: 3
}
];
}
module.exports = getTemplatePatterns;