Chart/GGPlot/Scale/Positional.pm

filter: Statementstmt 100% 31 / 31 Branchbran 58.3% 7 / 12 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 87.5% 49 / 56 CC 8 SCAR 12.8
CC
8
Cov
87%
axis_order
5.1
break_positions
4.2
BEGIN
1.0
CRAP 3.6
« Chart/GGPlot/Geom/Point.pm ↑ Summary Chart/GGPlot/HasParams.pm »
1 package Chart::GGPlot::Scale::Positional;
2  
3 # ABSTRACT: Role for positional scale
4  
5 4 ▶use Chart::GGPlot::Role qw(:pdl);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 our $VERSION = '0.002003'; # VERSION
9  
10 4 ▶use Chart::GGPlot::Types qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use Types::Standard qw(ArrayRef CodeRef Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14 4 has position => ( is => 'rw', isa => PositionEnum, default => "left" );
15  
16  
17 4 ▶method break_positions ($range=$self->get_limits()) {
Subroutine break_positions: called CC=4 SCAR=14.5
Pod documented
Branch: 3 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for method break_positions (expected 1, got ' . @_ . ')') 0 4 4
@_ > 2 and Function::Parameters::_croak('Too many arguments for method break_positions (expected 2, got ' . @_ . ')') 0 4 4
@_ < 1 and $range = $self->get_limits 4 0 4
18 4 return $self->map_to_limits( $self->get_breaks($range) );
19 4 }
20  
21 12 ▶method axis_order () {
Subroutine axis_order: called CC=5 SCAR=16.4
Pod documented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for method axis_order (expected 1, got ' . @_ . ')') 0 12 12
@_ > 1 and Function::Parameters::_croak('Too many arguments for method axis_order (expected 1, got ' . @_ . ')') 0 12 12
22 12 my @ord = qw(primary secondary);
23 12 ▶ if ( $self->position eq 'right' or $self->position eq 'bottom' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->position eq "right" or $self->position eq "bottom") 6 6 12
Condition66%2/3
$self->position eq "right" or $self->position eq "bottom"
l!l&&r!l&&!r
066
MC/DC50%1/2
$self->position eq "right" or $self->position eq "bottom"
$self->position eq "right" $self->position eq "bottom"
Truth table66%2/3
A or B
A= $self->position eq "right"B= $self->position eq "bottom"
ABresult
1X1
011
000
24 6 @ord = reverse @ord;
25 }
26 12 return \@ord;
27 4 }
28  
29 4 1;
30  
31 __END__
« Chart/GGPlot/Geom/Point.pm ↑ Summary Chart/GGPlot/HasParams.pm »