AlignDiff Open AlignDiff

Moved-code comparison

Compare reordered code without treating every move as a rewrite

When a function changes position, a raw line diff can make unchanged behaviour look deleted and re-added. AlignDiff searches for the related structure before presenting its line-level edits.

AlignDiff marketing preview showing structure-aware code comparison
AlignDiff public beta · Python, JavaScript, and TypeScript · source stays in the browser

Minimal input fixture

The function moves; its behaviour does not

These are labelled input excerpts, not simulated comparator output.

Before: pricing_before.py

def calculate_tax(total):
    return total * 0.18


def format_total(total):
    return f"₹{total:.2f}"

After: pricing_after.py

def format_total(total):
    return f"₹{total:.2f}"


def calculate_tax(total):
    return total * 0.18
Review question: did calculate_tax change, or did it only move? Structural pairing lets the reviewer answer that directly.

How AlignDiff handles movement

Pair first, then inspect the details

  1. 1

    Parse supported structures

    Functions, classes, methods, and other supported entities are collected from both files.

  2. 2

    Propose counterparts

    Name, structure, content, and source context contribute to automatic pairing.

  3. 3

    Label movement separately

    A paired block can be marked moved, modified, renamed, or a combination instead of becoming unrelated deletion and insertion noise.

Actual AlignDiff aligned view showing reordered Python functions paired across old and new files
The checkout example includes a moved-and-modified function and a renamed helper, shown in their paired lanes.

Reviewer guidance

Movement is a signal, not proof

A moved label helps focus the review, but the detailed rows still matter. Check changed calls, return expressions, parameters, and newly inserted statements before accepting the refactor.

When several functions are similar, inspect the pairing reasons and use manual pairing rather than assuming the first automatic match is correct.