line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Audit::Discover::Cpanfile; |
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
558
|
use Module::CPANfile; |
|
1
|
|
|
|
|
14032
|
|
|
1
|
|
|
|
|
205
|
|
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; |