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

filter: Statementstmt 62.7% 27 / 43 Branchbran 0.0% 0 / 16 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 57.1% 8 / 14 Podpod 100% 4 / 4 totaltotal 47.5% 39 / 82 CC 10 SCAR 21.6
CC
10
Cov
44%
assert_coerce
20.0
__ANON__
12.0
to_hash
12.0
CRAP 8.7
« blib/lib/CXC/Gnuplot/V0/Range.pm ↑ Summary blib/lib/CXC/Gnuplot/V0/CoordPosition3D.pm »
1 package CXC::Gnuplot::V0::AxisMinorTics;
2  
3 1 ▶use v5.38;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use experimental 'builtin', 'declared_refs';
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::AxisMinorTics;
10  
11 1 ▶no namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Ref::Util 'is_ref', 'is_plain_hashref';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 use CXC::Gnuplot::V0::Types -lexical, qw(
18 Enum
19 Tuple
20 PositiveOrZeroInt
21 TicTimeIncr
22 1 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use CXC::Gnuplot::V0::Util -lexical, 'assert_coerce_object', 'clone_object', 'pvalidate';
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 my sub croak {
26 0 ▶ require Carp;
Subroutine croak: not called CC=1 SCAR=6.9
27 0 goto \&Carp::croak;
28 }
29  
30 #<<< no tidy
31 1 field $intervals :param :reader = undef; # { freq | "default" }
32 1 field $time :param :reader = undef; # { <N> <units> }
33 #>>>
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48 ADJUST {
49  
50 0 ▶ defined $intervals
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 1 branch
BranchTrueFalseTotal
defined $intervals and defined $time and croak "specify only one of 'intervals' or 'time'" 0 0 0
Condition0%0/3
defined $intervals and defined $time
!ll&&!rl&&r
000
MC/DC0%0/2
defined $intervals and defined $time
defined $intervals defined $time
Truth table0%0/3
A and B
A= defined $intervalsB= defined $time
ABresult
0X0
100
111
51 and defined $time
52 and croak( q{specify only one of 'intervals' or 'time'} );
53  
54 0 pvalidate( intervals => Enum ['default'] | PositiveOrZeroInt, \$intervals );
55 0 pvalidate( time => TicTimeIncr, \$time );
56 }
57  
58  
59  
60  
61  
62  
63 method to_hash {
64  
65 return {
66 0 ▶ ( defined $intervals ? ( intervals => $intervals ) : () ), #
Subroutine to_hash: not called CC=3 SCAR=24.8
Pod documented
Branch: 2 branches
BranchTrueFalseTotal
defined $intervals ? : 0 0 0
defined $time ? : 0 0 0
67 ( defined $time ? ( time => $time ) : () ),
68 };
69 }
70  
71  
72  
73  
74  
75 ▶sub assert_coerce ( $class, @args ) {
Subroutine assert_coerce: not called CC=4 SCAR=30.0
Pod documented
76  
77 0 ▶ if ( @args == 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args == 1) 0 0 0
78 0 my $value = pop @args;
79 0 ▶ return $value if $value isa $class;
Branch: 1 branch
BranchTrueFalseTotal
if $value isa $class 0 0 0
80  
81 @args
82 0 ▶ = is_plain_hashref $value
Branch: 1 branch
BranchTrueFalseTotal
Ref::Util::XS::is_plain_hashref($value) ? : 0 0 0
83 ? $value->%*
84 : ( intervals => $value );
85 }
86  
87 0 return $class->new( @args );
88 }
89  
90  
91  
92  
93  
94 ▶method clone ( %args ) {
Subroutine clone: not called CC=1 SCAR=6.9
Pod documented
95 0 return clone_object( $self, \%args );
96 }
97  
98  
99  
100  
101  
102  
103 method opts {
104 0 ▶ my @opts;
Subroutine opts: not called CC=3 SCAR=24.8
Pod documented
105  
106 0 ▶ defined $intervals
Branch: 1 branch
BranchTrueFalseTotal
defined $intervals and push @opts, [$intervals] 0 0 0
107 and push @opts, [$intervals];
108  
109 defined $time
110 0 ▶ and push @opts, [ time => [ $time->@{ 'multiple', 'unit' } ] ];
Branch: 1 branch
BranchTrueFalseTotal
defined $time and push @opts, ["time", [@$time{"multiple", "unit"}]] 0 0 0
111  
112 0 return @opts;
113 }
114  
115 #
116 # This file is part of CXC-Gnuplot
117 #
118 # This software is Copyright (c) 2024 by Smithsonian Astrophysical Observatory.
119 #
120 # This is free software, licensed under:
121 #
122 # The GNU General Public License, Version 3, June 2007
123 #
124  
125 1 1;
126  
127 __END__
« blib/lib/CXC/Gnuplot/V0/Range.pm ↑ Summary blib/lib/CXC/Gnuplot/V0/CoordPosition3D.pm »