Chart/GGPlot/Geom/Line.pm

filter: Statementstmt 100% 42 / 42 Branchbran 50.0% 9 / 18 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 79.7% 59 / 74 CC 11 SCAR 15.5
CC
11
Cov
83%
__ANON__
8.2
ggplot_functions
3.1
setup_data
3.1
CRAP 4.7
« Chart/GGPlot/Scale/ContinuousDateTime.pm ↑ Summary Chart/GGPlot/Geom/Polygon.pm »
1 package Chart::GGPlot::Geom::Line;
2  
3 # ABSTRACT: Class for line geom
4  
5 5 ▶use Chart::GGPlot::Class qw(:pdl);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 5 extends qw(Chart::GGPlot::Geom::Path);
9  
10 5 our $VERSION = '0.002003'; # VERSION
11  
12 5 ▶use Chart::GGPlot::Layer;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 5 ▶use Chart::GGPlot::Util::Pod qw(layer_func_pod);
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 5 my $geom_line_pod = layer_func_pod(<<'EOT');
16  
17 geom_line(:$mapping=undef, :$data=undef, :$stat='identity',
18 :$position='identity', :$na_rm=false, :$show_legend=undef,
19 :$inherit_aes=true,
20 %rest)
21  
22 The "line" geom connects the observations in the order of the variable
23 on the x axis.
24  
25 Arguments:
26  
27 =over 4
28  
29 %TMPL_COMMON_ARGS%
30  
31 =back
32  
33 EOT
34  
35 1 ▶my $geom_line_code = fun (
Subroutine __ANON__: called CC=7 SCAR=21.1
Branch: 1 branch
BranchTrueFalseTotal
@_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") 0 1 1
Condition33%1/3
@_ > 0 and @_ % 2
!ll&&!rl&&r
100
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0 @_ % 2
Truth table33%1/3
A and B
A= @_ > 0B= @_ % 2
ABresult
0X0
100
111
36 :$mapping = undef, :$data = undef,
37 :$stat = 'identity', :$position = 'identity',
38 :$na_rm = false,
39 :$show_legend = undef, :$inherit_aes = true,
40 %rest )
41 1 ▶{
Branch: 4 branches
BranchTrueFalseTotal
exists $rest{'stat'} ? : 0 1 1
exists $rest{'position'} ? : 0 1 1
exists $rest{'na_rm'} ? : 0 1 1
exists $rest{'inherit_aes'} ? : 0 1 1
42 1 return Chart::GGPlot::Layer->new(
43 data => $data,
44 mapping => $mapping,
45 stat => $stat,
46 position => $position,
47 show_legend => $show_legend,
48 inherit_aes => $inherit_aes,
49 geom => 'line',
50 params => { na_rm => $na_rm, %rest },
51 );
52 5 };
53  
54 5 ▶classmethod ggplot_functions() {
Subroutine ggplot_functions: called CC=3 SCAR=11.3
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for classmethod ggplot_functions (expected 1, got ' . @_ . ')') 0 5 5
@_ > 1 and Function::Parameters::_croak('Too many arguments for classmethod ggplot_functions (expected 1, got ' . @_ . ')') 0 5 5
55 return [
56 {
57 5 name => 'geom_line',
58 code => $geom_line_code,
59 pod => $geom_line_pod,
60 }
61 ];
62 5 }
63  
64 1 ▶method setup_data ($data, $params) {
Subroutine setup_data: called CC=3 SCAR=11.2
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 3 and Function::Parameters::_croak('Too few arguments for method setup_data (expected 3, got ' . @_ . ')') 0 1 1
@_ > 3 and Function::Parameters::_croak('Too many arguments for method setup_data (expected 3, got ' . @_ . ')') 0 1 1
65 1 return $data->sort( [qw(PANEL group x)] );
66 5 }
67  
68 5 __PACKAGE__->meta->make_immutable( inline_constructor => 0 );
69  
70 5 1;
71  
72 __END__
« Chart/GGPlot/Scale/ContinuousDateTime.pm ↑ Summary Chart/GGPlot/Geom/Polygon.pm »