lib/Mite/Project.pm.mite.pm

filter: Statementstmt 73.3% 184 / 251 Branchbran 39.0% 50 / 128 Conditioncond 20.8% 30 / 144 MC/DCmcdc 0.0% 0 / 85 Subroutinesub 66.6% 24 / 36 Podpod 0.0% 0 / 6 totaltotal 44.3% 288 / 650 CC 115 SCAR 42.4
CC
115
Cov
50%
new
159.8
__ANON__
126.1
DOES
72.0
CRAP 69.6
« lib/Mite/App/Command/exec.pm ↑ Summary lib/Mite/App/Command/clean.pm.mite.pm »
1 {
2  
3 115 package Mite::Project;
4 115 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 115 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 115 ▶ no warnings qw( once void );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 115 our $USES_MITE = "Mite::Class";
9 115 our $MITE_SHIM = "Mite::Shim";
10 115 our $MITE_VERSION = "0.013000";
11  
12 # Mite keywords
13 115 ▶ BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.8
14 115 my ( $SHIM, $CALLER ) = ( "Mite::Shim", "Mite::Project" );
15 (
16 *after, *around, *before, *extends, *field,
17 *has, *param, *signature_for, *with
18 )
19 115 = do {
20  
21 package Mite::Shim;
22 115 ▶ no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
23 (
24 0 ▶ sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
25 0 ▶ sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
26 0 ▶ sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
27 0 ▶ sub { },
Subroutine __ANON__: not called CC=1 SCAR=0.0
28 0 ▶ sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
29 460 ▶ sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) },
Subroutine __ANON__: called CC=1 SCAR=0.0
30 0 ▶ sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
31 345 ▶ sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) },
Subroutine __ANON__: called CC=1 SCAR=0.0
32 0 ▶ sub { $SHIM->HANDLE_with( $CALLER, @_ ) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
33 115 );
34 };
35 }
36  
37 # Mite imports
38 115 ▶ BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
39 115 require Scalar::Util;
40 115 *STRICT = \&Mite::Shim::STRICT;
41 115 *bare = \&Mite::Shim::bare;
42 115 *blessed = \&Scalar::Util::blessed;
43 115 *carp = \&Mite::Shim::carp;
44 115 *confess = \&Mite::Shim::confess;
45 115 *croak = \&Mite::Shim::croak;
46 115 *false = \&Mite::Shim::false;
47 115 *guard = \&Mite::Shim::guard;
48 115 *lazy = \&Mite::Shim::lazy;
49 115 *lock = \&Mite::Shim::lock;
50 115 *ro = \&Mite::Shim::ro;
51 115 *rw = \&Mite::Shim::rw;
52 115 *rwp = \&Mite::Shim::rwp;
53 115 *true = \&Mite::Shim::true;
54 115 *unlock = \&Mite::Shim::unlock;
55 }
56  
57 # Gather metadata for constructor and destructor
58 114 ▶ sub __META__ {
Subroutine __META__: called CC=4 SCAR=14.6
59 115 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
60 114 my $class = shift;
61 114 ▶ $class = ref($class) || $class;
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
01140
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
62 114 my $linear_isa = mro::get_linear_isa($class);
63 return {
64 BUILD => [
65 0 ▶ map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () }
Branch: 1 branch
BranchTrueFalseTotal
*{$_;}{'CODE'} ? : 0 114 114
66 114 map { "$_\::BUILD" } reverse @$linear_isa
67 ],
68 DEMOLISH => [
69 0 ▶ map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () }
Branch: 1 branch
BranchTrueFalseTotal
*{$_;}{'CODE'} ? : 0 114 114
70 114 map { "$_\::DEMOLISH" } @$linear_isa
71 ],
72 HAS_BUILDARGS => $class->can('BUILDARGS'),
73 HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'),
74 };
75 }
76  
77 # Standard Moose/Moo-style constructor
78 117 ▶ sub new {
Subroutine new: called CC=29 SCAR=50.7
Pod undocumented
79 117 ▶ my $class = ref( $_[0] ) ? ref(shift) : shift;
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 0 117 117
80 117 ▶ my $meta = ( $Mite::META{$class} ||= $class->__META__ );
Condition66%2/3
$Mite::META{$class} ||= $class->__META__
l!l&&r!l&&!r
31140
MC/DC0%0/2
$Mite::META{$class} ||= $class->__META__
$Mite::META{$class} $class->__META__
Truth table66%2/3
A ||= B
A= $Mite::META{$class}B= $class->__META__
ABresult
1X1
011
000
81 117 my $self = bless {}, $class;
82 my $args =
83 $meta->{HAS_BUILDARGS}
84 ? $class->BUILDARGS(@_)
85 0 ▶ : { ( @_ == 1 ) ? %{ $_[0] } : @_ };
Branch: 2 branches
BranchTrueFalseTotal
$meta->{'HAS_BUILDARGS'} ? : 0 117 117
@_ == 1 ? : 0 117 117
86 117 my $no_build = delete $args->{__no_BUILD__};
87  
88 # Attribute sources (type: HashRef[Mite::Source])
89 # has declaration, file lib/Mite/Project.pm, line 14
90 117 do {
91 my $value =
92 exists( $args->{"sources"} )
93 117 ▶ ? $args->{"sources"}
Branch: 1 branch
BranchTrueFalseTotal
exists $args->{'sources'} ? : 0 117 117
94 : $Mite::Project::__sources_DEFAULT__->($self);
95 117 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
do { package Mite::Shim; ref $value eq "HASH" and do { my $ok = 1; foreach my $i (values %{$value;}) { $ok = 0, last unless do { builtin::blessed($i) and $i->isa("Mite::Source") }; } ; $ok } } or croak("Type check failed in constructor: %s should be %s", "sources", "HashRef[Mite::Source]") 117 0 117
96  
97 package Mite::Shim;
98 117 ▶ ( ref($value) eq 'HASH' ) and do {
Condition33%1/3
ref $value eq 'HASH' && do { my $ok = 1; foreach my $i (values %{$value;}) { $ok = 0, last unless do { builtin::blessed($i) and $i->isa('Mite::Source') }; } ; $ok }
!ll&&!rl&&r
00117
MC/DC0%0/2
ref $value eq 'HASH' && do { my $ok = 1; foreach my $i (values %{$value;}) { $ok = 0, last unless do { builtin::blessed($i) and $i->isa('Mite::Source') }; } ; $ok }
ref $value eq 'HASH' do { my $ok = 1; foreach my $i (values %{$value;}) { $ok = 0, last unless do { builtin::blessed($i) and $i->isa('Mite::Source') }; } ; $ok }
Truth table33%1/3
A && B
A= ref $value eq 'HASH'B= do { my $ok = 1; foreach my $i (values %{$value;}) { $ok = 0, last unless do { builtin::blessed($i) and $i->isa('Mite::Source') }; } ; $ok }
ABresult
0X0
100
111
99 117 my $ok = 1;
100 117 for my $i ( values %{$value} ) {
101 ( $ok = 0, last )
102 unless (
103 0 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
unless do { builtin::blessed($i) and $i->isa("Mite::Source") } 0 0 0
104 115 ▶ use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
105 0 ▶ Scalar::Util::blessed($i)
Condition0%0/3
builtin::blessed($i) && $i->isa('Mite::Source')
!ll&&!rl&&r
000
MC/DC0%0/2
builtin::blessed($i) && $i->isa('Mite::Source')
builtin::blessed($i) $i->isa('Mite::Source')
Truth table0%0/3
A && B
A= builtin::blessed($i)B= $i->isa('Mite::Source')
ABresult
0X0
100
111
106 and $i->isa(q[Mite::Source]);
107 }
108 );
109 };
110 117 $ok;
111 }
112 }
113 or croak "Type check failed in constructor: %s should be %s",
114 "sources", "HashRef[Mite::Source]";
115 117 $self->{"sources"} = $value;
116 };
117  
118 # Attribute config (type: Mite::Config)
119 # has declaration, file lib/Mite/Project.pm, line 24
120 117 ▶ if ( exists $args->{"config"} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $args->{"config"}) 0 117 117
121 blessed( $args->{"config"} )
122 0 ▶ && $args->{"config"}->isa("Mite::Config")
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($args->{"config"}) and $args->{"config"}->isa("Mite::Config") or croak("Type check failed in constructor: %s should be %s", "config", "Mite::Config") 0 0 0
Condition0%0/3
builtin::blessed($args->{"config"}) and $args->{"config"}->isa("Mite::Config")
!ll&&!rl&&r
000
MC/DC0%0/2
builtin::blessed($args->{"config"}) and $args->{"config"}->isa("Mite::Config")
builtin::blessed($args->{"config"}) $args->{"config"}->isa("Mite::Config")
Truth table0%0/3
A and B
A= builtin::blessed($args->{"config"})B= $args->{"config"}->isa("Mite::Config")
ABresult
0X0
100
111
123 or croak "Type check failed in constructor: %s should be %s",
124 "config", "Mite::Config";
125 0 $self->{"config"} = $args->{"config"};
126 }
127  
128 # Attribute _module_fakeout_namespace (type: Str|Undef)
129 # has declaration, file lib/Mite/Project.pm, line 26
130 117 ▶ if ( exists $args->{"_module_fakeout_namespace"} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $args->{"_module_fakeout_namespace"}) 0 117 117
131 0 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
do { package Mite::Shim; do { defined $args->{"_module_fakeout_namespace"} and do { ref \$args->{"_module_fakeout_namespace"} eq "SCALAR" or ref \(my $val = $args->{"_module_fakeout_namespace"}) eq "SCALAR" } } or do { not defined $args->{"_module_fakeout_namespace"} } } or croak("Type check failed in constructor: %s should be %s", "_module_fakeout_namespace", "Str|Undef") 0 0 0
132  
133 package Mite::Shim;
134 (
135 do {
136  
137 package Mite::Shim;
138 0 ▶ defined( $args->{"_module_fakeout_namespace"} ) and do {
Condition0%0/3
defined $args->{'_module_fakeout_namespace'} && do { ref \$args->{'_module_fakeout_namespace'} eq 'SCALAR' or ref \(my $val = $args->{'_module_fakeout_namespace'}) eq 'SCALAR' }
!ll&&!rl&&r
000
MC/DC0%0/2
defined $args->{'_module_fakeout_namespace'} && do { ref \$args->{'_module_fakeout_namespace'} eq 'SCALAR' or ref \(my $val = $args->{'_module_fakeout_namespace'}) eq 'SCALAR' }
defined $args->{'_module_fakeout_namespace'} do { ref \$args->{'_module_fakeout_namespace'} eq 'SCALAR' or ref \(my $val = $args->{'_module_fakeout_namespace'}) eq 'SCALAR' }
Truth table0%0/3
A && B
A= defined $args->{'_module_fakeout_namespace'}B= do { ref \$args->{'_module_fakeout_namespace'} eq 'SCALAR' or ref \(my $val = $args->{'_module_fakeout_namespace'}) eq 'SCALAR' }
ABresult
0X0
100
111
139 ref( \$args->{"_module_fakeout_namespace"} ) eq
140 'SCALAR'
141 or ref(
142 \(
143 my $val =
144 0 ▶ $args->{"_module_fakeout_namespace"}
Condition0%0/3
ref \$args->{'_module_fakeout_namespace'} eq 'SCALAR' || ref \(my $val = $args->{'_module_fakeout_namespace'}) eq 'SCALAR'
l!l&&r!l&&!r
000
MC/DC0%0/2
ref \$args->{'_module_fakeout_namespace'} eq 'SCALAR' || ref \(my $val = $args->{'_module_fakeout_namespace'}) eq 'SCALAR'
ref \$args->{'_module_fakeout_namespace'} eq 'SCALAR' ref \(my $val = $args->{'_module_fakeout_namespace'}) eq 'SCALAR'
Truth table0%0/3
A || B
A= ref \$args->{'_module_fakeout_namespace'} eq 'SCALAR'B= ref \(my $val = $args->{'_module_fakeout_namespace'}) eq 'SCALAR'
ABresult
1X1
011
000
145 )
146 ) eq 'SCALAR';
147 }
148 }
149 0 ▶ or do {
Condition0%0/3
do { defined $args->{'_module_fakeout_namespace'} and do { ref \$args->{'_module_fakeout_namespace'} eq 'SCALAR' or ref \(my $val = $args->{'_module_fakeout_namespace'}) eq 'SCALAR' } } || do { not defined $args->{'_module_fakeout_namespace'} }
l!l&&r!l&&!r
000
MC/DC0%0/2
do { defined $args->{'_module_fakeout_namespace'} and do { ref \$args->{'_module_fakeout_namespace'} eq 'SCALAR' or ref \(my $val = $args->{'_module_fakeout_namespace'}) eq 'SCALAR' } } || do { not defined $args->{'_module_fakeout_namespace'} }
do { defined $args->{'_module_fakeout_namespace'} and do { ref \$args->{'_module_fakeout_namespace'} eq 'SCALAR' or ref \(my $val = $args->{'_module_fakeout_namespace'}) eq 'SCALAR' } } do { not defined $args->{'_module_fakeout_namespace'} }
Truth table0%0/3
A || B
A= do { defined $args->{'_module_fakeout_namespace'} and do { ref \$args->{'_module_fakeout_namespace'} eq 'SCALAR' or ref \(my $val = $args->{'_module_fakeout_namespace'}) eq 'SCALAR' } }B= do { not defined $args->{'_module_fakeout_namespace'} }
ABresult
1X1
011
000
150  
151 package Mite::Shim;
152 0 !defined( $args->{"_module_fakeout_namespace"} );
153 }
154 );
155 }
156 or croak "Type check failed in constructor: %s should be %s",
157 "_module_fakeout_namespace", "Str|Undef";
158 $self->{"_module_fakeout_namespace"} =
159 0 $args->{"_module_fakeout_namespace"};
160 }
161  
162 # Attribute debug (type: Bool)
163 # has declaration, file lib/Mite/Project.pm, line 30
164 117 do {
165 117 ▶ my $value = exists( $args->{"debug"} ) ? $args->{"debug"} : false;
Branch: 1 branch
BranchTrueFalseTotal
exists $args->{'debug'} ? : 0 117 117
166 (
167 117 ▶ !ref $value
Branch: 1 branch
BranchTrueFalseTotal
not ref $value and !defined($value) || $value eq "" || $value eq 0 || $value eq 1 or croak("Type check failed in constructor: %s should be %s", "debug", "Bool") 117 0 117
Condition33%4/12
not ref $value and !defined($value) || $value eq "" || $value eq 0 || $value eq 1
!ll&&!rl&&r
00117
not defined $value or $value eq "" or $value eq 0 or $value eq 1
l!l&&r!l&&!r
11700
not defined $value or $value eq "" or $value eq 0
l!l&&r!l&&!r
11700
not defined $value or $value eq ""
l!l&&r!l&&!r
01170
MC/DC0%0/5
not ref $value and !defined($value) || $value eq "" || $value eq 0 || $value eq 1
not ref $value not defined $value $value eq "" $value eq 0 $value eq 1
Truth table16%1/6
not(A) and not(B) or C or D or E
A= not ref $valueB= not defined $valueC= $value eq ""D= $value eq 0E= $value eq 1
ABCDEresult
0XXXX0
100000
11XXX1
101XX1
1001X1
100011
168 and ( !defined $value
169 or $value eq q()
170 or $value eq '0'
171 or $value eq '1' )
172 )
173 or croak "Type check failed in constructor: %s should be %s",
174 "debug", "Bool";
175 117 $self->{"debug"} = $value;
176 };
177  
178 # Call BUILD methods
179 117 ▶ $self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } );
Branch: 1 branch
BranchTrueFalseTotal
if not $no_build and @{$meta->{"BUILD"} or [];} 0 117 117
Condition40%2/5
not $no_build and @{$meta->{"BUILD"} or [];}
!ll&&!rl&&r
01170
$meta->{'BUILD'} || []
l!l
1170
MC/DC0%0/2
not $no_build and @{$meta->{"BUILD"} or [];}
not $no_build @{$meta->{"BUILD"} or [];}
MC/DC0%0/1
$meta->{'BUILD'} || []
$meta->{'BUILD'}
Truth table33%1/3
not(A) and B
A= not $no_buildB= @{$meta->{"BUILD"} or [];}
ABresult
0X0
100
111
Truth table50%1/2
A
A= $meta->{'BUILD'}
Aresult
11
00
180  
181 # Unrecognized parameters
182 my @unknown =
183 grep not(/\A(?:_module_fakeout_namespace|config|debug|sources)\z/),
184 117 keys %{$args};
185 @unknown
186 117 ▶ and croak(
Branch: 1 branch
BranchTrueFalseTotal
@unknown and croak('Unexpected keys in constructor: ' . join(", ", sort(@unknown))) 0 117 117
187 "Unexpected keys in constructor: " . join( q[, ], sort @unknown ) );
188  
189 117 return $self;
190 }
191  
192 # Used by constructor to call BUILD methods
193 0 ▶ sub BUILDALL {
Subroutine BUILDALL: not called CC=4 SCAR=30.0
Pod undocumented
194 0 my $class = ref( $_[0] );
195 0 ▶ my $meta = ( $Mite::META{$class} ||= $class->__META__ );
Condition0%0/3
$Mite::META{$class} ||= $class->__META__
l!l&&r!l&&!r
000
MC/DC0%0/2
$Mite::META{$class} ||= $class->__META__
$Mite::META{$class} $class->__META__
Truth table0%0/3
A ||= B
A= $Mite::META{$class}B= $class->__META__
ABresult
1X1
011
000
196 0 ▶ $_->(@_) for @{ $meta->{BUILD} || [] };
Condition0%0/2
$meta->{'BUILD'} || []
l!l
00
MC/DC0%0/1
$meta->{'BUILD'} || []
$meta->{'BUILD'}
Truth table0%0/2
A
A= $meta->{'BUILD'}
Aresult
11
00
197 }
198  
199 # Destructor should call DEMOLISH methods
200 5 ▶ sub DESTROY {
Subroutine DESTROY: called CC=7 SCAR=25.7
201 5 my $self = shift;
202 5 ▶ my $class = ref($self) || $self;
Condition33%1/3
ref $self || $self
l!l&&r!l&&!r
500
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table33%1/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
203 5 ▶ my $meta = ( $Mite::META{$class} ||= $class->__META__ );
Condition33%1/3
$Mite::META{$class} ||= $class->__META__
l!l&&r!l&&!r
500
MC/DC0%0/2
$Mite::META{$class} ||= $class->__META__
$Mite::META{$class} $class->__META__
Truth table33%1/3
A ||= B
A= $Mite::META{$class}B= $class->__META__
ABresult
1X1
011
000
204 5 ▶ my $in_global_destruction =
Branch: 1 branch
BranchTrueFalseTotal
defined ${^GLOBAL_PHASE} ? : 5 0 5
205 defined ${^GLOBAL_PHASE}
206 ? ${^GLOBAL_PHASE} eq 'DESTRUCT'
207 : Devel::GlobalDestruction::in_global_destruction();
208 5 ▶ for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) {
Condition50%1/2
$meta->{'DEMOLISH'} || []
l!l
50
MC/DC0%0/1
$meta->{'DEMOLISH'} || []
$meta->{'DEMOLISH'}
Truth table50%1/2
A
A= $meta->{'DEMOLISH'}
Aresult
11
00
209 0 my $e = do {
210 0 local ( $?, $@ );
211 0 eval { $demolisher->( $self, $in_global_destruction ) };
212 0 $@;
213 };
214 115 ▶ no warnings 'misc'; # avoid (in cleanup) warnings
Subroutine BEGIN: called CC=1 SCAR=0.0
215 0 ▶ die $e if $e; # rethrow
Branch: 1 branch
BranchTrueFalseTotal
if $e 0 0 0
216 }
217 5 return;
218 }
219  
220 my $__XS = !$ENV{PERL_ONLY}
221 115 ▶ && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") };
Condition33%1/3
!$ENV{'PERL_ONLY'} && eval { do { require Class::XSAccessor; 'Class::XSAccessor'->VERSION('1.19') } }
!ll&&!rl&&r
00115
MC/DC0%0/2
!$ENV{'PERL_ONLY'} && eval { do { require Class::XSAccessor; 'Class::XSAccessor'->VERSION('1.19') } }
!$ENV{'PERL_ONLY'} eval { do { require Class::XSAccessor; 'Class::XSAccessor'->VERSION('1.19') } }
Truth table33%1/3
not(A) && B
A= !$ENV{'PERL_ONLY'}B= eval { do { require Class::XSAccessor; 'Class::XSAccessor'->VERSION('1.19') } }
ABresult
0X0
100
111
222  
223 # Accessors for _module_fakeout_namespace
224 # has declaration, file lib/Mite/Project.pm, line 26
225 530 ▶ sub _module_fakeout_namespace {
Subroutine _module_fakeout_namespace: called CC=6 SCAR=34.7
226 @_ > 1
227 ? do {
228 0 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
do { package Mite::Shim; do { defined $_[1] and do { ref \$_[1] eq "SCALAR" or ref \(my $val = $_[1]) eq "SCALAR" } } or not defined $_[1] } or croak("Type check failed in %s: value should be %s", "accessor", "Str|Undef") 0 0 0
229  
230 package Mite::Shim;
231 (
232 0 ▶ do {
Condition0%0/3
do { defined $_[1] and do { ref \$_[1] eq 'SCALAR' or ref \(my $val = $_[1]) eq 'SCALAR' } } || !defined($_[1])
l!l&&r!l&&!r
000
MC/DC0%0/2
do { defined $_[1] and do { ref \$_[1] eq 'SCALAR' or ref \(my $val = $_[1]) eq 'SCALAR' } } || !defined($_[1])
do { defined $_[1] and do { ref \$_[1] eq 'SCALAR' or ref \(my $val = $_[1]) eq 'SCALAR' } } !defined($_[1])
Truth table0%0/3
A || not(B)
A= do { defined $_[1] and do { ref \$_[1] eq 'SCALAR' or ref \(my $val = $_[1]) eq 'SCALAR' } }B= !defined($_[1])
ABresult
1X1
011
000
233  
234 package Mite::Shim;
235 0 ▶ defined( $_[1] ) and do {
Condition0%0/3
defined $_[1] && do { ref \$_[1] eq 'SCALAR' or ref \(my $val = $_[1]) eq 'SCALAR' }
!ll&&!rl&&r
000
MC/DC0%0/2
defined $_[1] && do { ref \$_[1] eq 'SCALAR' or ref \(my $val = $_[1]) eq 'SCALAR' }
defined $_[1] do { ref \$_[1] eq 'SCALAR' or ref \(my $val = $_[1]) eq 'SCALAR' }
Truth table0%0/3
A && B
A= defined $_[1]B= do { ref \$_[1] eq 'SCALAR' or ref \(my $val = $_[1]) eq 'SCALAR' }
ABresult
0X0
100
111
236 0 ▶ ref( \$_[1] ) eq 'SCALAR'
Condition0%0/3
ref \$_[1] eq 'SCALAR' || ref \(my $val = $_[1]) eq 'SCALAR'
l!l&&r!l&&!r
000
MC/DC0%0/2
ref \$_[1] eq 'SCALAR' || ref \(my $val = $_[1]) eq 'SCALAR'
ref \$_[1] eq 'SCALAR' ref \(my $val = $_[1]) eq 'SCALAR'
Truth table0%0/3
A || B
A= ref \$_[1] eq 'SCALAR'B= ref \(my $val = $_[1]) eq 'SCALAR'
ABresult
1X1
011
000
237 or ref( \( my $val = $_[1] ) ) eq 'SCALAR';
238 }
239 }
240 or ( !defined( $_[1] ) )
241 );
242 }
243 or croak( "Type check failed in %s: value should be %s",
244 "accessor", "Str|Undef" );
245 0 $_[0]{"_module_fakeout_namespace"} = $_[1];
246 0 $_[0];
247 }
248 530 ▶ : ( $_[0]{"_module_fakeout_namespace"} );
Branch: 1 branch
BranchTrueFalseTotal
@_ > 1 ? : 0 530 530
249 }
250  
251 # Accessors for config
252 # has declaration, file lib/Mite/Project.pm, line 24
253 992 ▶ sub config {
Subroutine config: called CC=5 SCAR=17.2
Pod undocumented
254 992 ▶ @_ == 1 or croak('Reader "config" usage: $self->config()');
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("Reader \"config\" usage: \$self->config()") 992 0 992
255 (
256 exists( $_[0]{"config"} ) ? $_[0]{"config"} : (
257 992 ▶ $_[0]{"config"} = do {
Branch: 1 branch
BranchTrueFalseTotal
exists $_[0]{'config'} ? : 880 112 992
258 112 my $default_value =
259 $Mite::Project::__config_DEFAULT__->( $_[0] );
260 112 ▶ blessed($default_value)
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($default_value) and $default_value->isa("Mite::Config") or croak("Type check failed in default: %s should be %s", "config", "Mite::Config") 112 0 112
Condition33%1/3
builtin::blessed($default_value) and $default_value->isa("Mite::Config")
!ll&&!rl&&r
00112
MC/DC0%0/2
builtin::blessed($default_value) and $default_value->isa("Mite::Config")
builtin::blessed($default_value) $default_value->isa("Mite::Config")
Truth table33%1/3
A and B
A= builtin::blessed($default_value)B= $default_value->isa("Mite::Config")
ABresult
0X0
100
111
261 && $default_value->isa("Mite::Config")
262 or croak( "Type check failed in default: %s should be %s",
263 "config", "Mite::Config" );
264 112 $default_value;
265 }
266 )
267 );
268 }
269  
270 # Accessors for debug
271 # has declaration, file lib/Mite/Project.pm, line 30
272 348 ▶ sub debug {
Subroutine debug: called CC=7 SCAR=24.4
Pod undocumented
273 @_ > 1
274 ? do {
275 (
276 22 ▶ !ref $_[1]
Branch: 1 branch
BranchTrueFalseTotal
not ref $_[1] and !defined($_[1]) || $_[1] eq "" || $_[1] eq 0 || $_[1] eq 1 or croak("Type check failed in %s: value should be %s", "accessor", "Bool") 22 0 22
Condition33%4/12
not ref $_[1] and !defined($_[1]) || $_[1] eq "" || $_[1] eq 0 || $_[1] eq 1
!ll&&!rl&&r
0022
not defined $_[1] or $_[1] eq "" or $_[1] eq 0 or $_[1] eq 1
l!l&&r!l&&!r
2200
not defined $_[1] or $_[1] eq "" or $_[1] eq 0
l!l&&r!l&&!r
2200
not defined $_[1] or $_[1] eq ""
l!l&&r!l&&!r
2200
MC/DC0%0/5
not ref $_[1] and !defined($_[1]) || $_[1] eq "" || $_[1] eq 0 || $_[1] eq 1
not ref $_[1] not defined $_[1] $_[1] eq "" $_[1] eq 0 $_[1] eq 1
Truth table16%1/6
not(A) and not(B) or C or D or E
A= not ref $_[1]B= not defined $_[1]C= $_[1] eq ""D= $_[1] eq 0E= $_[1] eq 1
ABCDEresult
0XXXX0
100000
11XXX1
101XX1
1001X1
100011
277 and ( !defined $_[1]
278 or $_[1] eq q()
279 or $_[1] eq '0'
280 or $_[1] eq '1' )
281 )
282 or croak( "Type check failed in %s: value should be %s",
283 "accessor", "Bool" );
284 22 $_[0]{"debug"} = $_[1];
285 22 $_[0];
286 }
287 348 ▶ : ( $_[0]{"debug"} );
Branch: 1 branch
BranchTrueFalseTotal
@_ > 1 ? : 22 326 348
288 }
289  
290 # Accessors for sources
291 # has declaration, file lib/Mite/Project.pm, line 14
292 115 ▶ if ($__XS) {
Branch: 1 branch
BranchTrueFalseTotal
if ($__XS) { } 115 0 115
293 115 Class::XSAccessor->import(
294 chained => 1,
295 "getters" => { "sources" => "sources" },
296 );
297 }
298 else {
299 0 ▶ *sources = sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
300 0 ▶ @_ == 1 or croak('Reader "sources" usage: $self->sources()');
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 or croak("Reader \"sources\" usage: \$self->sources()") 0 0 0
301 0 $_[0]{"sources"};
302 0 };
303 }
304  
305 # See UNIVERSAL
306 0 ▶ sub DOES {
Subroutine DOES: not called CC=8 SCAR=42.8
Pod undocumented
307 0 my ( $self, $role ) = @_;
308 0 our %DOES;
309 0 ▶ return $DOES{$role} if exists $DOES{$role};
Branch: 1 branch
BranchTrueFalseTotal
if exists $Mite::Project::DOES{$role} 0 0 0
310 0 ▶ return 1 if $role eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
if $role eq __PACKAGE__ 0 0 0
311 0 ▶ if ( $INC{'Moose/Util.pm'}
Branch: 1 branch
BranchTrueFalseTotal
if ($INC{"Moose/Util.pm"} and my $meta = Moose::Util::find_meta(ref $self || $self)) 0 0 0
Condition0%0/6
$INC{"Moose/Util.pm"} and my $meta = Moose::Util::find_meta(ref $self || $self)
!ll&&!rl&&r
000
ref $self || $self
l!l&&r!l&&!r
000
MC/DC0%0/2
$INC{"Moose/Util.pm"} and my $meta = Moose::Util::find_meta(ref $self || $self)
$INC{"Moose/Util.pm"} my $meta = Moose::Util::find_meta(ref $self || $self)
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table0%0/3
A and B
A= $INC{"Moose/Util.pm"}B= my $meta = Moose::Util::find_meta(ref $self || $self)
ABresult
0X0
100
111
Truth table0%0/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
312 and my $meta = Moose::Util::find_meta( ref $self or $self ) )
313 {
314 0 ▶ $meta->can('does_role') and $meta->does_role($role) and return 1;
Branch: 1 branch
BranchTrueFalseTotal
$meta->can("does_role") and $meta->does_role($role) and return 1 0 0 0
Condition0%0/3
$meta->can("does_role") and $meta->does_role($role)
!ll&&!rl&&r
000
MC/DC0%0/2
$meta->can("does_role") and $meta->does_role($role)
$meta->can("does_role") $meta->does_role($role)
Truth table0%0/3
A and B
A= $meta->can("does_role")B= $meta->does_role($role)
ABresult
0X0
100
111
315 }
316 0 return $self->SUPER::DOES($role);
317 }
318  
319 # Alias for Moose/Moo-compatibility
320 0 ▶ sub does {
Subroutine does: not called CC=1 SCAR=6.9
Pod undocumented
321 0 shift->DOES(@_);
322 }
323  
324 # Method signatures
325 115 our %SIGNATURE_FOR;
326  
327 17 ▶ $SIGNATURE_FOR{"_recurse_directory"} = sub {
Subroutine __ANON__: called CC=16 SCAR=40.5
328 17 my $__NEXT__ = shift;
329  
330 17 my ( @out, %tmp, $tmp, $dtmp, @head );
331  
332 17 ▶ @_ == 3
Branch: 1 branch
BranchTrueFalseTotal
@_ == 3 or croak("Wrong number of parameters in signature for %s: got %d, %s", "_recurse_directory", scalar @_, "expected exactly 3 parameters") 17 0 17
333 or
334 croak( "Wrong number of parameters in signature for %s: got %d, %s",
335 "_recurse_directory", scalar(@_), "expected exactly 3 parameters" );
336  
337 17 @head = splice( @_, 0, 1 );
338  
339 # Parameter invocant (type: Defined)
340 17 ▶ ( defined( $head[0] ) )
Branch: 1 branch
BranchTrueFalseTotal
defined $head[0] or croak("Type check failed in signature for _recurse_directory: %s should be %s", "\$_[0]", "Defined") 17 0 17
341 or croak(
342 "Type check failed in signature for _recurse_directory: %s should be %s",
343 "\$_[0]", "Defined"
344 );
345  
346 # Parameter $_[0] (type: Path)
347 $tmp = (
348 (
349 do {
350 115 ▶ use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
351 17 ▶ Scalar::Util::blessed( $_[0] ) and $_[0]->isa(q[Path::Tiny]);
Branch: 1 branch
BranchTrueFalseTotal
do { package Mite::Shim; defined $_[0] and do { ref \$_[0] eq 'SCALAR' or ref \(my $val = $_[0]) eq 'SCALAR' } } ? : 17 0 17
Condition33%1/3
builtin::blessed($_[0]) && $_[0]->isa('Path::Tiny')
!ll&&!rl&&r
1700
MC/DC0%0/2
builtin::blessed($_[0]) && $_[0]->isa('Path::Tiny')
builtin::blessed($_[0]) $_[0]->isa('Path::Tiny')
Truth table33%1/3
A && B
A= builtin::blessed($_[0])B= $_[0]->isa('Path::Tiny')
ABresult
0X0
100
111
352 }
353 )
354 ) ? $_[0] : (
355 do {
356  
357 package Mite::Shim;
358 17 ▶ defined( $_[0] ) and do {
Condition33%1/3
defined $_[0] && do { ref \$_[0] eq 'SCALAR' or ref \(my $val = $_[0]) eq 'SCALAR' }
!ll&&!rl&&r
0017
MC/DC0%0/2
defined $_[0] && do { ref \$_[0] eq 'SCALAR' or ref \(my $val = $_[0]) eq 'SCALAR' }
defined $_[0] do { ref \$_[0] eq 'SCALAR' or ref \(my $val = $_[0]) eq 'SCALAR' }
Truth table33%1/3
A && B
A= defined $_[0]B= do { ref \$_[0] eq 'SCALAR' or ref \(my $val = $_[0]) eq 'SCALAR' }
ABresult
0X0
100
111
359 17 ▶ ref( \$_[0] ) eq 'SCALAR'
Condition33%1/3
ref \$_[0] eq 'SCALAR' || ref \(my $val = $_[0]) eq 'SCALAR'
l!l&&r!l&&!r
1700
MC/DC0%0/2
ref \$_[0] eq 'SCALAR' || ref \(my $val = $_[0]) eq 'SCALAR'
ref \$_[0] eq 'SCALAR' ref \(my $val = $_[0]) eq 'SCALAR'
Truth table33%1/3
A || B
A= ref \$_[0] eq 'SCALAR'B= ref \(my $val = $_[0]) eq 'SCALAR'
ABresult
1X1
011
000
360 or ref( \( my $val = $_[0] ) ) eq 'SCALAR';
361 }
362 }
363 )
364 ? scalar(
365 17 ▶ do { local $_ = $_[0]; Path::Tiny::path($_) }
Branch: 1 branch
BranchTrueFalseTotal
do { package Mite::Shim; defined $_[0] and not ref $_[0] or builtin::blessed($_[0]) and sub { require overload; overload::Overloaded(ref $_[0] || $_[0]) and overload::Method(ref $_[0] || $_[0], $_[1]); } ->($_[0], '""') } ? : 0 0 0
366 )
367 : (
368 do {
369  
370 package Mite::Shim;
371 defined( $_[0] ) && !ref( $_[0] )
372 or Scalar::Util::blessed( $_[0] ) && (
373 0 ▶ sub {
Subroutine __ANON__: not called CC=4 SCAR=30.0
374 0 require overload;
375 0 ▶ overload::Overloaded( ref $_[0] or $_[0] )
Branch: 1 branch
BranchTrueFalseTotal
overload::Overloaded(ref $_[0] || $_[0]) and overload::Method(ref $_[0] || $_[0], $_[1]) 0 0 0
Condition0%0/6
ref $_[0] || $_[0]
l!l&&r!l&&!r
000
ref $_[0] || $_[0]
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $_[0] || $_[0]
ref $_[0] $_[0]
MC/DC0%0/2
ref $_[0] || $_[0]
ref $_[0] $_[0]
Truth table0%0/3
A || B
A= ref $_[0]B= $_[0]
ABresult
1X1
011
000
Truth table0%0/3
A || B
A= ref $_[0]B= $_[0]
ABresult
1X1
011
000
376 and overload::Method( ( ref $_[0] or $_[0] ), $_[1] );
377 }
378 0 ▶ )->( $_[0], q[""] );
Condition0%0/9
defined $_[0] && !ref($_[0]) || builtin::blessed($_[0]) && sub { require overload; overload::Overloaded(ref $_[0] || $_[0]) and overload::Method(ref $_[0] || $_[0], $_[1]); } ->($_[0], '""')
l!l&&r!l&&!r
000
defined $_[0] and not ref $_[0]
!ll&&!rl&&r
000
builtin::blessed($_[0]) and sub { require overload; overload::Overloaded(ref $_[0] || $_[0]) and overload::Method(ref $_[0] || $_[0], $_[1]); } ->($_[0], "\"\"")
!ll&&!rl&&r
000
MC/DC0%0/4
defined $_[0] && !ref($_[0]) || builtin::blessed($_[0]) && sub { require overload; overload::Overloaded(ref $_[0] || $_[0]) and overload::Method(ref $_[0] || $_[0], $_[1]); } ->($_[0], '""')
defined $_[0] not ref $_[0] builtin::blessed($_[0]) sub { require overload; overload::Overloaded(ref $_[0] || $_[0]) and overload::Method(ref $_[0] || $_[0], $_[1]); } ->($_[0], "\"\"")
Truth table0%0/7
A and not(B) || C and D
A= defined $_[0]B= not ref $_[0]C= builtin::blessed($_[0])D= sub { require overload; overload::Overloaded(ref $_[0] || $_[0]) and overload::Method(ref $_[0] || $_[0], $_[1]); } ->($_[0], "\"\"")
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
379 }
380 )
381 ? scalar(
382 0 ▶ do { local $_ = $_[0]; Path::Tiny::path($_) }
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] eq 'ARRAY' ? : 0 0 0
383 )
384 : ( ( ref( $_[0] ) eq 'ARRAY' ) ) ? scalar(
385 0 ▶ do { local $_ = $_[0]; Path::Tiny::path(@$_) }
Branch: 1 branch
BranchTrueFalseTotal
do { builtin::blessed($_[0]) and $_[0]->isa('Path::Tiny') } ? : 0 17 17
386 )
387 : $_[0];
388 (
389 17 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
do { builtin::blessed($tmp) and $tmp->isa("Path::Tiny") } or croak("Type check failed in signature for _recurse_directory: %s should be %s", "\$_[1]", "Path") 17 0 17
390 115 ▶ use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
391 17 ▶ Scalar::Util::blessed($tmp) and $tmp->isa(q[Path::Tiny]);
Condition33%1/3
builtin::blessed($tmp) && $tmp->isa('Path::Tiny')
!ll&&!rl&&r
0017
MC/DC0%0/2
builtin::blessed($tmp) && $tmp->isa('Path::Tiny')
builtin::blessed($tmp) $tmp->isa('Path::Tiny')
Truth table33%1/3
A && B
A= builtin::blessed($tmp)B= $tmp->isa('Path::Tiny')
ABresult
0X0
100
111
392 }
393 )
394 or croak(
395 "Type check failed in signature for _recurse_directory: %s should be %s",
396 "\$_[1]", "Path"
397 );
398 17 push( @out, $tmp );
399  
400 # Parameter $_[1] (type: CodeRef)
401 17 ▶ ( ref( $_[1] ) eq 'CODE' )
Branch: 1 branch
BranchTrueFalseTotal
ref $_[1] eq "CODE" or croak("Type check failed in signature for _recurse_directory: %s should be %s", "\$_[2]", "CodeRef") 17 0 17
402 or croak(
403 "Type check failed in signature for _recurse_directory: %s should be %s",
404 "\$_[2]", "CodeRef"
405 );
406 17 push( @out, $_[1] );
407  
408 17 do { @_ = ( @head, @out ); goto $__NEXT__ };
409 115 };
410  
411 119 ▶ $SIGNATURE_FOR{"inject_mite_functions"} = sub {
Subroutine __ANON__: called CC=29 SCAR=48.4
412 119 my $__NEXT__ = shift;
413  
414 119 my ( %out, %in, %tmp, $tmp, $dtmp, @head );
415  
416 119 ▶ @_ == 2 && ( ref( $_[1] ) eq 'HASH' )
Branch: 1 branch
BranchTrueFalseTotal
@_ == 2 and ref $_[1] eq "HASH" or @_ % 2 == 1 and @_ >= 7 or croak("Wrong number of parameters in signature for %s: got %d, %s", "inject_mite_functions", scalar @_, "that does not seem right") 119 0 119
Condition33%3/9
@_ == 2 and ref $_[1] eq "HASH" or @_ % 2 == 1 and @_ >= 7
l!l&&r!l&&!r
01190
@_ == 2 and ref $_[1] eq "HASH"
!ll&&!rl&&r
11900
@_ % 2 == 1 and @_ >= 7
!ll&&!rl&&r
00119
MC/DC0%0/4
@_ == 2 and ref $_[1] eq "HASH" or @_ % 2 == 1 and @_ >= 7
@_ == 2 ref $_[1] eq "HASH" @_ % 2 == 1 @_ >= 7
Truth table14%1/7
A and B or C and D
A= @_ == 2B= ref $_[1] eq "HASH"C= @_ % 2 == 1D= @_ >= 7
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
417 or @_ % 2 == 1 && @_ >= 7
418 or
419 croak( "Wrong number of parameters in signature for %s: got %d, %s",
420 "inject_mite_functions", scalar(@_), "that does not seem right" );
421  
422 119 @head = splice( @_, 0, 1 );
423  
424 # Parameter invocant (type: Defined)
425 119 ▶ ( defined( $head[0] ) )
Branch: 1 branch
BranchTrueFalseTotal
defined $head[0] or croak("Type check failed in signature for inject_mite_functions: %s should be %s", "\$_[0]", "Defined") 119 0 119
426 or croak(
427 "Type check failed in signature for inject_mite_functions: %s should be %s",
428 "\$_[0]", "Defined"
429 );
430  
431 0 ▶ %in = ( @_ == 1 and ( ref( $_[0] ) eq 'HASH' ) ) ? %{ $_[0] } : @_;
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 && ref $_[0] eq 'HASH' ? : 0 119 119
Condition33%1/3
@_ == 1 and ref $_[0] eq "HASH"
!ll&&!rl&&r
11900
MC/DC0%0/2
@_ == 1 and ref $_[0] eq "HASH"
@_ == 1 ref $_[0] eq "HASH"
Truth table33%1/3
A and B
A= @_ == 1B= ref $_[0] eq "HASH"
ABresult
0X0
100
111
432  
433 # Parameter package (type: Any)
434 119 ▶ exists( $in{"package"} )
Branch: 1 branch
BranchTrueFalseTotal
exists $in{"package"} or croak("Failure in signature for inject_mite_functions: Missing required parameter: package") 119 0 119
435 or croak( "Failure in signature for inject_mite_functions: "
436 . 'Missing required parameter: package' );
437 119 1; # ... nothing to do
438 119 ▶ $out{"package"} = $in{"package"} if exists( $in{"package"} );
Branch: 1 branch
BranchTrueFalseTotal
if exists $in{"package"} 119 0 119
439 119 delete( $in{"package"} );
440  
441 # Parameter file (type: Any)
442 119 ▶ exists( $in{"file"} )
Branch: 1 branch
BranchTrueFalseTotal
exists $in{"file"} or croak("Failure in signature for inject_mite_functions: Missing required parameter: file") 119 0 119
443 or croak( "Failure in signature for inject_mite_functions: "
444 . 'Missing required parameter: file' );
445 119 1; # ... nothing to do
446 119 ▶ $out{"file"} = $in{"file"} if exists( $in{"file"} );
Branch: 1 branch
BranchTrueFalseTotal
if exists $in{"file"} 119 0 119
447 119 delete( $in{"file"} );
448  
449 # Parameter kind (type: Optional[Str])
450 119 ▶ if ( exists( $in{"kind"} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $in{"kind"}) 0 119 119
451 0 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
do { package Mite::Shim; defined $in{"kind"} and do { ref \$in{"kind"} eq "SCALAR" or ref \(my $val = $in{"kind"}) eq "SCALAR" } } or croak("Type check failed in signature for inject_mite_functions: %s should be %s", "\$_{\"kind\"}", "Optional[Str]") 0 0 0
452  
453 package Mite::Shim;
454 0 ▶ defined( $in{"kind"} ) and do {
Condition0%0/3
defined $in{'kind'} && do { ref \$in{'kind'} eq 'SCALAR' or ref \(my $val = $in{'kind'}) eq 'SCALAR' }
!ll&&!rl&&r
000
MC/DC0%0/2
defined $in{'kind'} && do { ref \$in{'kind'} eq 'SCALAR' or ref \(my $val = $in{'kind'}) eq 'SCALAR' }
defined $in{'kind'} do { ref \$in{'kind'} eq 'SCALAR' or ref \(my $val = $in{'kind'}) eq 'SCALAR' }
Truth table0%0/3
A && B
A= defined $in{'kind'}B= do { ref \$in{'kind'} eq 'SCALAR' or ref \(my $val = $in{'kind'}) eq 'SCALAR' }
ABresult
0X0
100
111
455 ref( \$in{"kind"} ) eq 'SCALAR'
456 0 ▶ or ref( \( my $val = $in{"kind"} ) ) eq 'SCALAR';
Condition0%0/3
ref \$in{'kind'} eq 'SCALAR' || ref \(my $val = $in{'kind'}) eq 'SCALAR'
l!l&&r!l&&!r
000
MC/DC0%0/2
ref \$in{'kind'} eq 'SCALAR' || ref \(my $val = $in{'kind'}) eq 'SCALAR'
ref \$in{'kind'} eq 'SCALAR' ref \(my $val = $in{'kind'}) eq 'SCALAR'
Truth table0%0/3
A || B
A= ref \$in{'kind'} eq 'SCALAR'B= ref \(my $val = $in{'kind'}) eq 'SCALAR'
ABresult
1X1
011
000
457 }
458 }
459 or croak(
460 "Type check failed in signature for inject_mite_functions: %s should be %s",
461 "\$_{\"kind\"}", "Optional[Str]"
462 );
463 0 $out{"kind"} = $in{"kind"};
464 0 delete( $in{"kind"} );
465 }
466  
467 # Parameter arg (type: HashRef)
468 119 ▶ $dtmp = exists( $in{"arg"} ) ? $in{"arg"} : {};
Branch: 1 branch
BranchTrueFalseTotal
exists $in{'arg'} ? : 119 0 119
469 119 ▶ ( ref($dtmp) eq 'HASH' )
Branch: 1 branch
BranchTrueFalseTotal
ref $dtmp eq "HASH" or croak("Type check failed in signature for inject_mite_functions: %s should be %s", "\$_{\"arg\"}", "HashRef") 119 0 119
470 or croak(
471 "Type check failed in signature for inject_mite_functions: %s should be %s",
472 "\$_{\"arg\"}", "HashRef"
473 );
474 119 $out{"arg"} = $dtmp;
475 119 delete( $in{"arg"} );
476  
477 # Parameter shim (type: Str)
478 119 ▶ exists( $in{"shim"} )
Branch: 1 branch
BranchTrueFalseTotal
exists $in{"shim"} or croak("Failure in signature for inject_mite_functions: Missing required parameter: shim") 119 0 119
479 or croak( "Failure in signature for inject_mite_functions: "
480 . 'Missing required parameter: shim' );
481 119 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
do { package Mite::Shim; defined $in{"shim"} and do { ref \$in{"shim"} eq "SCALAR" or ref \(my $val = $in{"shim"}) eq "SCALAR" } } or croak("Type check failed in signature for inject_mite_functions: %s should be %s", "\$_{\"shim\"}", "Str") 119 0 119
482  
483 package Mite::Shim;
484 119 ▶ defined( $in{"shim"} ) and do {
Condition33%1/3
defined $in{'shim'} && do { ref \$in{'shim'} eq 'SCALAR' or ref \(my $val = $in{'shim'}) eq 'SCALAR' }
!ll&&!rl&&r
00119
MC/DC0%0/2
defined $in{'shim'} && do { ref \$in{'shim'} eq 'SCALAR' or ref \(my $val = $in{'shim'}) eq 'SCALAR' }
defined $in{'shim'} do { ref \$in{'shim'} eq 'SCALAR' or ref \(my $val = $in{'shim'}) eq 'SCALAR' }
Truth table33%1/3
A && B
A= defined $in{'shim'}B= do { ref \$in{'shim'} eq 'SCALAR' or ref \(my $val = $in{'shim'}) eq 'SCALAR' }
ABresult
0X0
100
111
485 ref( \$in{"shim"} ) eq 'SCALAR'
486 119 ▶ or ref( \( my $val = $in{"shim"} ) ) eq 'SCALAR';
Condition33%1/3
ref \$in{'shim'} eq 'SCALAR' || ref \(my $val = $in{'shim'}) eq 'SCALAR'
l!l&&r!l&&!r
11900
MC/DC0%0/2
ref \$in{'shim'} eq 'SCALAR' || ref \(my $val = $in{'shim'}) eq 'SCALAR'
ref \$in{'shim'} eq 'SCALAR' ref \(my $val = $in{'shim'}) eq 'SCALAR'
Truth table33%1/3
A || B
A= ref \$in{'shim'} eq 'SCALAR'B= ref \(my $val = $in{'shim'}) eq 'SCALAR'
ABresult
1X1
011
000
487 }
488 }
489 or croak(
490 "Type check failed in signature for inject_mite_functions: %s should be %s",
491 "\$_{\"shim\"}", "Str"
492 );
493 119 ▶ $out{"shim"} = $in{"shim"} if exists( $in{"shim"} );
Branch: 1 branch
BranchTrueFalseTotal
if exists $in{"shim"} 119 0 119
494 119 delete( $in{"shim"} );
495  
496 # Parameter x_source (type: Optional[Object])
497 119 ▶ if ( exists( $in{"x_source"} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $in{"x_source"}) 0 119 119
498 (
499 0 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
do { package Mite::Shim; builtin::blessed($in{"x_source"}) } or croak("Type check failed in signature for inject_mite_functions: %s should be %s", "\$_{\"x_source\"}", "Optional[Object]") 0 0 0
500  
501 package Mite::Shim;
502 115 ▶ use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
503 0 Scalar::Util::blessed( $in{"x_source"} );
504 }
505 )
506 or croak(
507 "Type check failed in signature for inject_mite_functions: %s should be %s",
508 "\$_{\"x_source\"}", "Optional[Object]"
509 );
510 0 $out{"x_source"} = $in{"x_source"};
511 0 delete( $in{"x_source"} );
512 }
513  
514 # Parameter x_pkg (type: Optional[Object])
515 119 ▶ if ( exists( $in{"x_pkg"} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $in{"x_pkg"}) 0 119 119
516 (
517 0 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
do { package Mite::Shim; builtin::blessed($in{"x_pkg"}) } or croak("Type check failed in signature for inject_mite_functions: %s should be %s", "\$_{\"x_pkg\"}", "Optional[Object]") 0 0 0
518  
519 package Mite::Shim;
520 115 ▶ use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
521 0 Scalar::Util::blessed( $in{"x_pkg"} );
522 }
523 )
524 or croak(
525 "Type check failed in signature for inject_mite_functions: %s should be %s",
526 "\$_{\"x_pkg\"}", "Optional[Object]"
527 );
528 0 $out{"x_pkg"} = $in{"x_pkg"};
529 0 delete( $in{"x_pkg"} );
530 }
531  
532 # Unrecognized parameters
533 croak(
534 119 ▶ "Failure in signature for inject_mite_functions: "
Branch: 2 branches
BranchTrueFalseTotal
if keys %in 0 119 119
keys %in > 1 ? : 0 0 0
535 . sprintf(
536 q{Unrecognized parameter%s: %s},
537 keys(%in) > 1 ? q{s} : q{},
538 join q{, } => ( sort keys %in )
539 )
540 ) if keys %in;
541  
542 119 do {
543 @_ = (
544 @head, $out{"package"}, $out{"file"}, $out{"kind"},
545 119 $out{"arg"}, $out{"shim"}, $out{"x_source"}, $out{"x_pkg"}
546 );
547 119 goto $__NEXT__;
548 };
549 115 };
550  
551 83 ▶ $SIGNATURE_FOR{"load_files"} = sub {
Subroutine __ANON__: called CC=6 SCAR=18.4
552 83 my $__NEXT__ = shift;
553  
554 83 my ( %tmp, $tmp, @head );
555  
556 83 ▶ @_ >= 2 && @_ <= 3
Branch: 1 branch
BranchTrueFalseTotal
@_ >= 2 and @_ <= 3 or croak("Wrong number of parameters in signature for %s: got %d, %s", "load_files", scalar @_, "expected exactly 2 parameters") 83 0 83
Condition33%1/3
@_ >= 2 and @_ <= 3
!ll&&!rl&&r
0083
MC/DC0%0/2
@_ >= 2 and @_ <= 3
@_ >= 2 @_ <= 3
Truth table33%1/3
A and B
A= @_ >= 2B= @_ <= 3
ABresult
0X0
100
111
557 or
558 croak( "Wrong number of parameters in signature for %s: got %d, %s",
559 "load_files", scalar(@_), "expected exactly 2 parameters" );
560  
561 83 @head = splice( @_, 0, 1 );
562  
563 # Parameter invocant (type: Defined)
564 83 ▶ ( defined( $head[0] ) )
Branch: 1 branch
BranchTrueFalseTotal
defined $head[0] or croak("Type check failed in signature for load_files: %s should be %s", "\$_[0]", "Defined") 83 0 83
565 or croak(
566 "Type check failed in signature for load_files: %s should be %s",
567 "\$_[0]", "Defined" );
568  
569 # Parameter $_[0] (type: ArrayRef)
570 83 ▶ ( ref( $_[0] ) eq 'ARRAY' )
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] eq "ARRAY" or croak("Type check failed in signature for load_files: %s should be %s", "\$_[1]", "ArrayRef") 83 0 83
571 or croak(
572 "Type check failed in signature for load_files: %s should be %s",
573 "\$_[1]", "ArrayRef" );
574  
575 # Parameter $_[1] (type: Any)
576 $#_ >= 1
577 83 ▶ or do { @_ = ( @head, @_ ); goto $__NEXT__ };
Branch: 1 branch
BranchTrueFalseTotal
$#_ >= 1 or do { @_ = (@head, @_); goto $__NEXT__ } 5 78 83
578 5 1; # ... nothing to do
579  
580 5 do { @_ = ( @head, @_ ); goto $__NEXT__ };
581 115 };
582  
583 115 1;
584 }
« lib/Mite/App/Command/exec.pm ↑ Summary lib/Mite/App/Command/clean.pm.mite.pm »