Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
53 lines (35 loc) · 1.87 KB

File metadata and controls

53 lines (35 loc) · 1.87 KB
Copy raw file
Download raw file
Outline
Edit and raw actions

🔍 Duplicate Code Detector

For an overview of all available workflows, see the main README.

Automatically identify duplicate code patterns and suggest refactoring opportunities

The Duplicate Code Detector workflow runs regularly (daily by default) to analyze recent code changes and detect duplicate patterns. It creates focused issues (max 3 per run) for significant duplication patterns, automatically assigned to @copilot for potential remediation.

Installation

# Install the 'gh aw' extension
gh extension install github/gh-aw

# Add the workflow to your repository
gh aw add-wizard githubnext/agentics/duplicate-code-detector

This walks you through adding the workflow to your repository.

How It Works

graph LR
    A[Analyze Recent Changes] --> B[Detect Patterns]
    B --> C[Find Duplicates]
    C --> D{Significant?}
    D -->|Yes| E[Create Refactoring Issue]
    D -->|No| F[Report: Code is DRY]
Loading

The workflow reports identical or nearly identical functions, repeated code blocks, similar classes with overlapping functionality, and copy-pasted code. It excludes standard boilerplate, test setup code, config files, and small snippets (<5 lines).

Examples

Based on usage in the gh-aw repository: 79% merge rate (76 merged PRs out of 96 proposed).

Usage

Configuration

The workflow is configured to:

  • Run daily
  • Create max 3 issues per run
  • Auto-expire issues after 2 days if not addressed
  • Skip test files, generated code, and workflow files

After editing run gh aw compile to update the workflow and commit all changes to the default branch.

Learn More

Morty Proxy This is a proxified and sanitized view of the page, visit original site.