blib/lib/CXC/Gnuplot/V0/AxisLabel.pm

filter: Statementstmt 64.1% 34 / 53 Branchbran 0.0% 0 / 30 Conditioncond 0.0% 0 / 18 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 56.2% 9 / 16 Podpod 100% 5 / 5 totaltotal 36.9% 48 / 130 CC 22 SCAR 36.4
CC
22
Cov
34%
__ANON__
72.0
to_hash
56.0
opts
56.0
CRAP 38.1
« blib/lib/CXC/Gnuplot/V0/MultiPlot.pm ↑ Summary blib/lib/CXC/Gnuplot/V1/Util.pm »
1 package CXC::Gnuplot::V0::AxisLabel;
2  
3 1 ▶use v5.38;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use experimental 'builtin';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Feature::Compat::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 our $VERSION = 'v0.29.3';
8  
9 class CXC::Gnuplot::V0::AxisLabel;
10  
11 1 ▶use builtin 'is_bool', 'false';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶no namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use Ref::Util 'is_ref', 'is_plain_arrayref';
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 1 ▶use CXC::Gnuplot::V0::Types -lexical, 'is_Num', 'is_NonEmptyStr';
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 use CXC::Gnuplot::V0::Util -lexical, 'maybe_quote', 'assert_coerce_object', 'clone_object',
21 1 ▶ 'pvalidate', 'to_hash_r', 'render_opts';
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 my sub croak {
24 0 ▶ require Carp;
Subroutine croak: not called CC=1 SCAR=6.9
25 0 goto \&Carp::croak;
26 }
27  
28  
29 #<<< notidy
30 1 field $text :param :reader = undef;
31 1 field $offset :param :reader = undef;
32 1 field $font :param :reader = undef;
33 1 field $textcolor :param :reader = undef;
34 1 field $enhanced :param :reader = undef;
35 1 field $rotate :param :reader = undef;
36 #>>>
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58 ADJUST {
59  
60 0 ▶ pvalidate( offset => CoordOffset3D => \$offset );
Subroutine __ANON__: not called CC=8 SCAR=42.8
61 0 pvalidate( font => Font => \$font );
62  
63 0 pvalidate( textcolor => ColorSpec => \$textcolor );
64  
65 0 ▶ defined $enhanced
Branch: 1 branch
BranchTrueFalseTotal
defined $enhanced and $enhanced = !!$enhanced 0 0 0
66 and $enhanced = !!$enhanced;
67  
68 0 ▶ defined $rotate
Branch: 1 branch
BranchTrueFalseTotal
defined $rotate and $rotate ne "norotate" and $rotate ne "parallel" and not builtin::is_bool($rotate) && !$rotate and not is_Num $rotate and croak "\"rotate\" must be a float or one of \"parallel\", \"norotate\", or the false boolean value" 0 0 0
Condition0%0/15
defined $rotate and $rotate ne "norotate" and $rotate ne "parallel" and not builtin::is_bool($rotate) && !$rotate and not is_Num $rotate
!ll&&!rl&&r
000
defined $rotate and $rotate ne "norotate" and $rotate ne "parallel" and not builtin::is_bool($rotate) && !$rotate
!ll&&!rl&&r
000
defined $rotate and $rotate ne "norotate" and $rotate ne "parallel"
!ll&&!rl&&r
000
defined $rotate and $rotate ne "norotate"
!ll&&!rl&&r
000
builtin::is_bool($rotate) && !$rotate
!ll&&!rl&&r
000
MC/DC0%0/6
defined $rotate and $rotate ne "norotate" and $rotate ne "parallel" and not builtin::is_bool($rotate) && !$rotate and not is_Num $rotate
defined $rotate $rotate ne "norotate" $rotate ne "parallel" builtin::is_bool($rotate) !$rotate not is_Num $rotate
Truth table0%0/8
A and B and C and not(D && not(E)) and not(F)
A= defined $rotateB= $rotate ne "norotate"C= $rotate ne "parallel"D= builtin::is_bool($rotate)E= !$rotateF= not is_Num $rotate
ABCDEFresult
0XXXXX0
10XXXX0
110XXX0
11111X0
1110X00
1111000
1110X11
1111011
69 and $rotate ne 'norotate'
70 and $rotate ne 'parallel'
71 and !( is_bool( $rotate ) && !$rotate )
72 and !is_Num( $rotate )
73 and
74 croak( '"rotate" must be a float or one of "parallel", "norotate", or the false boolean value' );
75  
76 }
77  
78  
79  
80  
81  
82 method to_hash {
83 0 ▶ to_hash_r( {
Subroutine to_hash: not called CC=7 SCAR=40.3
Pod documented
Branch: 6 branches
BranchTrueFalseTotal
defined $text ? : 0 0 0
defined $offset ? : 0 0 0
defined $font ? : 0 0 0
defined $textcolor ? : 0 0 0
defined $enhanced ? : 0 0 0
defined $rotate ? : 0 0 0
84 ( defined $text ? ( text => $text ) : () ),
85 ( defined $offset ? ( offset => $offset ) : () ),
86 ( defined $font ? ( font => $font ) : () ),
87 ( defined $textcolor ? ( textcolor => $textcolor ) : () ),
88 ( defined $enhanced ? ( enhanced => $enhanced ) : () ),
89 ( defined $rotate ? ( rotate => $rotate ) : () ),
90 } );
91 }
92  
93  
94  
95  
96  
97 ▶sub assert_coerce( $class, $args ) {
Subroutine assert_coerce: not called CC=1 SCAR=6.9
Pod documented
98 0 assert_coerce_object( $class, $args );
99 }
100  
101  
102  
103  
104  
105 ▶method clone ( %args ) {
Subroutine clone: not called CC=1 SCAR=6.9
Pod documented
106 0 return clone_object( $self, \%args );
107 }
108  
109  
110  
111  
112  
113  
114 ▶sub coerce_attrs ( $class, @attrs ) {
Subroutine coerce_attrs: not called CC=3 SCAR=24.8
Pod documented
115 0 ▶ return @attrs == 1 && !is_ref( $attrs[0] )
Branch: 1 branch
BranchTrueFalseTotal
@attrs == 1 && !Ref::Util::XS::is_ref($attrs[0]) ? : 0 0 0
Condition0%0/3
@attrs == 1 and not Ref::Util::XS::is_ref($attrs[0])
!ll&&!rl&&r
000
MC/DC0%0/2
@attrs == 1 and not Ref::Util::XS::is_ref($attrs[0])
@attrs == 1 not Ref::Util::XS::is_ref($attrs[0])
Truth table0%0/3
A and not(B)
A= @attrs == 1B= not Ref::Util::XS::is_ref($attrs[0])
ABresult
0X0
100
111
116 ? { text => $attrs[0] }
117 : undef;
118 }
119  
120  
121  
122  
123  
124 method opts {
125 0 ▶ my @opts;
Subroutine opts: not called CC=7 SCAR=40.3
Pod documented
126  
127 0 ▶ defined $text
Branch: 1 branch
BranchTrueFalseTotal
defined $text and push @opts, maybe_quote($text) 0 0 0
128 and push @opts, maybe_quote( $text );
129  
130 0 push @opts, render_opts( offset => $offset );
131 0 push @opts, render_opts( font => $font );
132  
133 0 push @opts, render_opts( textcolor => $textcolor );
134  
135 0 ▶ defined $enhanced
Branch: 2 branches
BranchTrueFalseTotal
defined $enhanced and push @opts, $enhanced ? "enhanced" : "noenhanced" 0 0 0
$enhanced ? : 0 0 0
136 and push @opts, ( $enhanced ? 'enhanced' : 'noenhanced' );
137  
138 0 ▶ defined $rotate
Branch: 3 branches
BranchTrueFalseTotal
defined $rotate and push @opts, is_Num $rotate ? ["rotate by", $rotate] : ($rotate eq "parallel" ? ["rotate", "parallel"] : "norotate") 0 0 0
is_Num $rotate ? : 0 0 0
$rotate eq 'parallel' ? : 0 0 0
139 and push @opts,
140 is_Num( $rotate ) ? [ 'rotate by' => $rotate ]
141 : $rotate eq 'parallel' ? [ rotate => 'parallel' ]
142 : 'norotate';
143  
144 0 return @opts;
145 }
146  
147  
148 1 1;
149  
150 #
151 # This file is part of CXC-Gnuplot
152 #
153 # This software is Copyright (c) 2024 by Smithsonian Astrophysical Observatory.
154 #
155 # This is free software, licensed under:
156 #
157 # The GNU General Public License, Version 3, June 2007
158 #
159  
160 __END__
« blib/lib/CXC/Gnuplot/V0/MultiPlot.pm ↑ Summary blib/lib/CXC/Gnuplot/V1/Util.pm »