ChainedAttributes/Role/GenerateAccessor.pm

filter: Statementstmt 100% 25 / 25 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 97.0% 33 / 34 CC 3 SCAR 4.5
CC
3
Cov
97%
__ANON__
2.0
__ANON__
2.0
BEGIN
1.0
CRAP 1.6
« ChainedAttributes.pm ↑ Summary
1 package MooX::ChainedAttributes::Role::GenerateAccessor;
2 1 ▶use 5.008001;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 our $VERSION = '0.08';
5  
6 1 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 15 ▶around is_simple_set => sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
9 15 my $orig = shift;
10 15 my $self = shift;
11 15 my ($attr, $spec) = @_;
12 return 0
13 15 ▶ if $spec->{chained};
Branch: 1 branch
BranchTrueFalseTotal
if $spec->{"chained"} 6 9 15
14 9 $self->$orig(@_);
15 1 };
16  
17 6 ▶around _generate_set => sub {
Subroutine __ANON__: called CC=2 SCAR=7.0
18 6 my $orig = shift;
19 6 my $self = shift;
20 6 my ($attr, $spec) = @_;
21 6 my $chained = $spec->{chained};
22 6 local $spec->{chained};
23 6 my $set = $self->$orig(@_);
24 6 ▶ return $set
Branch: 1 branch
BranchTrueFalseTotal
unless $chained 0 6 6
25 if !$chained;
26  
27 6 "(scalar ($set, \$_[0]))";
28 1 };
29  
30 1 1;
« ChainedAttributes.pm ↑ Summary