| 1 | package CXC::Gnuplot::V0::CoordOffset3D; | ||||||||||||||||||||||||||||
| 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::CoordOffset3D; | ||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 2 | ▶ | no namespace::clean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 2 | ▶ | use Ref::Util 'is_ref'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 2 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 2 | ▶ | use CXC::Gnuplot::V0::Types -lexical => 'CoordValue'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | use CXC::Gnuplot::V0::Util | ||||||||||||||||||||||||||||
| 20 | 2 | -lexical => 'pvalidate', | |||||||||||||||||||||||||||
| 21 | 2 | ▶ | 'assert_coerce_object', 'to_hash_r'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | #<<< no tidy | ||||||||||||||||||||||||||||
| 24 | 2 | field $x :param :reader //= 0; | |||||||||||||||||||||||||||
| 25 | 2 | field $y :param :reader //= 0; | |||||||||||||||||||||||||||
| 26 | 2 | field $z :param :reader //= 0; | |||||||||||||||||||||||||||
| 27 | 2 | field $opts ; | |||||||||||||||||||||||||||
| 28 | #>>> | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | ADJUST { | ||||||||||||||||||||||||||||
| 46 | 8 | ▶ | pvalidate( x => CoordValue, \$x ); | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 47 | 8 | pvalidate( y => CoordValue, \$y ); | |||||||||||||||||||||||||||
| 48 | 8 | pvalidate( z => CoordValue, \$z ); | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | ▶ | method to_hash ( %args ) { | |||||||||||||||||||||||||||
|
Subroutine
to_hash: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 57 | 0 | ▶ | to_hash_r( { | ||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 58 | ( defined $x ? ( x => $x ) : () ), # | ||||||||||||||||||||||||||||
| 59 | ( defined $y ? ( y => $y ) : () ), | ||||||||||||||||||||||||||||
| 60 | ( defined $z ? ( z => $z ) : () ), | ||||||||||||||||||||||||||||
| 61 | } ); | ||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | ▶ | sub coerce_attrs ( $class, @attrs ) { | |||||||||||||||||||||||||||
|
Subroutine
coerce_attrs: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 69 | 0 | ▶ | return @attrs == 1 && !is_ref( $attrs[0] ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@attrs == 1 and not Ref::Util::XS::is_ref($attrs[0])
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])
| |||||||||||||||||||||||||||||
| 70 | ? { x => $attrs[0] } | ||||||||||||||||||||||||||||
| 71 | : undef; | ||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | ▶ | sub assert_coerce( $class, $args ) { | |||||||||||||||||||||||||||
|
Subroutine
assert_coerce: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 79 | 0 | assert_coerce_object( $class, $args ); | |||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | ▶ | method clone ( %args ) { | |||||||||||||||||||||||||||
|
Subroutine
clone: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 87 | 0 | return clone_object( $self, \%args ); | |||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | method opts { | ||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | # remove trailing '0' offset coords with no coordsys | ||||||||||||||||||||||||||||
| 97 | 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, $z);
pop @opts while @opts and $opts[-1] eq 0;
join ",", @opts
}
MC/DC0%0/2
$opts //= do {
my(@opts) = map({$_->stringify;} $x, $y, $z);
pop @opts while @opts and $opts[-1] eq 0;
join ",", @opts
}
$opts
do {
my(@opts) = map({$_->stringify;} $x, $y, $z);
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, $z);
pop @opts while @opts and $opts[-1] eq 0;
join ",", @opts
}
| |||||||||||||||||||||||||||||
| 98 | 0 | my @opts = map { $_->stringify } $x, $y, $z; | |||||||||||||||||||||||||||
| 99 | 0 | ▶ | pop @opts while @opts && $opts[-1] eq '0'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@opts and $opts[-1] eq 0
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
| |||||||||||||||||||||||||||||
| 100 | 0 | join( q{,}, @opts ); | |||||||||||||||||||||||||||
| 101 | }; | ||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | 0 | ▶ | return length( $opts ) ? ( $opts ) : (); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | 2 | 1; | |||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | # | ||||||||||||||||||||||||||||
| 109 | # This file is part of CXC-Gnuplot | ||||||||||||||||||||||||||||
| 110 | # | ||||||||||||||||||||||||||||
| 111 | # This software is Copyright (c) 2024 by Smithsonian Astrophysical Observatory. | ||||||||||||||||||||||||||||
| 112 | # | ||||||||||||||||||||||||||||
| 113 | # This is free software, licensed under: | ||||||||||||||||||||||||||||
| 114 | # | ||||||||||||||||||||||||||||
| 115 | # The GNU General Public License, Version 3, June 2007 | ||||||||||||||||||||||||||||
| 116 | # | ||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||
| 118 | __END__ | ||||||||||||||||||||||||||||