reduce-complexity

Refactor React components to reduce cognitive complexity using ESLint.

3|3|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/CodySwannGT/lisa --skill reduce-complexity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reduce-complexity
Source: https://github.com/CodySwannGT/lisa/tree/main/plugins/lisa-expo/skills/reduce-complexity
Command: npx skills add https://github.com/CodySwannGT/lisa --skill reduce-complexity

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill tackles the challenge of overly complex React components, making your codebase more readable, maintainable, and performant by providing strategies to reduce cognitive complexity.

Core Features & Use Cases

  • Identify Complexity: Pinpoints sources of high cognitive complexity in React components using ESLint.
  • Refactoring Strategies: Offers clear decision frameworks for extracting code into helper functions or new Container/View components.
  • Use Case: When your UserProfileCard.tsx component exceeds 200 lines and ESLint flags it for high cognitive complexity, use this Skill to guide you in breaking it down into smaller, manageable pieces.

Quick Start

Use the reduce-complexity skill to refactor the UserProfileCard component.

Frequently Asked Questions about reduce-complexity

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce cognitive complexity in React components?

To reduce cognitive complexity in React components, you can apply refactoring strategies like extracting code into helper functions or splitting large files using the Container/View pattern to resolve ESLint violations and improve maintainability.

How do I fix sonarjs/cognitive-complexity ESLint violations in React?

Fix sonarjs/cognitive-complexity ESLint violations by refactoring large React View components into smaller, manageable pieces according to the Container/View pattern and enforcing project-specific component extraction requirements.

What is the best way to refactor a large React component?

The best way to refactor a large React component is to use a clear decision framework for extracting code into helper functions or new Container/View components, addressing high cognitive complexity and enforcing project-specific extraction requirements.

When should I split a React component into Container and View components?

You should split a React component into Container and View components when the file exceeds manageable line counts and ESLint flags it for high cognitive complexity, making the codebase harder to read and maintain.

Does this refactoring approach require ESLint to identify React complexity?

Yes, this refactoring approach uses ESLint to pinpoint sources of high cognitive complexity in React components, providing clear decision frameworks to extract code into helper functions or new Container/View components.

Can I enforce project-specific component extraction requirements during refactoring?

Yes, you can enforce project-specific component extraction requirements during refactoring by applying decision frameworks that break down large React components into helper functions or Container/View patterns to reduce cognitive complexity.