Chart/GGPlot/Scale/ContinuousDateTime.pm

filter: Statementstmt 92.4% 49 / 53 Branchbran 50.0% 10 / 20 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 2 totaltotal 74.4% 70 / 94 CC 13 SCAR 15.8
CC
13
Cov
77%
break_info
8.0
:around
6.3
map_to_limits
4.2
CRAP 4.9
« Chart/GGPlot/Scale.pm ↑ Summary Chart/GGPlot/Geom/Line.pm »
1 package Chart::GGPlot::Scale::ContinuousDateTime;
2  
3 # ABSTRACT: Continuous datetime scale
4  
5 1 ▶use Chart::GGPlot::Class qw(:pdl);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = '0.002003'; # VERSION
9  
10 1 ▶use Types::PDL qw(Piddle PiddleFromAny);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Types::Standard qw(InstanceOf Maybe);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Chart::GGPlot::Trans::Functions qw(time_trans);
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use Chart::GGPlot::Util qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 extends qw(
17 Chart::GGPlot::Scale::Continuous
18 );
19  
20 1 has timezone => (is => 'rwp');
21  
22 1 with qw(
23 Chart::GGPlot::Scale::Positional
24 Chart::GGPlot::Scale::SupportsSecondaryAxis
25 );
26  
27 1 ▶around transform($p) {
Subroutine :around: called CC=5 SCAR=18.3
Branch: 2 branches
BranchTrueFalseTotal
@_ < 3 and Function::Parameters::_croak('Too few arguments for around transform (expected 3, got ' . @_ . ')') 0 1 1
@_ > 3 and Function::Parameters::_croak('Too many arguments for around transform (expected 3, got ' . @_ . ')') 0 1 1
28 1 my $tz = $p->$_can('timezone');
29 1 ▶ if (not defined $self->timezone and defined $tz) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $self->timezone and defined $tz) 0 1 1
Condition33%1/3
not defined $self->timezone and defined $tz
!ll&&!rl&&r
010
MC/DC0%0/2
not defined $self->timezone and defined $tz
not defined $self->timezone defined $tz
Truth table33%1/3
not(A) and B
A= not defined $self->timezoneB= defined $tz
ABresult
0X0
100
111
30 0 $self->_set_timezone($tz);
31 0 $self->trans(time_trans($self->timezone));
32 }
33 1 return $self->$orig($p);
34 1 }
35  
36 2 ▶method map_to_limits ( $p, $limits = $self->get_limits ) {
Subroutine map_to_limits: called CC=4 SCAR=14.5
Pod undocumented
Branch: 3 branches
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for method map_to_limits (expected 2, got ' . @_ . ')') 0 2 2
@_ > 3 and Function::Parameters::_croak('Too many arguments for method map_to_limits (expected 3, got ' . @_ . ')') 0 2 2
@_ < 2 and $limits = $self->get_limits 2 0 2
37 2 return $self->oob->( $p, $limits );
38 1 }
39  
40 1 ▶method break_info ($range = null()) {
Subroutine break_info: called CC=6 SCAR=20.8
Pod undocumented
Branch: 3 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for method break_info (expected 1, got ' . @_ . ')') 0 1 1
@_ > 2 and Function::Parameters::_croak('Too many arguments for method break_info (expected 2, got ' . @_ . ')') 0 1 1
@_ < 1 and $range = null() 0 1 1
41 1 my $breaks = $self->SUPER::break_info($range);
42 1 ▶ if ( defined $self->secondary_axis
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->secondary_axis and not $self->secondary_axis->empty) 0 1 1
Condition33%1/3
defined $self->secondary_axis and not $self->secondary_axis->empty
!ll&&!rl&&r
100
MC/DC0%0/2
defined $self->secondary_axis and not $self->secondary_axis->empty
defined $self->secondary_axis not $self->secondary_axis->empty
Truth table33%1/3
A and not(B)
A= defined $self->secondary_axisB= not $self->secondary_axis->empty
ABresult
0X0
100
111
43 and not $self->secondary_axis->empty() )
44 {
45 0 $self->secondary_axis->init($self);
46 0 $breaks = [
47 $breaks->flatten,
48 $self->secondary_axis->break_info( $breaks->range, $self )->flatten
49 ];
50 }
51 1 return $breaks;
52 1 }
53  
54 1 __PACKAGE__->meta->make_immutable;
55  
56 1 1;
57  
58 __END__
« Chart/GGPlot/Scale.pm ↑ Summary Chart/GGPlot/Geom/Line.pm »