NAME

Test::CPAN::Health::Check::AbandonedDeps - Check for dependencies with no recent releases

SYNOPSIS

use Test::CPAN::Health::Check::AbandonedDeps;

my $check  = Test::CPAN::Health::Check::AbandonedDeps->new;
my $result = $check->run($dist);

DESCRIPTION

Queries MetaCPAN to find the date of the latest release for each runtime dependency. A dependency is flagged as potentially abandoned when its most recent release is older than ABANDONED_YEARS (currently 3 years).

Perl core modules and lowercase pragmas are excluded from analysis.

Score = (active_deps / total_checked) * 100. Status thresholds: pass ≥ 80, warn ≥ 60, fail otherwise.

LIMITATIONS

  • An old module that is stable and needs no updates would also be flagged. The signal is potentially abandoned, not definitively so.

  • MetaCPAN is queried serially for each dependency.

  • The date threshold is computed against the current system clock.

new

Construct an AbandonedDeps check. Accepts all base-class parameters plus an optional ignore arrayref of module names to exclude from the check.

run

PURPOSE

Check each runtime dependency's latest release date and flag those that have not had a release in the past ABANDONED_YEARS years.

API SPECIFICATION

INPUT

dist     Test::CPAN::Health::Distribution  required
context  Hashref                           optional

OUTPUT

Test::CPAN::Health::Result with check_id 'abandoned_deps'.

MESSAGES

Code  | Severity | Message                                   | Resolution
------+----------+-------------------------------------------+-----------
AD001 | SKIP     | Network checks disabled                   | Remove --no-network
AD002 | SKIP     | No META file found                        | Add META.yml / META.json
AD003 | SKIP     | No checkable runtime dependencies         | n/a
AD004 | PASS     | All N dependencies are actively maintained|
AD005 | WARN     | N of M dependencies may be abandoned      | Find alternatives
AD006 | FAIL     | N of M dependencies may be abandoned      | Find alternatives

FORMAL SPECIFICATION

-- Z schema (placeholder) --
AbandonedDepsOp
abandoned : N
total     : N
score     : 0..100
-------------------------------------------------------
no_network    => status = skip
meta = undef  => status = skip
total = 0     => status = skip
score >= 80   => status = pass
score >= 60   => status = warn
score < 60    => status = fail

SIDE EFFECTS

Makes one HTTPS GET request to fastapi.metacpan.org per dependency.

USAGE EXAMPLE

my $result = Test::CPAN::Health::Check::AbandonedDeps->new->run($dist);
printf "Abandoned: %s\n", $result->summary;

AUTHOR

Nigel Horne, <njh at nigelhorne.com>

LICENSE AND COPYRIGHT

Copyright (C) 2026 Nigel Horne.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.