line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Metrics::Lite; |
2
|
4
|
|
|
4
|
|
4404
|
use strict; |
|
4
|
|
|
|
|
15
|
|
|
4
|
|
|
|
|
114
|
|
3
|
4
|
|
|
4
|
|
19
|
use warnings; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
159
|
|
4
|
|
|
|
|
|
|
|
5
|
4
|
|
|
4
|
|
1720
|
use Perl::Metrics::Lite::FileFinder; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
129
|
|
6
|
4
|
|
|
4
|
|
1806
|
use Perl::Metrics::Lite::Report::Text; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
130
|
|
7
|
4
|
|
|
4
|
|
1755
|
use Perl::Metrics::Lite::Analysis; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
122
|
|
8
|
4
|
|
|
4
|
|
1776
|
use Perl::Metrics::Lite::Analysis::File; |
|
4
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
1227
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.091'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
3
|
|
|
3
|
1
|
377
|
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
|
|
|
|
31
|
: Perl::Metrics::Lite::Report::Text->new; |
19
|
3
|
|
|
|
|
11
|
$self->{report_module} = $report_module; |
20
|
3
|
|
|
|
|
10
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub analyze_files { |
24
|
5
|
|
|
5
|
1
|
1056
|
my ( $self, @dirs_and_files ) = @_; |
25
|
5
|
|
|
|
|
22
|
my @results = (); |
26
|
5
|
|
|
|
|
13
|
my @objects = grep { ref $_ } @dirs_and_files; |
|
5
|
|
|
|
|
18
|
|
27
|
5
|
|
|
|
|
11
|
@dirs_and_files = grep { not ref $_ } @dirs_and_files; |
|
5
|
|
|
|
|
16
|
|
28
|
5
|
|
|
|
|
51
|
my $perl_file_finder = Perl::Metrics::Lite::FileFinder->new; |
29
|
5
|
50
|
|
|
|
14
|
foreach my $file ( |
30
|
|
|
|
|
|
|
( scalar(@dirs_and_files) |
31
|
5
|
|
|
|
|
19
|
? @{ $perl_file_finder->find_files(@dirs_and_files) } |
32
|
|
|
|
|
|
|
: () |
33
|
|
|
|
|
|
|
), |
34
|
|
|
|
|
|
|
@objects |
35
|
|
|
|
|
|
|
) |
36
|
|
|
|
|
|
|
{ |
37
|
13
|
|
|
|
|
143
|
my $file_analysis |
38
|
|
|
|
|
|
|
= Perl::Metrics::Lite::Analysis::File->new( path => $file ); |
39
|
13
|
|
|
|
|
54
|
push @results, $file_analysis; |
40
|
|
|
|
|
|
|
} |
41
|
5
|
|
|
|
|
57
|
my $analysis = Perl::Metrics::Lite::Analysis->new( \@results ); |
42
|
5
|
|
|
|
|
38
|
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__ |