Chart/GGPlot/Guide/Legend.pm

filter: Statementstmt 42.8% 12 / 28 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 28.3% 15 / 53 CC 7 SCAR 35.9
CC
7
Cov
29%
train
56.0
BUILD
2.0
BEGIN
1.0
CRAP 36.1
« Chart/GGPlot/Stat/Bin.pm ↑ Summary Chart/GGPlot/Geom/Smooth.pm »
1 package Chart::GGPlot::Guide::Legend;
2  
3 # ABSTRACT: Legend guide
4  
5 2 ▶use Chart::GGPlot::Setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = '0.002003'; # VERSION
8  
9 2 ▶use parent qw(Chart::GGPlot::Guide);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 ▶use Data::Frame;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 0 ▶sub BUILD {
Subroutine BUILD: not called CC=1 SCAR=6.9
Pod undocumented
14 0 my ($self, $args) = @_;
15  
16 0 $self->set( 'key', {} );
17 }
18  
19 0 ▶method train ($scale, $aesthetic=undef) {
Subroutine train: not called CC=7 SCAR=40.3
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 2 and Function::Parameters::_croak('Too few arguments for method train (expected 2, got ' . @_ . ')') 0 0 0
@_ > 3 and Function::Parameters::_croak('Too many arguments for method train (expected 3, got ' . @_ . ')') 0 0 0
20 0 my $breaks = $scale->get_breaks();
21 0 ▶ if ($breaks->length == 0 or $breaks->ngood == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($breaks->length == 0 or $breaks->ngood == 0) 0 0 0
Condition0%0/3
$breaks->length == 0 or $breaks->ngood == 0
l!l&&r!l&&!r
000
MC/DC0%0/2
$breaks->length == 0 or $breaks->ngood == 0
$breaks->length == 0 $breaks->ngood == 0
Truth table0%0/3
A or B
A= $breaks->length == 0B= $breaks->ngood == 0
ABresult
1X1
011
000
22 0 return;
23 }
24  
25 0 ▶ my $aes_column_name = $aesthetic // $scale->aesthetics->[0];
Condition0%0/3
$aesthetic // $scale->aesthetics->[0]
l!l&&r!l&&!r
000
MC/DC0%0/2
$aesthetic // $scale->aesthetics->[0]
$aesthetic $scale->aesthetics->[0]
Truth table0%0/3
A // B
A= $aestheticB= $scale->aesthetics->[0]
ABresult
1X1
011
000
26 0 my $key = Data::Frame->new(
27 columns => [
28 $aes_column_name => $scale->map_to_limits($breaks),
29 label => $scale->get_labels($breaks),
30 ]
31 );
32  
33 0 ▶ if ( $self->reverse ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->reverse) 0 0 0
34 0 $key = $self->_reverse_df($key);
35 }
36  
37 0 $self->set('key', $key);
38  
39 0 return $self;
40 2 }
41  
42 2 1;
43  
44 __END__
« Chart/GGPlot/Stat/Bin.pm ↑ Summary Chart/GGPlot/Geom/Smooth.pm »