NAME

Claude::Agent::Code::Refactor::Result - Result of a refactoring operation

SYNOPSIS

my $result = Claude::Agent::Code::Refactor::Result->new(
    success         => 1,
    iterations      => 3,
    initial_issues  => 15,
    final_issues    => 0,
    fixes_applied   => 15,
    files_modified  => ['lib/Foo.pm', 'lib/Bar.pm'],
    history         => [...],
    duration_ms     => 45000,
);

if ($result->is_clean) {
    print "All issues resolved!\n";
}

DESCRIPTION

Represents the result of a refactoring operation, including success status, iteration history, and statistics.

ATTRIBUTES

  • success - True if all issues were resolved

  • iterations - Number of review-fix cycles completed

  • initial_issues - Number of issues found in first review

  • final_issues - Number of issues remaining after refactoring

  • fixes_applied - Total number of fixes applied

  • files_modified - ArrayRef of files that were modified

  • history - ArrayRef of per-iteration details

  • final_report - The last Code::Review report object

  • duration_ms - Total duration in milliseconds

  • error - Error message if refactoring failed

METHODS

is_clean

Returns true if no issues remain after refactoring.

has_error

Returns true if an error occurred during refactoring.

issues_fixed

Returns the number of issues that were fixed.

fix_rate

Returns the percentage of issues that were fixed (0-100).

add_iteration

Adds an iteration record to the history.

$result->add_iteration(
    issues_found => 5,
    issues_fixed => 3,
    files_modified => ['lib/Foo.pm'],
);

as_text

Returns a human-readable summary of the result.

to_hash

Returns a hashref representation of the result.

AUTHOR

LNATION, <email at lnation.org>

LICENSE

This software is Copyright (c) 2026 by LNATION.

This is free software, licensed under The Artistic License 2.0 (GPL Compatible).