Skip to main content
Back to registry

refactor-method-complexity-reduce

github/awesome-copilot

Refactor the method ${input:methodName} , to reduce its cognitive complexity to ${input:complexityThreshold} or below, by extracting logic into focused helper methods.

Installs7
Install command
npx skills add https://github.com/github/awesome-copilot --skill refactor-method-complexity-reduce
Security audits
Gen Agent Trust HubPASS
SocketPASS
SnykPASS
About this skill
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 : Simplify the main method : Preserve functionality : Best practices : The refactored method should: CRITICAL: After completing the refactoring, you MUST: - Analyze the current method to identify sources of cognitive complexity: - Nested conditional statements - Multiple if-else or switch chains - Repeated code blocks - Multiple loops with conditions - Complex boolean expressions - Identify extraction opportunities : - Validation logic that can be extracted into a separate method - Type-specific or case-specific processing that repeats - Complex transformations or calculations - Common patterns that appear multiple times - Extract focused helper methods : - Each helper should have a single, clear responsibility - Extract validation into separate Validate* methods - Extract type-specific logic into handler methods - Create utility methods for common operations - Use appropriate access levels (static, private, async) - Simplify the main method : - Reduce nesting depth - Replace massive if-else chains with smaller orchestrated calls - Use switch statements where appropriate for...

Source description provided by the upstream skill listing. Community reviews and install context appear in the sections below.

Community Reviews

Latest reviews

Sign in to review

No community reviews yet. Be the first to review.

Browse this skill in context
FAQ
What does refactor-method-complexity-reduce do?

Refactor the method ${input:methodName} , to reduce its cognitive complexity to ${input:complexityThreshold} or below, by extracting logic into focused helper methods.

Is refactor-method-complexity-reduce good?

refactor-method-complexity-reduce does not have approved reviews yet, so SkillJury cannot publish a community verdict.

What agent does refactor-method-complexity-reduce work with?

refactor-method-complexity-reduce currently lists compatibility with Agent compatibility has not been published yet..

What are alternatives to refactor-method-complexity-reduce?

Skills in the same category include telegram-bot-builder, flutter-app-size, sharp-edges, iterative-retrieval.

How do I install refactor-method-complexity-reduce?

npx skills add https://github.com/github/awesome-copilot --skill refactor-method-complexity-reduce

Related skills

More from github/awesome-copilot

Related skills

Alternatives in Software Engineering