blib/lib/MooseX/Does/Delegated.pm

filter: Statementstmt 95.2% 40 / 42 Branchbran 50.0% 8 / 16 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 11 / 11 Podpod n/a totaltotal 81.0% 60 / 74 CC 11 SCAR 21.1
CC
11
Cov
80%
__ANON__
16.1
import
2.0
BEGIN
1.0
CRAP 8.3
↑ Summary
1 package MooseX::Does::Delegated;
2  
3 2 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use if $] < 5.010, 'UNIVERSAL::DOES';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 $MooseX::Does::Delegated::AUTHORITY = 'cpan:TOBYINK';
10 2 $MooseX::Does::Delegated::VERSION = '0.004';
11 }
12  
13 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 2 ▶around DOES => sub {
Subroutine __ANON__: called CC=10 SCAR=27.8
16 2 my ($orig, $self, $role) = @_;
17 2 ▶ return 1 if $self->$orig($role);
Branch: 1 branch
BranchTrueFalseTotal
if $self->$orig($role) 1 1 2
18 1 ▶ return unless blessed($self);
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($self) 0 1 1
19 1 for my $attr ($self->meta->get_all_attributes) {
20 1 ▶ next unless $attr->has_handles;
Branch: 1 branch
BranchTrueFalseTotal
unless $attr->has_handles 0 1 1
21 1 my $handles = $attr->handles;
22 1 ▶ next if ref $handles;
Branch: 1 branch
BranchTrueFalseTotal
if ref $handles 0 1 1
23 1 ▶ next unless $attr->has_value($self) || $attr->is_lazy;
Branch: 1 branch
BranchTrueFalseTotal
unless $attr->has_value($self) or $attr->is_lazy 0 1 1
Condition33%1/3
$attr->has_value($self) or $attr->is_lazy
l!l&&r!l&&!r
010
MC/DC0%0/2
$attr->has_value($self) or $attr->is_lazy
$attr->has_value($self) $attr->is_lazy
Truth table33%1/3
A or B
A= $attr->has_value($self)B= $attr->is_lazy
ABresult
1X1
011
000
24 1 ▶ return 1 if $role eq $handles;
Branch: 1 branch
BranchTrueFalseTotal
if $role eq $handles 1 0 1
25 0 ▶ return 1 if Class::MOP::class_of($handles)->does_role($role);
Branch: 1 branch
BranchTrueFalseTotal
if Class::MOP::class_of($handles)->does_role($role) 0 0 0
26 }
27 0 return;
28 2 };
29  
30 # Allow import method to work, yet hide it from role method list.
31 2 our @ISA = do {
32 package # Hide from CPAN indexer too.
33 MooseX::Does::Delegated::__ANON__::0001;
34 2 ▶ use Moose::Util qw(ensure_all_roles);
Subroutine BEGIN: called CC=1 SCAR=0.0
35 1 ▶ sub import {
Subroutine import: called CC=2 SCAR=7.0
36 2 ▶ no warnings qw(uninitialized);
Subroutine BEGIN: called CC=1 SCAR=0.0
37 1 my $class = shift;
38 1 ▶ ensure_all_roles('Moose::Object', $class)
Branch: 1 branch
BranchTrueFalseTotal
if $_[0] =~ /^[-](?:everywhere|rafl)/ 0 1 1
39 if $_[0] =~ /^[-](?:everywhere|rafl)/;
40 }
41 2 __PACKAGE__;
42 };
43  
44 2 ▶no Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
45  
46 2 __PACKAGE__
47 __END__
↑ Summary