Declare/Controller/QualifyClassNames.pm

filter: Statementstmt 79.4% 27 / 34 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 91.6% 11 / 12 Podpod n/a totaltotal 66.6% 38 / 57 CC 6 SCAR 25.9
CC
6
Cov
63%
__ANON__
36.0
__ANON__
1.1
BEGIN
1.1
CRAP 13.4
« Declare/Dispatching/ChainTypeSensitivity.pm ↑ Summary Declare/Controller/ActionPreparation.pm »
1 15 ▶use MooseX::Declare;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 15 ▶use Class::MOP;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 15 ▶use Class::Inspector;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 15 ▶role CatalystX::Declare::Controller::QualifyClassNames {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=1.3
7  
8 15 ▶ use Carp qw( croak );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶ method _qualify_class_name (Str $type, Str $name) {
Subroutine BEGIN: called CC=1 SCAR=1.2
Subroutine __ANON__: not called CC=6 SCAR=35.8
11  
12 0 ▶ my $app = ref($self->_application) || $self->_application;
Condition0%0/3
ref $self->_application || $self->_application
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $self->_application || $self->_application
ref $self->_application $self->_application
Truth table0%0/3
A || B
A= ref $self->_applicationB= $self->_application
ABresult
1X1
011
000
13  
14 0 my @possibilities = (
15 join('::', $app, $type, $name),
16 join('::', 'Catalyst', $type, $name),
17 $name,
18 );
19  
20 0 for my $class (@possibilities) {
21  
22 0 ▶ return $class
Branch: 1 branch
BranchTrueFalseTotal
if Class::MOP::is_class_loaded($class) 0 0 0
23 if Class::MOP::is_class_loaded($class);
24  
25 0 ▶ return $class
Branch: 1 branch
BranchTrueFalseTotal
if "Class::Inspector"->installed($class) 0 0 0
26 if Class::Inspector->installed($class);
27 }
28  
29 0 ▶ croak sprintf q(Unable to locate %s %s named '%s', tried: %s),
Branch: 1 branch
BranchTrueFalseTotal
$type =~ /^[aeiuo]/i ? : 0 0 0
30 ($type =~ /^[aeiuo]/i ? 'an' : 'a'),
31 $type,
32 $name,
33 join(', ', @possibilities),
34 ;
35 15 }
36 15 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
37  
38 15 1;
« Declare/Dispatching/ChainTypeSensitivity.pm ↑ Summary Declare/Controller/ActionPreparation.pm »