blib/lib/Moo/HandleMoose/FakeMetaClass.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 10 / 10 Conditioncond 88.8% 8 / 9 MC/DCmcdc 83.3% 5 / 6 Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 3 totaltotal 92.1% 59 / 64 CC 9 SCAR 10.6
CC
9
Cov
98%
isa
5.0
AUTOLOAD
3.0
can
3.0
CRAP 2.9
« blib/lib/Moo/Object.pm ↑ Summary blib/lib/Moo/sification.pm »
1 package Moo::HandleMoose::FakeMetaClass;
2 44 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 44 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 44 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
6 44 ▶BEGIN { our @CARP_NOT = qw(Moo::HandleMoose) }
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶sub DESTROY { }
Subroutine DESTROY: called CC=1 SCAR=0.0
9  
10 69 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: called CC=3 SCAR=11.0
11 69 my ($meth) = (our $AUTOLOAD =~ /([^:]+)$/);
12 69 my $self = shift;
13 69 ▶ Carp::croak "Can't call $meth without object instance"
Branch: 1 branch
BranchTrueFalseTotal
unless ref $self 2 67 69
14 if !ref $self;
15 67 ▶ Carp::croak "Can't inflate Moose metaclass with Moo::sification disabled"
Branch: 1 branch
BranchTrueFalseTotal
if $Moo::sification::disabled 2 65 67
16 if $Moo::sification::disabled;
17 65 require Moo::HandleMoose;
18 65 Moo::HandleMoose::inject_real_metaclass_for($self->{name})->$meth(@_)
19 }
20 20 ▶sub can {
Subroutine can: called CC=3 SCAR=11.0
Pod undocumented
21 20 my $self = shift;
22 20 ▶ return $self->SUPER::can(@_)
Branch: 1 branch
BranchTrueFalseTotal
if not ref $self or $Moo::sification::disabled 4 16 20
Condition100%3/3
not ref $self or $Moo::sification::disabled
l!l&&r!l&&!r
1316
MC/DC100%2/2
not ref $self or $Moo::sification::disabled
not ref $self $Moo::sification::disabled
Truth table100%3/3
not(A) or B
A= not ref $selfB= $Moo::sification::disabled
ABresult
1X1
011
000
23 if !ref $self or $Moo::sification::disabled;
24 16 require Moo::HandleMoose;
25 16 Moo::HandleMoose::inject_real_metaclass_for($self->{name})->can(@_)
26 }
27 46 ▶sub isa {
Subroutine isa: called CC=5 SCAR=16.1
Pod undocumented
28 46 my $self = shift;
29 46 ▶ return $self->SUPER::isa(@_)
Branch: 1 branch
BranchTrueFalseTotal
if not ref $self or $Moo::sification::disabled 2 44 46
Condition100%3/3
not ref $self or $Moo::sification::disabled
l!l&&r!l&&!r
1144
MC/DC100%2/2
not ref $self or $Moo::sification::disabled
not ref $self $Moo::sification::disabled
Truth table100%3/3
not(A) or B
A= not ref $selfB= $Moo::sification::disabled
ABresult
1X1
011
000
30 if !ref $self or $Moo::sification::disabled;
31  
32 # prevent inflation by Devel::StackTrace, which does this check. examining
33 # the stack trace in an exception from inflation could re-trigger inflation
34 # and cause another exception.
35 44 ▶ return !!0
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 and $_[0] eq "Exception::Class::Base" 3 41 44
Condition66%2/3
@_ == 1 and $_[0] eq "Exception::Class::Base"
!ll&&!rl&&r
0413
MC/DC50%1/2
@_ == 1 and $_[0] eq "Exception::Class::Base"
@_ == 1 $_[0] eq "Exception::Class::Base"
Truth table66%2/3
A and B
A= @_ == 1B= $_[0] eq "Exception::Class::Base"
ABresult
0X0
100
111
36 if @_ == 1 && $_[0] eq 'Exception::Class::Base';
37  
38 41 require Moo::HandleMoose;
39 41 Moo::HandleMoose::inject_real_metaclass_for($self->{name})->isa(@_)
40 }
41 3 ▶sub make_immutable { $_[0] }
Subroutine make_immutable: called CC=1 SCAR=0.0
Pod undocumented
42  
43 44 1;
« blib/lib/Moo/Object.pm ↑ Summary blib/lib/Moo/sification.pm »