line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Audit::Discover::CpanfileSnapshot; |
2
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
427
|
use CPAN::DistnameInfo; |
|
1
|
|
|
|
|
945
|
|
|
1
|
|
|
|
|
206
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "1.001"; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
|
my $self = {}; |
12
|
0
|
|
|
|
|
|
bless $self, $class; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
return $self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub discover { |
18
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
19
|
0
|
|
|
|
|
|
my ($cpanfile_snapshot_path) = @_; |
20
|
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
open my $fh, '<', $cpanfile_snapshot_path or die $!; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my @deps; |
24
|
0
|
|
|
|
|
|
while ( defined( my $line = <$fh> ) ) { |
25
|
0
|
0
|
|
|
|
|
if ( $line =~ m/pathname: ([^\s]+)/ ) { |
26
|
0
|
0
|
|
|
|
|
next unless my $d = CPAN::DistnameInfo->new($1); |
27
|
|
|
|
|
|
|
|
28
|
0
|
0
|
0
|
|
|
|
next unless $d->dist && $d->version; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
push @deps, |
31
|
|
|
|
|
|
|
{ |
32
|
|
|
|
|
|
|
dist => $d->dist, |
33
|
|
|
|
|
|
|
version => $d->version, |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
close $fh; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return @deps; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |