agentsqripts
Version:
Comprehensive static code analysis toolkit for identifying technical debt, security vulnerabilities, performance issues, and code quality problems
17 lines (13 loc) • 560 B
JavaScript
/**
* @file Identify the pattern of differences
* @description Single responsibility: Determine the primary difference pattern
*/
function identifyPattern(diffTypes) {
const total = diffTypes.total || 1;
if (diffTypes.stringLiterals / total > 0.5) return 'string_variations';
if (diffTypes.variableNames / total > 0.5) return 'variable_names';
if (diffTypes.numbers / total > 0.5) return 'numeric_values';
if (diffTypes.functionCalls / total > 0.3) return 'different_apis';
return 'mixed_differences';
}
module.exports = identifyPattern;