Circle/Widget/Box.pm

filter: Statementstmt 76.6% 23 / 30 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 3 totaltotal 65.9% 29 / 44 CC 3 SCAR 15.4
CC
3
Cov
68%
add_spacer
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.7
« Circle/Command.pm ↑ Summary Circle/CommandInvocation.pm »
1 # You may distribute under the terms of the GNU General Public License
2 #
3 # (C) Paul Evans, 2008-2010 -- leonerd@leonerd.org.uk
4  
5 package Circle::Widget::Box;
6  
7 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 ▶use base qw( Circle::Widget );
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 4 our $VERSION = '0.173320';
12  
13 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 sub new
16 3 ▶{
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
17 3 my $class = shift;
18 3 my %args = @_;
19  
20 3 my $self = $class->SUPER::new( @_ );
21  
22 3 $self->set_prop_orientation( $args{orientation} );
23  
24 3 return $self;
25 }
26  
27 sub add
28 6 ▶{
Subroutine add: called CC=1 SCAR=0.0
Pod undocumented
29 6 my $self = shift;
30 6 my ( $child, %opts ) = @_;
31  
32 6 $opts{child} = $child;
33 6 $self->push_prop_children( \%opts );
34 }
35  
36 sub add_spacer
37 0 ▶{
Subroutine add_spacer: not called CC=3 SCAR=24.8
Pod undocumented
38 0 my $self = shift;
39 0 my ( %opts ) = @_;
40  
41 # TODO: For now, only allow one spacer, and it must be in expand mode
42 0 ▶ croak "Already have one spacer, can't add another" if grep { !$_->{child} } @{ $self->get_prop_children };
Branch: 1 branch
BranchTrueFalseTotal
if grep {not $_->{"child"};} @{$self->get_prop_children;} 0 0 0
43 0 ▶ croak "Spacer must be in expand mode" if !$opts{expand};
Branch: 1 branch
BranchTrueFalseTotal
unless $opts{"expand"} 0 0 0
44  
45 0 $self->push_prop_children( \%opts );
46 }
47  
48 4 0x55AA;
« Circle/Command.pm ↑ Summary Circle/CommandInvocation.pm »