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

filter: Statementstmt 70.0% 21 / 30 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 60.0% 6 / 10 Podpod 100% 4 / 4 totaltotal 50.0% 31 / 62 CC 7 SCAR 25.1
CC
7
Cov
48%
opts
30.0
to_hash
12.0
assert_coerce
2.0
CRAP 12.2
« blib/lib/CXC/Gnuplot/V0/Terminal.pm ↑ Summary blib/lib/CXC/Gnuplot/V0/Margin.pm »
1 package CXC::Gnuplot::V0::CoordOffset2D;
2  
3 2 ▶use v5.38;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use experimental 'declared_refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Feature::Compat::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = 'v0.29.3';
8  
9 class CXC::Gnuplot::V0::CoordOffset2D;
10  
11 2 ▶use CXC::Gnuplot::V0::Types -lexical => 'CoordValue';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 use CXC::Gnuplot::V0::Util
14 2 -lexical => 'pvalidate',
15 2 ▶ 'assert_coerce_object', 'to_hash_r';
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 #<<< no tidy
18 2 field $x :param :reader //= 0;
19 2 field $y :param :reader //= 0;
20 2 field $opts ;
21 #>>>
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36 ADJUST {
37 6 ▶ pvalidate( x => CoordValue, \$x );
Subroutine __ANON__: called CC=1 SCAR=0.0
38 6 pvalidate( y => CoordValue, \$y );
39 }
40  
41  
42  
43  
44  
45 ▶method to_hash ( %args ) {
Subroutine to_hash: not called CC=3 SCAR=24.8
Pod documented
46 0 ▶ to_hash_r( {
Branch: 2 branches
BranchTrueFalseTotal
defined $x ? : 0 0 0
defined $y ? : 0 0 0
47 ( defined $x ? ( x => $x ) : () ), #
48 ( defined $y ? ( y => $y ) : () ),
49 } );
50 }
51  
52  
53  
54  
55  
56 ▶sub assert_coerce( $class, $args ) {
Subroutine assert_coerce: not called CC=1 SCAR=6.9
Pod documented
57 0 assert_coerce_object( $class, $args );
58 }
59  
60  
61  
62  
63  
64  
65 ▶method clone ( %args ) {
Subroutine clone: not called CC=1 SCAR=6.9
Pod documented
66 0 return clone_object( $self, \%args );
67 }
68  
69  
70  
71  
72  
73 method opts {
74  
75 # remove trailing '0' offset coords with no coordsys
76 0 ▶ $opts //= do {
Subroutine opts: not called CC=5 SCAR=34.0
Pod documented
Condition0%0/3
$opts //= do { my(@opts) = map({$_->stringify;} $x, $y); pop @opts while @opts and $opts[-1] eq 0; join ",", @opts }
l!l&&r!l&&!r
000
MC/DC0%0/2
$opts //= do { my(@opts) = map({$_->stringify;} $x, $y); pop @opts while @opts and $opts[-1] eq 0; join ",", @opts }
$opts do { my(@opts) = map({$_->stringify;} $x, $y); pop @opts while @opts and $opts[-1] eq 0; join ",", @opts }
Truth table0%0/3
A //= B
A= $optsB= do { my(@opts) = map({$_->stringify;} $x, $y); pop @opts while @opts and $opts[-1] eq 0; join ",", @opts }
ABresult
1X1
011
000
77 0 my @opts = map { $_->stringify } $x, $y;
78 0 ▶ pop @opts while @opts && $opts[-1] eq '0';
Branch: 1 branch
BranchTrueFalseTotal
@opts and $opts[-1] eq 0 and do { pop @opts } 0 0 0
Condition0%0/3
@opts and $opts[-1] eq 0
!ll&&!rl&&r
000
MC/DC0%0/2
@opts and $opts[-1] eq 0
@opts $opts[-1] eq 0
Truth table0%0/3
A and B
A= @optsB= $opts[-1] eq 0
ABresult
0X0
100
111
79 0 join( q{,}, @opts );
80 };
81  
82 0 ▶ return length( $opts ) ? ( $opts ) : ();
Branch: 1 branch
BranchTrueFalseTotal
length $opts ? : 0 0 0
83 }
84  
85 2 1;
86  
87 #
88 # This file is part of CXC-Gnuplot
89 #
90 # This software is Copyright (c) 2024 by Smithsonian Astrophysical Observatory.
91 #
92 # This is free software, licensed under:
93 #
94 # The GNU General Public License, Version 3, June 2007
95 #
96  
97 __END__
« blib/lib/CXC/Gnuplot/V0/Terminal.pm ↑ Summary blib/lib/CXC/Gnuplot/V0/Margin.pm »