line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Audit::Discover::CpanfileSnapshot; |
2
|
2
|
|
|
2
|
|
16
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
62
|
|
3
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
50
|
|
4
|
2
|
|
|
2
|
|
936
|
use CPAN::DistnameInfo; |
|
2
|
|
|
|
|
1967
|
|
|
2
|
|
|
|
|
425
|
|
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; |