| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Perl::Metrics::Lite; |
|
2
|
4
|
|
|
4
|
|
268851
|
use strict; |
|
|
4
|
|
|
|
|
30
|
|
|
|
4
|
|
|
|
|
123
|
|
|
3
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
|
4
|
|
|
|
|
11
|
|
|
|
4
|
|
|
|
|
104
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
4
|
|
|
4
|
|
1730
|
use Perl::Metrics::Lite::FileFinder; |
|
|
4
|
|
|
|
|
11
|
|
|
|
4
|
|
|
|
|
154
|
|
|
6
|
4
|
|
|
4
|
|
2059
|
use Perl::Metrics::Lite::Report::Text; |
|
|
4
|
|
|
|
|
14
|
|
|
|
4
|
|
|
|
|
193
|
|
|
7
|
4
|
|
|
4
|
|
1851
|
use Perl::Metrics::Lite::Analysis; |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
133
|
|
|
8
|
4
|
|
|
4
|
|
1794
|
use Perl::Metrics::Lite::Analysis::File; |
|
|
4
|
|
|
|
|
16
|
|
|
|
4
|
|
|
|
|
1220
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = "0.092"; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
|
13
|
3
|
|
|
3
|
1
|
5952
|
my ( $class, %args ) = @_; |
|
14
|
3
|
|
|
|
|
9
|
my $self = bless( {}, $class ); |
|
15
|
|
|
|
|
|
|
my $report_module |
|
16
|
|
|
|
|
|
|
= exists $args{report_module} |
|
17
|
|
|
|
|
|
|
? $args{report_module} |
|
18
|
3
|
50
|
|
|
|
32
|
: Perl::Metrics::Lite::Report::Text->new; |
|
19
|
3
|
|
|
|
|
10
|
$self->{report_module} = $report_module; |
|
20
|
3
|
|
|
|
|
52
|
return $self; |
|
21
|
|
|
|
|
|
|
} |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub analyze_files { |
|
24
|
5
|
|
|
5
|
1
|
1929
|
my ( $self, @dirs_and_files ) = @_; |
|
25
|
5
|
|
|
|
|
13
|
my @results = (); |
|
26
|
5
|
|
|
|
|
15
|
my @objects = grep { ref $_ } @dirs_and_files; |
|
|
5
|
|
|
|
|
50
|
|
|
27
|
5
|
|
|
|
|
33
|
@dirs_and_files = grep { not ref $_ } @dirs_and_files; |
|
|
5
|
|
|
|
|
18
|
|
|
28
|
5
|
|
|
|
|
50
|
my $perl_file_finder = Perl::Metrics::Lite::FileFinder->new; |
|
29
|
5
|
50
|
|
|
|
16
|
foreach my $file ( |
|
30
|
|
|
|
|
|
|
( scalar(@dirs_and_files) |
|
31
|
5
|
|
|
|
|
22
|
? @{ $perl_file_finder->find_files(@dirs_and_files) } |
|
32
|
|
|
|
|
|
|
: () |
|
33
|
|
|
|
|
|
|
), |
|
34
|
|
|
|
|
|
|
@objects |
|
35
|
|
|
|
|
|
|
) |
|
36
|
|
|
|
|
|
|
{ |
|
37
|
13
|
|
|
|
|
110
|
my $file_analysis |
|
38
|
|
|
|
|
|
|
= Perl::Metrics::Lite::Analysis::File->new( path => $file ); |
|
39
|
13
|
|
|
|
|
49
|
push @results, $file_analysis; |
|
40
|
|
|
|
|
|
|
} |
|
41
|
5
|
|
|
|
|
52
|
my $analysis = Perl::Metrics::Lite::Analysis->new( \@results ); |
|
42
|
5
|
|
|
|
|
40
|
return $analysis; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub report { |
|
46
|
0
|
|
|
0
|
0
|
|
my ( $self, $analysis ) = @_; |
|
47
|
0
|
|
|
|
|
|
my $report_module = $self->{report_module}; |
|
48
|
0
|
|
|
|
|
|
$report_module->report($analysis); |
|
49
|
|
|
|
|
|
|
} |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |