Skip to content
Skills Library
Programming · Analysis

refactoring

/refactoring

Find refactoring targets in JavaScript/TypeScript, Go, Rust, or C++ code using polyscan - duplicate code (clones), overly complex functions, and dead code. Use when user asks about refactoring, code duplication, complexity hotspots, unreachable code, or cleaning up a codebase.

Repository
polyscan ↗
Licence
MIT
Last repository change
19.10.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 19.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Find refactoring targets in JavaScript/TypeScript, Go, Rust, or C++ code using polyscan - duplicate code (clones), overly complex functions, and dead code. Use when user asks about refactoring, code duplication, complexity hotspots, unreachable code, or cleaning up a codebase.

Original author description

Find refactoring targets in JavaScript/TypeScript, Go, Rust, or C++ code using polyscan - duplicate code (clones), overly complex functions, and dead code. Use when user asks about refactoring, code duplication, complexity hotspots, unreachable code, or cleaning up a codebase.

How it works

  1. Commands
  2. Interpreting Results
  3. Prioritizing Findings
Original SKILL.md headings · 32 lines, 281 words
SKILL.md preview
---
name: refactoring
description: Find refactoring targets in JavaScript/TypeScript, Go, Rust, or C++ code using polyscan - duplicate code (clones), overly complex functions, and dead code. Use when user asks about refactoring, code duplication, complexity hotspots, unreachable code, or cleaning up a codebase.
---

# Refactoring Analysis with polyscan

Run the polyscan CLI to locate concrete refactoring targets in JavaScript, TypeScript, Go, Rust and C++ code. No install needed: `npx polyscan@latest analyze <path>`.

## Commands

| User Request | Command |
|-------------|---------|
| "Find complex functions" | `npx polyscan@latest analyze --format text --select complexity <path>` |
| "Find duplicate code" | `npx polyscan@latest analyze --format text --select clone <path>` |
| "Find dead code" (JS/TS only) | `npx polyscan@latest analyze --format text --select deadcode <path>` |
| "What should I refactor first?" | `npx polyscan@latest analyze --format text --select complexity,deadcode,clone <path>` |

Use `--format json` instead of `--format text` for line-level findings in machine-readable form (written to stdout). Without either, polyscan writes an HTML report and opens a browser.

Complexity and clone detection cover every supported language; dead code detection exists for JavaScript/TypeScript only.

## Interpreting Results

- Complexity risk levels (defaults, configurable in `.polyscan.toml`): Low (≤9), Medium (10-19), High (20+). For JavaScript/TypeScript, complexity counts branches plus logical operators (`&&`, `||`, `??`) and ternaries.
- Dead code severity (JS/TS): critical means code after return/break/continue/throw that can never execute; warning covers unreachable branches, unused imports, and orphan files; info covers unused exports.
- Clone types: Type-1 (identical), Type-2 (renamed identifiers/literals), Type-3 (modified, disabled by default), Type-4 (functionally similar), each with a similarity score.

## Prioritizing Findings

1. Critical dead code: safe deletions, do these first.
2. High-complexity functions (20+): extract functions, flatten conditionals.
3. Clone groups spanning multiple files: extract shared helpers; clones within one file are usually quicker wins.

When suggesting a refactor, cite the specific function names, files, and line ranges from the results, and re-run the same command afterward to confirm the improvement.

Versions

RepositoryScoreLicence
This page · ludo-technologies/polyscan90MIT
gabrieldulolmarques/refactoring-skill100CC-BY-4.0
4typen/skills100MIT
t8jwscc7qy-sketch/foma-skills100Apache-2.0
mtwuser/zero-cloud-gravity100MIT
krzysztofsurdy/code-virtuoso100MIT
sagargupta16/claude-skills100MIT
nimadorostkar/Claude-Skills-collection100MIT
DariuszDusza/agentic-workflow-foundry100Apache-2.0

Database snapshot: 13.11.2026 · package version bc5212132b83 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100cli-analysis
    Run the polyscan command-line tool for code quality analysis of JavaScript/TypeScript, Go, Rust, and C++ - CI quality gates, HTML/JSON/text reports, and project configuration. Use when user wants a CI check, a shareable report file, machine-readable results, or to configure polyscan for a project.
  • 100health-check
    Get an overall code quality health score for JavaScript/TypeScript, Go, Rust, or C++ using polyscan. Use when user asks how healthy or good the code is, wants a quality overview, a grade, a summary of technical debt, or a before/after quality comparison.
  • 95dog-food
    Measure and reduce function complexity or duplication with the dog-food CLI (`dgf`) for C#, TypeScript/JavaScript and Rust. Use when asked about code complexity, copied code, CRAP scores, refactoring hotspots, or whether a change made code harder to maintain; when a repo has a…
  • 90refactor
    Use when refactoring, cleaning up code, reducing complexity, fixing code smells, or improving code quality. Audits code for dead code, nesting, and patterns.
  • 90bb-code-audit
    Use when asked for dead code, anti-patterns, security exposure or complexity hotspots in an indexed repository — bb_patterns, bb_security, bb_analyze.
  • 100find-complexity
    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.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.