Chart/GGPlot/Range/Continuous.pm

filter: Statementstmt 100% 28 / 28 Branchbran 62.5% 5 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 90.4% 38 / 42 CC 5 SCAR 11.9
CC
5
Cov
92%
train
5.1
BEGIN
1.0
BEGIN
1.0
CRAP 3.3
« Chart/GGPlot/HasParams.pm ↑ Summary Chart/GGPlot/Trans.pm »
1 package Chart::GGPlot::Range::Continuous;
2  
3 # ABSTRACT: Continuous range
4  
5 8 ▶use Chart::GGPlot::Class qw(:pdl);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 8 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 8 our $VERSION = '0.002003'; # VERSION
9  
10 8 with qw(Chart::GGPlot::Range);
11  
12 8 ▶use Types::PDL -types;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 8 ▶use Chart::GGPlot::Util qw(is_discrete range_);
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 38 ▶method train ($p) {
Subroutine train: called CC=5 SCAR=16.3
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for method train (expected 2, got ' . @_ . ')') 0 38 38
@_ > 2 and Function::Parameters::_croak('Too many arguments for method train (expected 2, got ' . @_ . ')') 0 38 38
17 38 ▶ return $self->range if $p->isnull;
Branch: 1 branch
BranchTrueFalseTotal
if $p->isnull 0 38 38
18  
19 38 ▶ if (is_discrete($p)) {
Branch: 1 branch
BranchTrueFalseTotal
if (is_discrete($p)) 1 37 38
20 1 die("Discrete value supplied to continuous scale");
21 }
22 37 my $range = range_( $self->range->glue(0, $p) );
23 37 $self->range($range);
24  
25 37 return $self->range;
26 8 }
27  
28 8 __PACKAGE__->meta->make_immutable;
29  
30 8 1;
31  
32 __END__
« Chart/GGPlot/HasParams.pm ↑ Summary Chart/GGPlot/Trans.pm »