Perl/Metrics2/CpanFile.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran n/a Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 34 CC 1 SCAR 6.9
CC
1
Cov
0%
release_index
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Perl::Metrics2::CpanFile;
2  
3 use strict;
4 use Perl::Metrics2 ();
5  
6 our $VERSION = '0.06';
7  
8 sub release_index {
9 my $dbh = Perl::Metrics2->dbh or return;
10 my $sth = $dbh->prepare('SELECT DISTINCT release FROM cpan_file', {}) or return;
11 $sth->execute or return;
12 my %hash = ();
13 my $value = undef;
14 $sth->bind_col(1, \$value) or return;
15 while ( $sth->fetch ) {
16 my $one = substr($_, 0, 1);
17 my $two = substr($_, 0, 2);
18 $hash{"$one/$two/$_"} = 1;
19 }
20 return \%hash;
21 }
22  
23 1;