Refactor given method `${input:methodName}` to reduce its cognitive complexity to `${input:complexityThreshold}` or below, by extracting helper methods.
Refactor the method ${input:methodName}, to reduce its cognitive complexity to ${input:complexityThreshold} or below, by extracting logic into focused helper methods.
Analyze the current method to identify sources of cognitive complexity:
Identify extraction opportunities:
Extract focused helper methods:
Validate* methodsSimplify the main method:
Preserve functionality:
Best practices:
The refactored method should:
${input:complexityThreshold} or belowCRITICAL: After completing the refactoring, you MUST:
${input:complexityThreshold}${input:complexityThreshold}