Chart/GGPlot/Theme/Element.pm

filter: Statementstmt 84.0% 105 / 125 Branchbran 20.0% 2 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.7% 31 / 37 Podpod 25.0% 1 / 4 totaltotal 78.9% 139 / 176 CC 6 SCAR 9.3
CC
6
Cov
79%
string
12.0
parameters
9.6
transform_key
2.0
CRAP 2.5
« Chart/GGPlot/Theme/Rel.pm ↑ Summary Chart/GGPlot/Labels/Functions.pm »
1 package Chart::GGPlot::Theme::Element;
2  
3 # ABSTRACT: Basic types for theme elements
4  
5 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 our $VERSION = '0.002003'; # VERSION
9  
10 3 package Chart::GGPlot::Theme::Element {
11 3 ▶ use Chart::GGPlot::Setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 3 ▶ use Function::Parameters qw(classmethod);
Subroutine BEGIN: called CC=1 SCAR=0.0
13 3 ▶ use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 3 ▶ use parent qw(Chart::GGPlot::Params);
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 848 ▶ sub transform_key {
Subroutine transform_key: called CC=2 SCAR=6.9
Pod documented
18 848 my ( $class, $key ) = @_;
19 848 ▶ return 'color' if $key eq 'colour';
Branch: 1 branch
BranchTrueFalseTotal
if $key eq "colour" 1 847 848
20 847 return $key;
21 }
22  
23 3 ▶ sub parameters { [] }
Subroutine parameters: called CC=1 SCAR=0.0
Pod undocumented
24  
25 0 ▶ sub is_blank { false }
Subroutine is_blank: not called CC=1 SCAR=6.9
Pod undocumented
26  
27 0 ▶ method string () {
Subroutine string: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for method string (expected 1, got ' . @_ . ')') 0 0 0
@_ > 1 and Function::Parameters::_croak('Too many arguments for method string (expected 1, got ' . @_ . ')') 0 0 0
28 0 return Dumper($self);
29 3 }
30  
31 }
32  
33 3 package Chart::GGPlot::Theme::Element::Blank {
34 3 ▶ use Chart::GGPlot::Setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 3 ▶ use Function::Parameters qw(classmethod);
Subroutine BEGIN: called CC=1 SCAR=0.0
36 3 ▶ use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
37  
38 3 ▶ use parent qw(Chart::GGPlot::Theme::Element);
Subroutine BEGIN: called CC=1 SCAR=0.0
39  
40 0 ▶ classmethod parameters () { [] }
Subroutine parameters: not called CC=3 SCAR=22.6
Branch: 2 branches
BranchTrueFalseTotal
@_ < 1 and Function::Parameters::_croak('Too few arguments for classmethod parameters (expected 1, got ' . @_ . ')') 0 0 0
@_ > 1 and Function::Parameters::_croak('Too many arguments for classmethod parameters (expected 1, got ' . @_ . ')') 0 0 0
41  
42 0 ▶ sub is_blank { true }
Subroutine is_blank: not called CC=1 SCAR=6.9
43 }
44  
45 3 package Chart::GGPlot::Theme::Element::Line {
46 3 ▶ use Chart::GGPlot::Setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
47 3 ▶ use Function::Parameters qw(classmethod);
Subroutine BEGIN: called CC=1 SCAR=0.0
48 3 ▶ use Class::Method::Modifiers;
Subroutine BEGIN: called CC=1 SCAR=0.0
49 3 ▶ use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
50  
51 3 ▶ use parent qw(Chart::GGPlot::Theme::Element);
Subroutine BEGIN: called CC=1 SCAR=0.0
52  
53 3 ▶ use Types::Standard;
Subroutine BEGIN: called CC=1 SCAR=0.0
54  
55 0 ▶ around parameters => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
56 0 my $orig = shift;
57 0 my $class = shift;
58 return [
59 qw(color size linetype lineend inherit_blank),
60 0 @{ $class->$orig() }
61 ];
62 3 };
63 }
64  
65 3 package Chart::GGPlot::Theme::Element::Rect {
66 3 ▶ use Chart::GGPlot::Setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
67 3 ▶ use Function::Parameters qw(classmethod);
Subroutine BEGIN: called CC=1 SCAR=0.0
68 3 ▶ use Class::Method::Modifiers;
Subroutine BEGIN: called CC=1 SCAR=0.0
69 3 ▶ use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
70  
71 3 ▶ use parent qw(Chart::GGPlot::Theme::Element);
Subroutine BEGIN: called CC=1 SCAR=0.0
72  
73 3 ▶ use Types::Standard;
Subroutine BEGIN: called CC=1 SCAR=0.0
74  
75 3 ▶ use Chart::GGPlot::Util qw(pt);
Subroutine BEGIN: called CC=1 SCAR=0.0
76  
77 0 ▶ around parameters => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
78 0 my $orig = shift;
79 0 my $class = shift;
80 return [ qw(fill color size linetype inherit_blank),
81 0 @{ $class->$orig() } ];
82 }
83 3 }
84  
85 3 package Chart::GGPlot::Theme::Element::Text {
86  
87 3 ▶ use Chart::GGPlot::Setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
88 3 ▶ use Function::Parameters qw(classmethod);
Subroutine BEGIN: called CC=1 SCAR=0.0
89 3 ▶ use Class::Method::Modifiers;
Subroutine BEGIN: called CC=1 SCAR=0.0
90 3 ▶ use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
91  
92 3 our $VERSION = '0.002003'; # VERSION
93  
94 3 ▶ use parent qw(Chart::GGPlot::Theme::Element);
Subroutine BEGIN: called CC=1 SCAR=0.0
95  
96 3 ▶ around parameters => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
97 3 my $orig = shift;
98 3 my $class = shift;
99 return [
100 qw(
101 family face color size hjust vjust
102 angle lineheight inherit_blank
103 ),
104 3 @{ $class->$orig() }
105 ];
106 3 };
107 }
108  
109 3 1;
110  
111 __END__
« Chart/GGPlot/Theme/Rel.pm ↑ Summary Chart/GGPlot/Labels/Functions.pm »