Chart/GGPlot/Stat/Identity.pm

filter: Statementstmt 77.2% 34 / 44 Branchbran 25.0% 4 / 16 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 2 totaltotal 60.0% 45 / 75 CC 10 SCAR 27.9
CC
10
Cov
60%
__ANON__
42.0
ggplot_functions
3.1
compute_layer
3.1
CRAP 16.2
« Chart/GGPlot/Built.pm ↑ Summary Chart/GGPlot/Geom/Boxplot.pm »
1 package Chart::GGPlot::Stat::Identity;
2  
3 # ABSTRACT: Statistic method that does identity
4  
5 7 ▶use Chart::GGPlot::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 7 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 7 ▶use MooseX::Singleton;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 7 our $VERSION = '0.002003'; # VERSION
10  
11 7 ▶use Chart::GGPlot::Layer;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 7 ▶use Chart::GGPlot::Util::Pod qw(layer_func_pod);
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 7 with qw(
15 Chart::GGPlot::Stat
16 );
17  
18 7 my $stat_identity_pod = layer_func_pod(<<'EOT');
19  
20 stat_identity(:$mapping=undef, :$data=undef,
21 :$geom="point", :$position="identity",
22 :$show_legend=undef, :$inherit_aes=true,
23 %rest)
24  
25 Arguments:
26  
27 =over 4
28  
29 %TMPL_COMMON_ARGS%
30  
31 =back
32  
33 EOT
34  
35 0 ▶my $stat_identity_code = fun (
Subroutine __ANON__: not called CC=6 SCAR=37.4
Branch: 1 branch
BranchTrueFalseTotal
@_ > 0 and @_ % 2 and Function::Parameters::_croak("Odd number of paired arguments for fun (anon)") 0 0 0
Condition0%0/3
@_ > 0 and @_ % 2
!ll&&!rl&&r
000
MC/DC0%0/2
@_ > 0 and @_ % 2
@_ > 0 @_ % 2
Truth table0%0/3
A and B
A= @_ > 0B= @_ % 2
ABresult
0X0
100
111
36 :$mapping = undef, :$data = undef,
37 :$geom = "point", :$position = "identity",
38 :$show_legend = undef, :$inherit_aes = true,
39 %rest )
40 0 ▶{
Branch: 3 branches
BranchTrueFalseTotal
exists $rest{'geom'} ? : 0 0 0
exists $rest{'position'} ? : 0 0 0
exists $rest{'inherit_aes'} ? : 0 0 0
41 0 return Chart::GGPlot::Layer->new(
42 mapping => $mapping,
43 data => $data,
44 stat => 'identify',
45 position => $position,
46 show_legend => $show_legend,
47 inherit_aes => $inherit_aes,
48 geom => 'blank',
49 params => { na_rm => false, %rest },
50 );
51 7 };
52  
53 7 ▶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 7 7
@_ > 1 and Function::Parameters::_croak('Too many arguments for classmethod ggplot_functions (expected 1, got ' . @_ . ')') 0 7 7
54 return [
55 {
56 7 name => 'stat_identity',
57 code => $stat_identity_code,
58 pod => $stat_identity_pod,
59 }
60 ];
61 7 }
62  
63 4 ▶method compute_layer( $data, $params, $layout ) {
Subroutine compute_layer: called CC=3 SCAR=11.2
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 4 and Function::Parameters::_croak('Too few arguments for method compute_layer (expected 4, got ' . @_ . ')') 0 4 4
@_ > 4 and Function::Parameters::_croak('Too many arguments for method compute_layer (expected 4, got ' . @_ . ')') 0 4 4
64 4 return $data;
65 7 }
66  
67 7 __PACKAGE__->meta->make_immutable;
68  
69 7 1;
70  
71 __END__
« Chart/GGPlot/Built.pm ↑ Summary Chart/GGPlot/Geom/Boxplot.pm »