line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Audit::Discover::Cpanfile; |
2
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
63
|
|
3
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
47
|
|
4
|
2
|
|
|
2
|
|
1045
|
use Module::CPANfile; |
|
2
|
|
|
|
|
29188
|
|
|
2
|
|
|
|
|
454
|
|
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_path) = @_; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my $cpanfile = Module::CPANfile->load($cpanfile_path); |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my $prereqs = $cpanfile->prereqs->as_string_hash; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my @deps; |
26
|
0
|
|
|
|
|
|
foreach my $phase ( keys %$prereqs ) { |
27
|
0
|
|
|
|
|
|
foreach my $type ( keys %{ $prereqs->{$phase} } ) { |
|
0
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
foreach my $module ( keys %{ $prereqs->{$phase}->{$type} } ) { |
|
0
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $version = $prereqs->{$phase}->{$type}->{$module}; |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
next if $module eq 'perl'; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
push @deps, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
module => $module, |
36
|
|
|
|
|
|
|
version => $version, |
37
|
|
|
|
|
|
|
}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
return @deps; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |