inc/Module/Install/Base.pm

filter: Statementstmt 91.1% 31 / 34 Branchbran 50.0% 4 / 8 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 66.6% 12 / 18 Podpod 100% 4 / 4 totaltotal 76.1% 51 / 67 CC 8 SCAR 7.4
CC
8
Cov
80%
new
6.0
new
3.1
new
3.1
CRAP 2.1
« lib/Egg/Request/Upload/CGI.pm ↑ Summary lib/Egg/Plugin/YAML.pm »
1 #line 1
2 package Module::Install::Base;
3 1  
4 $VERSION = '0.71';
5  
6 1 ▶# Suspend handler for "redefined" warnings
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 BEGIN {
8 1 ▶ my $w = $SIG{__WARN__};
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
9 $SIG{__WARN__} = sub { $w };
10 }
11  
12 ### This is the ONLY module that shouldn't have strict on
13 # use strict;
14  
15 #line 41
16  
17 sub new {
18 my ($class, %args) = @_;
19  
20 foreach my $method ( qw(call load) ) {
21 *{"$class\::$method"} = sub {
22 shift()->_top->$method(@_);
23 } unless defined &{"$class\::$method"};
24 }
25  
26 bless( \%args, $class );
27 }
28  
29 #line 61
30  
31 sub AUTOLOAD {
32 my $self = shift;
33 local $@;
34 my $autoload = eval { $self->_top->autoload } or return;
35 goto &$autoload;
36 }
37  
38 #line 76
39  
40 sub _top { $_[0]->{_top} }
41  
42 4 ▶#line 89
Subroutine new: called CC=3 SCAR=11.3
Subroutine new: called CC=3 SCAR=11.3
Pod documented
Pod documented
43 4  
44 sub admin {
45 4 $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new;
46 8 ▶}
Subroutine __ANON__: not called CC=1 SCAR=1.2
Subroutine __ANON__: not called CC=1 SCAR=1.2
47 0  
48 8 ▶sub is_admin {
Branch: 2 branches
BranchTrueFalseTotal
unless defined &{"${class}::$method";} 8 0 8
unless defined &{"${class}::$method";} 50 0 50
49 $_[0]->admin->VERSION;
50 }
51 4  
52 sub DESTROY {}
53  
54 package Module::Install::Base::FakeAdmin;
55  
56 my $Fake;
57 sub new { $Fake ||= bless(\@_, $_[0]) }
58  
59 sub AUTOLOAD {}
60  
61 sub DESTROY {}
62 14 ▶ 
Subroutine AUTOLOAD: called CC=2 SCAR=7.0
63 14 # Restore warning handler
64 14 BEGIN {
65 14 ▶ $SIG{__WARN__} = $SIG{__WARN__}->();
Branch: 1 branch
BranchTrueFalseTotal
my $autoload = eval { do { $self->_top->autoload } } or return 14 0 14
66 14 }
67  
68 1;
69  
70 #line 138
« lib/Egg/Request/Upload/CGI.pm ↑ Summary lib/Egg/Plugin/YAML.pm »