find-duplication

Detect exact and near-duplicate code in the ols/ directory.

71|88|Updated Nov 8, 2023
One-click install
npx skills add https://github.com/openshift/lightspeed-service --skill find-duplication
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: find-duplication
Source: https://github.com/openshift/lightspeed-service/tree/main/.cursor/skills/find-duplication
Command: npx skills add https://github.com/openshift/lightspeed-service --skill find-duplication

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identify duplicated or near-duplicate code across the codebase to help consolidate and reduce technical debt before PRs.

Core Features & Use Cases

  • Detect exact duplicates and near-duplicates in production code, prioritizing by severity.
  • Focus on the ols/ directory and allow scanning scoped to the current branch changes or a full repository sweep.
  • Classify findings and provide guidance on whether extraction is worth it or if duplication is acceptable, to inform refactoring decisions.

Quick Start

Run the duplication finder against the target scope to generate a duplication report.

Frequently Asked Questions about find-duplication

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

FAQPage Schema
How do I detect code duplication before creating a pull request?

Detect code duplication by running a branch-scoped static analysis scan to surface exact and near-duplicate blocks, helping consolidate technical debt before submitting a pull request.

What is the difference between exact and near-duplicate code in refactoring?

Exact and near-duplicate code differ by similarity levels found through static analysis. The tool deterministically classifies these findings to guide whether extraction is necessary or if the duplication is acceptable.

How do I scan my full repository for duplicated code blocks?

Scan your full repository for duplicated code blocks by running a full-repo sweep to identify all duplication scenarios across the production codebase rather than limiting the scan to branch changes.

When should I not extract near-duplicate code during a code review?

Do not extract near-duplicate code when the static analysis classifies the duplication as acceptable, meaning the refactoring overhead outweighs the consolidation benefits for that specific scenario.