Skip to content

mcp-tool-shop-org/CodeClone-Desktop

日本語 | 中文 | Español | Français | हिन्दी | Italiano | Português (BR)

CodeClone Desktop

CI NuGet MIT License Landing Page

A MAUI desktop viewer that turns raw code-clone analysis into severity-scored insights, trend snapshots, and prioritized action items — so you know what to fix and why it matters.


Why CodeClone?

  • Answers "So what?" — Most duplication tools dump a wall of diagnostics. CodeClone Desktop translates findings into human-readable risk scores, trend lines, and plain-English recommendations.
  • Tracks progress over time — Every analysis creates a point-in-time snapshot tagged with the git commit and branch, so you can prove that cleanup efforts are actually working.
  • Prioritizes ruthlessly — The Insight Engine scores every hotspot by impact, surfaces the top action items, and explains why each one matters in terms of maintenance cost.
  • Stays local — No cloud accounts, no telemetry. All snapshots are stored in %LOCALAPPDATA%\CodeClone-Desktop\snapshots. Your code never leaves your machine.
  • AOT-ready domain libraryCodeClone.Domain uses source-generated JSON serialization, so it works in ahead-of-time compiled apps and trimmed deployments.

NuGet Packages

Package Version Description
CodeClone.Domain NuGet Domain models for code clone analysis — parse results, diagnostics, severity-scored insights, trend snapshots, risk scoring, and dashboard metrics. AOT-ready with source-generated JSON.

Install

dotnet add package CodeClone.Domain

Quick Start

Using the Desktop App

  1. Download the latest release from Releases.
  2. Launch CodeClone Desktop.
  3. Click Open Repo and select a repository folder.
  4. Click Assess Risk to run the analysis.
  5. Explore the Insights dashboard for risk scores, metrics, and action items, or switch to Details to browse diagnostics file-by-file.

Using CodeClone.Domain in Your Own Code

using CodeClone.Domain;

// Parse codeclone CLI JSON output
var json = File.ReadAllText("codeclone-output.json");
var response = AnalyzeResponseParser.Parse(json);

Console.WriteLine($"Status: {response.Status}");
Console.WriteLine($"Files analyzed: {response.Summary.TotalFilesAnalyzed}");
Console.WriteLine($"Total diagnostics: {response.Summary.TotalDiagnostics}");

foreach (var diag in response.Diagnostics)
{
    Console.WriteLine($"  [{diag.Severity}] {diag.Code}{diag.Message}");
    if (diag.File is not null)
        Console.WriteLine($"    at {diag.File}:{diag.Line}");
}

Safe parsing with error handling:

if (AnalyzeResponseParser.TryParse(json, out var result, out var error))
{
    // Use result
}
else
{
    Console.Error.WriteLine($"Parse failed: {error}");
}

Features

Insight Dashboard

Feature Description
Risk Score 0–100 weighted score calculated from diagnostic volume, hotspot concentration, and analysis coverage. Color-coded by severity level (Low / Medium / High / Critical).
Score Explainer Drill into the individual factors, their weights, and how each contributes to the total score.
Headline Insight Plain-English summary that answers "How healthy is this codebase?" with context on why it matters.
Dashboard Metrics At-a-glance cards: duplication %, hotspot count, affected files, and affected lines.
Trend Tracking Automatic before/after comparison when a previous snapshot exists. Shows score delta, new/resolved hotspots, and the main contributor to change.

Analysis Details

Feature Description
File Tree Browse the repository with per-file diagnostic counts overlaid on the tree.
Code Viewer View source files with uncovered lines highlighted and inline diagnostic markers.
Diagnostics List Filterable list of all findings with severity icons, codes, messages, and file locations.
Hotspot Ranking Top 10 files ranked by issue density and uncovered-line count, with severity badges.

Action Items

Feature Description
Prioritized Recommendations Top issues ranked by impact score, each with a problem statement, recommended fix, and plain-English explanation of consequences.
Priority Levels Critical / High / Medium / Low — derived from hotspot severity and diagnostic density.
Click-to-Navigate Select any action item, hotspot, or diagnostic to jump directly to the relevant source file.

Snapshots

Feature Description
Git-Tagged Snapshots Every analysis captures commit hash and branch name alongside the full results.
Local Storage Snapshots stored in %LOCALAPPDATA%\CodeClone-Desktop\snapshots, organized by repo.
History View all historical snapshots for any repository.
Comparison Engine Compares any two snapshots to surface improving, worsening, or stable trends.

Installation

From a Release (Recommended)

  1. Go to Releases.
  2. Download the latest .zip or .msix package.
  3. Extract and run CodeClone.App.exe.

Prerequisites:

From Source

# Prerequisites
#   - .NET 9.0 SDK
#   - Visual Studio 2022 (17.x) with the .NET MAUI workload
#   - Windows 10 version 1809+

git clone https://github.com/mcp-tool-shop-org/CodeClone-Desktop.git
cd CodeClone-Desktop

# Restore and build
dotnet restore
dotnet build src/CodeClone.App/CodeClone.App.csproj -c Debug

# Or open CodeClone-Desktop.sln in Visual Studio and build from there
# (recommended — avoids MrtCore PRI post-build issues in CLI builds)

Note: The MAUI app project targets net9.0-windows10.0.19041.0. CLI dotnet build may hit MSB4062 (MrtCore PriGen) on the App project — this is a known CLI-only issue. Visual Studio builds work without problems.

NuGet Package Only

If you only need the domain models (no UI):

dotnet add package CodeClone.Domain

Project Structure

CodeClone-Desktop/
├── CodeClone-Desktop.sln          # Solution file
├── logo.png                        # Project logo
├── LICENSE                         # MIT license
├── README.md
├── .github/
│   └── workflows/
│       └── publish.yml             # NuGet publish on release
└── src/
    ├── CodeClone.Domain/           # Domain models & JSON parsing (NuGet package)
    │   ├── AnalyzeResponse.cs      #   Top-level response model
    │   ├── AnalyzeResponseParser.cs#   JSON parser with Parse() and TryParse()
    │   ├── AnalyzeSummary.cs       #   Summary stats and truncation info
    │   ├── Diagnostic.cs           #   Individual findings with severity and location
    │   ├── Insight.cs              #   Insights, action items, dashboard metrics, trends
    │   ├── Snapshot.cs             #   Point-in-time snapshots, risk scores, hotspots
    │   └── CodeCloneJsonContext.cs #   Source-generated JSON context (AOT-ready)
    └── CodeClone.App/              # MAUI desktop application
        ├── Services/
        │   ├── CodeCloneService.cs #   CLI invocation and result parsing
        │   ├── InsightEngine.cs    #   "So What?" layer — insights, metrics, actions
        │   └── SnapshotService.cs  #   Local snapshot storage, comparison, git metadata
        ├── ViewModels/
        │   ├── MainViewModel.cs    #   Primary view model (dashboard + details)
        │   ├── ActionItemViewModel.cs
        │   ├── ScoreFactorViewModel.cs
        │   ├── HotspotItem.cs
        │   ├── DiagnosticItem.cs
        │   ├── FileTreeItem.cs
        │   └── CodeLine.cs
        ├── Converters/
        │   └── InvertBoolConverter.cs
        ├── MainPage.xaml           #   Main UI layout
        └── MauiProgram.cs          #   App entry point and DI setup

Domain Model Overview

The CodeClone.Domain package exposes the following key types:

Type Purpose
AnalyzeResponse Top-level result: status, repo root, summary, diagnostics, timestamp
AnalyzeSummary Aggregate stats: total diagnostics, files analyzed, breakdown by code
Diagnostic Individual finding: code, severity, message, file location, evidence, suggestions
Snapshot Point-in-time capture: git metadata, risk score, hotspots, full diagnostics
RiskScore Weighted 0–100 score with contributing factors and risk level
Hotspot File-level concentration metric: diagnostic count, uncovered lines, severity
Insight Human-readable headline with context and "why it matters" explanation
ActionItem Prioritized recommendation with impact score and fix guidance
DashboardMetrics Duplication %, hotspot count, affected files/lines, optional trend summary
AnalyzeResponseParser Static Parse() / TryParse() methods for codeclone CLI JSON output

All models are immutable records with System.Text.Json source generation for AOT compatibility.


Tech Stack

Layer Technology
UI Framework .NET MAUI (Windows target)
Runtime .NET 9.0
MVVM CommunityToolkit.Mvvm 8.4
UI Toolkit CommunityToolkit.Maui 10.0
Serialization System.Text.Json with source generation
Platform Windows 10 (1809+)

License

MIT License — See LICENSE for details.

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •