find-complexity
/find-complexity
Wyszukuje funkcje i metody o wysokiej złożoności cyklomatycznej, nadmiernej długości lub zbyt wielu parametrach jako kandydatów do refaktoryzacji.
- Autor
- openshift ↗
- Repozytorium
- lightspeed-service ↗
- Licencja
- Apache-2.0
- Ostatnia zmiana repozytorium
- 26.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
Co robi i kiedy
Wyszukuje funkcje i metody o wysokiej złożoności cyklomatycznej, nadmiernej długości lub zbyt wielu parametrach jako kandydatów do refaktoryzacji.
Oryginalny opis (EN)
Find functions and methods with high cyclomatic complexity, excessive length, or too many parameters. Use when the user asks to find complex code, complexity hotspots, refactoring candidates, or wants to improve code maintainability.
Jak działa
- Rules
- Step 1: Determine Scope
- Step 2: Cyclomatic Complexity
- Step 3: Maintainability Index
- Step 4: Cognitive Complexity
- Step 5: Function Length
- Step 6: File Size
- Step 7: Classify Findings
- Step 8: Report
Podgląd SKILL.md
--- name: find-complexity description: Find functions and methods with high cyclomatic complexity, excessive length, or too many parameters. Use when the user asks to find complex code, complexity hotspots, refactoring candidates, or wants to improve code maintainability. disable-model-invocation: true --- # Find Complexity Hotspots Identify functions that are hard to review, test, and maintain. ## Rules - Report findings, do not refactor. Refactoring is a separate task. - Focus on production code (`ols/`). Skip tests unless explicitly asked. - Rank by severity: highest complexity first. ## Step 1: Determine Scope Ask the user: - **Branch mode**: only files changed in the current branch vs main. - **Full mode**: scan the entire `ols/` directory. For branch mode: ```bash git diff --name-only origin/main -- 'ols/' | grep '\.py$' ``` ## Step 2: Cyclomatic Complexity ```bash uvx radon cc <target> -s -n C -a ``` This shows functions with complexity grade C or worse (threshold: 11+). Grades: A (1-5), B (6-10), C (11-15), D (16-20), E (21-25), F (26+). ## Step 3: Maintainability Index ```bash uvx radon mi <target> -s -n B ``` This shows files with maintainability grade B or worse. Grades: A (20+, good), B (10-19, medium), C (0-9, poor). ## Step 4: Cognitive Complexity Cognitive complexity weights nesting depth — a 5-deep `if` scores much higher than 5 sequential `if`s. ```bash uvx --with flake8-cognitive-complexity flake8 --select=CCR001 --max-cognitive-complexity=10 <target> ``` ## Step 5: Function Length Find long functions (30+ lines of logic, excluding docstrings and blank lines): ```bash uvx radon raw <target> -s ``` Also use pylint for method length: ```bash uv run pylint --disable=all --enable=too-many-statements,too-many-branches,too-many-return-statements,too-many-arguments,too-many-locals <target> ``` ## Step 6: File Size Find large files (500+ lines): ```bash wc -l $(find <target> -name '*.py') | sort -rn | head -20 ``` Files over 500 lines are candidates for splitting into focused modules. ## Step 7: Classify Findings For each function found, classify: | Category | Criteria | Action | |----------|----------|--------| | **Split** | High complexity + long body | Break into smaller functions | | **Simplify** | High complexity + short body | Reduce branching (early returns, lookup tables) | | **Parameterize** | Too many arguments (6+) | Group into config/dataclass | | **Monitor** | Grade C, not growing | Note it, revisit if it gets worse | | **Split file** | File over 500 lines | Break into focused modules | ## Step 8: Report For each finding: 1. File, function name, line number 2. Complexity grade and score 3. Number of statements / arguments 4. Classification (split / simplify / parameterize / monitor) 5. Brief suggestion Summary: total hotspots by grade, top 5 worst offenders.
Wersje
W bazie nie ma innych skilli o nazwie find-complexity.
Migawka bazy z 28.10.2026 · wersja paczki d0b08694e073 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100code-complexity-scanner
Mierzy złożoność cyklomatyczną i kognitywną oraz długość funkcji w bazie kodu, by wskazać hotspoty utrzymaniowe. - 100complexity
Konfiguruje wbudowane analizatory .NET i metryki kodu, aby znaleźć zbyt złożone metody i silne sprzężenia oraz ustawić progi złożoności cyklomatycznej w CI. - 100complexity-analyzer
Analizuje złożoność cyklomatyczną i kognitywną, wskazując funkcje zbyt złożone i wymagające uproszczenia. - 100code-complexity
Analizuje metryki złożoności kodu: cyklomatyczną, kognitywną, długość funkcji i sprzężenie, by wskazać cele refaktoryzacji i śledzić zdrowie bazy kodu. - 100cyclomatic-complexity
Znajduje najbardziej złożone cyklomatycznie funkcje w kodzie, ranguje je według liczby niezależnych ścieżek za pomocą ast-grep, wskazując kandydatów do refaktoryzacji. - 90code-quality-metrics-standards
Analizuje złożoność kodu i zgodność ze standardami, wskazując zbyt skomplikowane funkcje i wartości odstające.