blib/lib/Rose/HTML/Object/WithWrapAroundChildren.pm

filter: Statementstmt 100% 28 / 28 Branchbran 68.7% 11 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 5 totaltotal 82.4% 47 / 57 CC 9 SCAR 10.7
CC
9
Cov
89%
pop_children
4.1
shift_children
4.1
children
3.0
CRAP 2.9
« blib/lib/Rose/HTML/Image.pm ↑ Summary blib/lib/Rose/HTML/Form/Field/DateTime/Split/MonthDayYear.pm »
1 package Rose::HTML::Object::WithWrapAroundChildren;
2  
3 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 13 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 13 our $VERSION = '0.554';
8  
9 use Rose::HTML::Object::MakeMethods::Generic
10 13 ▶(
Subroutine BEGIN: called CC=1 SCAR=0.0
11 13 array =>
12 [
13 'pre_children' => {},
14 'shift_pre_children' => { interface => 'shift', hash_key => 'pre_children' },
15 'unshift_pre_children' => { interface => 'unshift', hash_key => 'pre_children' },
16 'pop_pre_children' => { interface => 'pop', hash_key => 'pre_children' },
17 'push_pre_children' => { interface => 'push', hash_key => 'pre_children' },
18 'delete_pre_children' => { interface => 'clear', hash_key => 'pre_children' },
19  
20 'post_children' => {},
21 'shift_post_children' => { interface => 'shift', hash_key => 'post_children' },
22 'unshift_post_children' => { interface => 'unshift', hash_key => 'post_children' },
23 'push_post_children' => { interface => 'push', hash_key => 'post_children' },
24 'pop_post_children' => { interface => 'pop', hash_key => 'post_children' },
25 'delete_post_children' => { interface => 'clear', hash_key => 'post_children' },
26 ],
27 13 );
28  
29 sub children
30 1197 ▶{
Subroutine children: called CC=3 SCAR=11.1
Pod undocumented
31 1197 my($self) = shift;
32 1197 ▶ Carp::croak "Cannot directly set children() for a ", ref($self),
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 1197 1197
33 ". Use fields(), push_children(), pop_children(), etc." if(@_);
34 1197 ▶ return wantarray ? ($self->pre_children, $self->immutable_children(), $self->post_children) :
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 599 598 1197
35 [ $self->pre_children, $self->immutable_children(), $self->post_children ];
36 }
37  
38 4 ▶sub push_children { shift->push_post_children(@_) }
Subroutine push_children: called CC=1 SCAR=0.0
Pod undocumented
39  
40 sub pop_children
41 4 ▶{
Subroutine pop_children: called CC=4 SCAR=14.0
Pod undocumented
42 4 my($self) = shift;
43  
44 4 ▶ my $num = @_ ? shift : 1;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 4 4
45 4 my @children = $self->pop_post_children($num);
46  
47 4 ▶ if(@children < $num)
Branch: 1 branch
BranchTrueFalseTotal
if (@children < $num) 1 3 4
48 {
49 1 push(@children, $self->pop_pre_children($num - @children));
50 }
51  
52 4 ▶ return @children == 1 ? $children[0] : @children;
Branch: 1 branch
BranchTrueFalseTotal
@children == 1 ? : 4 0 4
53 }
54  
55 sub shift_children
56 2 ▶{
Subroutine shift_children: called CC=4 SCAR=14.0
Pod undocumented
57 2 my($self) = shift;
58  
59 2 ▶ my $num = @_ ? shift : 1;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 2 2
60 2 my @children = $self->shift_pre_children($num);
61  
62 2 ▶ if(@children < $num)
Branch: 1 branch
BranchTrueFalseTotal
if (@children < $num) 1 1 2
63 {
64 1 push(@children, $self->shift_post_children($num - @children));
65 }
66  
67 2 ▶ return @children == 1 ? $children[0] : @children;
Branch: 1 branch
BranchTrueFalseTotal
@children == 1 ? : 2 0 2
68 }
69  
70 3 ▶sub unshift_children { shift->unshift_pre_children(@_) }
Subroutine unshift_children: called CC=1 SCAR=0.0
Pod undocumented
71  
72 13 1;
« blib/lib/Rose/HTML/Image.pm ↑ Summary blib/lib/Rose/HTML/Form/Field/DateTime/Split/MonthDayYear.pm »