| 1 | package CXC::Gnuplot::V0::Bound; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 6 | ▶ | use v5.38; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 6 | ▶ | use experimental 'builtin'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 6 | ▶ | use Feature::Compat::Class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 6 | our $VERSION = 'v0.29.3'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | ## no critic(Community::MultidimensionalArrayEmulation) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | class CXC::Gnuplot::V0::Bound; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 6 | ▶ | no namespace::clean; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 6 | ▶ | use Ref::Util 'is_plain_hashref', 'is_ref'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 6 | ▶ | use List::Util 'reduce'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 6 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 6 | ▶ | use CXC::Gnuplot::V0::Types -lexical => qw(is_Num); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 6 | ▶ | use CXC::Gnuplot::V0::Util -lexical => 'clone_object', 'to_hash_r'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 6 | ▶ | use Text::Balanced; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | use overload | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | q{""} => 'to_string', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | bool => sub { builtin::true }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 6 | ▶ | fallback => builtin::false; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | my sub croak { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | require Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
croak: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | goto \&Carp::croak; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | #<<< no tidy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 6 | field $lower_bound :param :reader = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 6 | field $bound :param :reader = q{*}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 6 | field $upper_bound :param :reader = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | #>>> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | method to_hash { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | to_hash_r( { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
to_hash: not called CC=4 SCAR=30.0
Pod
documented
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | ( defined $lower_bound ? ( lower_bound => $lower_bound ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | ( defined $upper_bound ? ( upper_bound => $upper_bound ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | ( defined $bound ? ( bound => $bound ) : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | ▶ | method clone ( %args ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
clone: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | return clone_object( $self, \%args ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | ▶ | my sub is_delimited ( $str ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_delimited: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | return defined( ( Text::Balanced::extract_delimited( $str ) )[0] ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | ▶ | my sub is_timedate( $str ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_timedate: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | return defined( ( Text::Balanced::extract_delimited( $str ) )[0] ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | ▶ | sub assert_coerce ( $class, @arg ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
assert_coerce: called CC=15 SCAR=51.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 6 | require CXC::Gnuplot::V0::Bound::Numeric; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 6 | require CXC::Gnuplot::V0::Bound::TimeDate; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 6 | ▶ | return $class->new_from_string( $arg[0] ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@arg == 1 and not Ref::Util::XS::is_ref($arg[0])
MC/DC0%0/2
@arg == 1 and not Ref::Util::XS::is_ref($arg[0])
@arg == 1
not Ref::Util::XS::is_ref($arg[0])
Truth table33%1/3
A and not(B)
A= @arg == 1B= not Ref::Util::XS::is_ref($arg[0])
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | if @arg == 1 && !is_ref( $arg[0] ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | return $arg[0] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@arg == 1 and $arg[0] isa $class
MC/DC0%0/2
@arg == 1 and $arg[0] isa $class
@arg == 1
$arg[0] isa $class
Truth table0%0/3
A and B
A= @arg == 1B= $arg[0] isa $class
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | if @arg == 1 && $arg[0] isa $class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | my %arg | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | = @arg == 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | ? is_plain_hashref( $arg[0] ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | ? $arg[0]->%* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | : croak( 'unable to coerce ' . ref $arg[0] ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | : @arg; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | return CXC::Gnuplot::V0::Bound::Numeric->new( %arg ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | if ( !defined $arg{min} || is_Num( $arg{min} ) ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | ▶ | && ( !defined $arg{max} || is_Num( $arg{max} ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
!defined($arg{"min"}) || is_Num($arg{"min"}) and !defined($arg{"max"}) || is_Num($arg{"max"})
not defined $arg{"min"} or is_Num($arg{"min"})
not defined $arg{"max"} or is_Num($arg{"max"})
MC/DC0%0/4
!defined($arg{"min"}) || is_Num($arg{"min"}) and !defined($arg{"max"}) || is_Num($arg{"max"})
not defined $arg{"min"}
is_Num($arg{"min"})
not defined $arg{"max"}
is_Num($arg{"max"})
Truth table0%0/7
not(A) or B and not(C) or D
A= not defined $arg{"min"}B= is_Num($arg{"min"})C= not defined $arg{"max"}D= is_Num($arg{"max"})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | return CXC::Gnuplot::V0::Bound::TimeDate->new( %arg ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | if ( !defined $arg{min} || is_delimited( $arg{min} ) ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | && ( !defined $arg{max} || is_delimited( $arg{max} ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
!defined($arg{"min"}) || is_delimited($arg{"min"}) and !defined($arg{"max"}) || is_delimited($arg{"max"})
not defined $arg{"min"} or is_delimited $arg{"min"}
not defined $arg{"max"} or is_delimited $arg{"max"}
MC/DC0%0/4
!defined($arg{"min"}) || is_delimited($arg{"min"}) and !defined($arg{"max"}) || is_delimited($arg{"max"})
not defined $arg{"min"}
is_delimited $arg{"min"}
not defined $arg{"max"}
is_delimited $arg{"max"}
Truth table0%0/7
not(A) or B and not(C) or D
A= not defined $arg{"min"}B= is_delimited $arg{"min"}C= not defined $arg{"max"}D= is_delimited $arg{"max"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | croak( 'unable to coerce' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | # what about geographic?? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 6 | ▶ | use Regexp::Common 'number', 'delimited'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 6 | my $RE_quoted; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | my $RE_real; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | BEGIN { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 6 | ▶ | $RE_real = ${RE}{num}{real}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 6 | ▶ | use feature 'multidimensional'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 6 | $RE_quoted = ${RE}{quoted}{ -delim => q{'"} }{-esc}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | ## no critic(RegularExpressions::ProhibitComplexRegexes) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 6 | ▶ | use constant RE_BOUND_REAL => qr/^$RE_real$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 6 | ▶ | use constant RE_BOUND_QUOTED => qr/^$RE_quoted$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 6 | use constant RE_BOUND => qr{ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | ^ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | (?: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | (?<lower_bound> (?<lb_real>$RE_real) | (?<lb_q>$RE_quoted)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | \s* < | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | )? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | \s* (?<bound>[*]) \s* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | (?: < | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | \s* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | (?<upper_bound> (?<ub_real>$RE_real) | (?<ub_q>$RE_quoted)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | )? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 6 | ▶ | $ }x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | ▶ | sub new_from_string( $class, $str ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new_from_string: called CC=9 SCAR=40.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 6 | require CXC::Gnuplot::V0::Bound::Numeric; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 6 | require CXC::Gnuplot::V0::Bound::TimeDate; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 6 | ▶ | croak( '"str" argument is not a scalar' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | if is_ref( $str ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 6 | ▶ | return CXC::Gnuplot::V0::Bound::Numeric->new( bound => $str ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | if $str =~ RE_BOUND_REAL; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | ▶ | return CXC::Gnuplot::V0::Bound::TimeDate->new( bound => $str ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | if $str =~ RE_BOUND_QUOTED; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | ▶ | croak "illegal bounds specification: $str" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | unless $str =~ RE_BOUND; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | my %args = %+; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | # need to delete these from %args, so can't use short-circuit boolean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | ▶ | my $is_number = reduce { $a || $b } map { defined delete( $args{$_} ) } 'lb_real', 'ub_real'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | ▶ | my $is_quoted = reduce { $a || $b } map { defined delete( $args{$_} ) } 'lb_q', 'ub_q'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | ▶ | croak q{illegal bounds specification: can't mix numeric and timedate} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$is_number and $is_quoted
MC/DC0%0/2
$is_number and $is_quoted
$is_number
$is_quoted
Truth table0%0/3
A and B
A= $is_numberB= $is_quoted
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | if $is_number && $is_quoted; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | return CXC::Gnuplot::V0::Bound::Numeric->new( %args ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | if $is_number; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | ▶ | return CXC::Gnuplot::V0::Bound::TimeDate->new( %args ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | if $is_quoted; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | return CXC::Gnuplot::V0::Bound::Numeric->new( %+ ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | method to_string { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 2 | ▶ | return join( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
to_string: called CC=3 SCAR=12.7
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | q{ < }, # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | ( defined $lower_bound ? $lower_bound : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | $bound, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | ( defined $upper_bound ? $upper_bound : () ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 6 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | # This file is part of CXC-Gnuplot | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | # This software is Copyright (c) 2024 by Smithsonian Astrophysical Observatory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | # This is free software, licensed under: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | # The GNU General Public License, Version 3, June 2007 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||