« blib/lib/App/RecordStream/DomainLanguage/Registry.pm
↑ Summary
blib/lib/App/RecordStream/Operation/fromtcpdump.pm »
| 1 | package App::RecordStream::DomainLanguage::Value; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 29 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 29 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 29 | ▶ | use App::RecordStream::Aggregator::Internal::Constant; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 29 | ▶ | use App::RecordStream::DomainLanguage::Snippet; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 29 | ▶ | use App::RecordStream::DomainLanguage::Valuation::KeySpec; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 29 | ▶ | use App::RecordStream::DomainLanguage::Valuation::Sub; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 29 | ▶ | use Scalar::Util ('blessed'); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | sub new | ||||||||||||||||||||||||||||
| 13 | { | ||||||||||||||||||||||||||||
| 14 | 1194 | ▶ | my $class = shift; | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 15 | 1194 | my $desc = shift; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 1194 | my $this = | |||||||||||||||||||||||||||
| 18 | { | ||||||||||||||||||||||||||||
| 19 | 'DESCRIPTION' => $desc, | ||||||||||||||||||||||||||||
| 20 | 'POSSIBILITIES' => {}, | ||||||||||||||||||||||||||||
| 21 | }; | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 1194 | bless $this, $class; | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 1194 | return $this; | |||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | sub new_from_scalar | ||||||||||||||||||||||||||||
| 29 | { | ||||||||||||||||||||||||||||
| 30 | 352 | ▶ | my $class = shift; | ||||||||||||||||||||||||||
|
Subroutine
new_from_scalar: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 31 | 352 | my $value = shift; | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 352 | my $this = $class->new("scalar($value)"); | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 352 | $this->add_possibility('SCALAR', $value); | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 352 | return $this; | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | sub add_possibility | ||||||||||||||||||||||||||||
| 41 | { | ||||||||||||||||||||||||||||
| 42 | 1699 | ▶ | my $this = shift; | ||||||||||||||||||||||||||
|
Subroutine
add_possibility: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 43 | 1699 | my $type = shift; | |||||||||||||||||||||||||||
| 44 | 1699 | my $value = shift; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 1699 | ▶ | if($type eq 'SCALAR') | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 47 | { | ||||||||||||||||||||||||||||
| 48 | 352 | ▶ | if(blessed($value) && $value->isa('App::RecordStream::DomainLanguage::Snippet')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
builtin::blessed($value) and $value->isa("App::RecordStream::DomainLanguage::Snippet")
MC/DC100%2/2
builtin::blessed($value) and $value->isa("App::RecordStream::DomainLanguage::Snippet")
builtin::blessed($value)
$value->isa("App::RecordStream::DomainLanguage::Snippet")
Truth table100%3/3
A and B
A= builtin::blessed($value)B= $value->isa("App::RecordStream::DomainLanguage::Snippet")
| |||||||||||||||||||||||||||||
| 49 | { | ||||||||||||||||||||||||||||
| 50 | 138 | return $this->add_possibility('SNIPPET', $value); | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 1561 | ▶ | push @{$this->{'POSSIBILITIES'}->{$type} ||= []}, $value; | ||||||||||||||||||||||||||
|
Condition50%1/2
$this->{"POSSIBILITIES"}{$type} ||= []
MC/DC0%0/1
$this->{"POSSIBILITIES"}{$type} ||= []
$this->{"POSSIBILITIES"}{$type}
Truth table50%1/2
A
A= $this->{"POSSIBILITIES"}{$type}
| |||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | # sketchy upgrade... | ||||||||||||||||||||||||||||
| 57 | 1561 | ▶ | if($type eq "SCALAR") | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 58 | { | ||||||||||||||||||||||||||||
| 59 | 214 | $this->add_possibility('VALUATION', App::RecordStream::DomainLanguage::Valuation::KeySpec->new($value)); | |||||||||||||||||||||||||||
| 60 | 214 | $this->add_possibility('SNIPPET', App::RecordStream::DomainLanguage::Snippet->new($value)); | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | sub get_possibilities | ||||||||||||||||||||||||||||
| 65 | { | ||||||||||||||||||||||||||||
| 66 | 715 | ▶ | my $this = shift; | ||||||||||||||||||||||||||
|
Subroutine
get_possibilities: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 67 | 715 | my $type = shift; | |||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | 715 | ▶ | return @{$this->{'POSSIBILITIES'}->{$type} || []}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | sub get_possible_pairs | ||||||||||||||||||||||||||||
| 73 | { | ||||||||||||||||||||||||||||
| 74 | 490 | ▶ | my $this = shift; | ||||||||||||||||||||||||||
|
Subroutine
get_possible_pairs: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | 490 | my @ret; | |||||||||||||||||||||||||||
| 77 | 490 | for my $type (keys(%{$this->{'POSSIBILITIES'}})) | |||||||||||||||||||||||||||
| 78 | { | ||||||||||||||||||||||||||||
| 79 | 781 | for my $value (@{$this->{'POSSIBILITIES'}->{$type}}) | |||||||||||||||||||||||||||
| 80 | { | ||||||||||||||||||||||||||||
| 81 | 781 | push @ret, [$type, $value]; | |||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | 490 | return @ret; | |||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | sub get_description | ||||||||||||||||||||||||||||
| 89 | { | ||||||||||||||||||||||||||||
| 90 | 568 | ▶ | my $this = shift; | ||||||||||||||||||||||||||
|
Subroutine
get_description: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | 568 | return $this->{'DESCRIPTION'}; | |||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | sub _force | ||||||||||||||||||||||||||||
| 96 | { | ||||||||||||||||||||||||||||
| 97 | 0 | ▶ | my $this = shift; | ||||||||||||||||||||||||||
|
Subroutine
_force: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 98 | 0 | my $type = shift; | |||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | 0 | ▶ | my $ar = $this->{'POSSIBILITIES'}->{$type} || []; | ||||||||||||||||||||||||||
|
Condition0%0/2
$this->{'POSSIBILITIES'}{$type} || []
MC/DC0%0/1
$this->{'POSSIBILITIES'}{$type} || []
$this->{'POSSIBILITIES'}{$type}
Truth table0%0/2
A
A= $this->{'POSSIBILITIES'}{$type}
| |||||||||||||||||||||||||||||
| 101 | 0 | my $ct = @$ar; | |||||||||||||||||||||||||||
| 102 | 0 | ▶ | if($ct != 1) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 103 | { | ||||||||||||||||||||||||||||
| 104 | 0 | die "Cannot use '" . $this->{'DESCRIPTION'} . "' as $type, $ct possibilities"; | |||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | 0 | return $ar->[0]; | |||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | # TODO: amling, fake isa? | ||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | # We can pretend to be an aggregator in a pinch | ||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||
| 114 | sub initial | ||||||||||||||||||||||||||||
| 115 | { | ||||||||||||||||||||||||||||
| 116 | 0 | ▶ | return shift->_force('AGGREGATOR')->initial(@_); | ||||||||||||||||||||||||||
|
Subroutine
initial: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | sub combine | ||||||||||||||||||||||||||||
| 120 | { | ||||||||||||||||||||||||||||
| 121 | 0 | ▶ | return shift->_force('AGGREGATOR')->combine(@_); | ||||||||||||||||||||||||||
|
Subroutine
combine: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||
| 124 | sub squish | ||||||||||||||||||||||||||||
| 125 | { | ||||||||||||||||||||||||||||
| 126 | 0 | ▶ | return shift->_force('AGGREGATOR')->squish(@_); | ||||||||||||||||||||||||||
|
Subroutine
squish: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||
| 129 | # We can pretend to be a deaggregator in a pinch | ||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||
| 131 | sub deaggregate | ||||||||||||||||||||||||||||
| 132 | { | ||||||||||||||||||||||||||||
| 133 | 0 | ▶ | return shift->_force('DEAGGREGATOR')->deaggregate(@_); | ||||||||||||||||||||||||||
|
Subroutine
deaggregate: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | # We can pretend to be a clumper in a pinch | ||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||
| 138 | sub clumper_begin | ||||||||||||||||||||||||||||
| 139 | { | ||||||||||||||||||||||||||||
| 140 | 0 | ▶ | return shift->_force('CLUMPER')->clumper_begin(@_); | ||||||||||||||||||||||||||
|
Subroutine
clumper_begin: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||
| 143 | sub clumper_push_record | ||||||||||||||||||||||||||||
| 144 | { | ||||||||||||||||||||||||||||
| 145 | 0 | ▶ | return shift->_force('CLUMPER')->clumper_push_record(@_); | ||||||||||||||||||||||||||
|
Subroutine
clumper_push_record: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||
| 148 | sub clumper_end | ||||||||||||||||||||||||||||
| 149 | { | ||||||||||||||||||||||||||||
| 150 | 0 | ▶ | return shift->_force('CLUMPER')->clumper_end(@_); | ||||||||||||||||||||||||||
|
Subroutine
clumper_end: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||
| 153 | # We can pretend to be a valuation in a pinch | ||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||
| 155 | sub evaluate_record | ||||||||||||||||||||||||||||
| 156 | { | ||||||||||||||||||||||||||||
| 157 | 0 | ▶ | return shift->_force('VALUATION')->evaluate_record(@_); | ||||||||||||||||||||||||||
|
Subroutine
evaluate_record: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||
| 160 | sub cast_or_die | ||||||||||||||||||||||||||||
| 161 | { | ||||||||||||||||||||||||||||
| 162 | 378 | ▶ | my $type = shift; | ||||||||||||||||||||||||||
|
Subroutine
cast_or_die: called CC=6 SCAR=19.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 163 | 378 | my $obj = shift; | |||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | 378 | ▶ | if($type eq 'AGGREGATOR') | ||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||
| 166 | { | ||||||||||||||||||||||||||||
| 167 | 75 | return cast_agg_or_die($obj); | |||||||||||||||||||||||||||
| 168 | } | ||||||||||||||||||||||||||||
| 169 | elsif($type eq 'DEAGGREGATOR') | ||||||||||||||||||||||||||||
| 170 | { | ||||||||||||||||||||||||||||
| 171 | 0 | return cast_deagg_or_die($obj); | |||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||
| 173 | elsif($type eq 'CLUMPER') | ||||||||||||||||||||||||||||
| 174 | { | ||||||||||||||||||||||||||||
| 175 | 0 | return cast_clumper_or_die($obj); | |||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||
| 177 | elsif($type eq 'VALUATION') | ||||||||||||||||||||||||||||
| 178 | { | ||||||||||||||||||||||||||||
| 179 | 55 | return cast_valuation_or_die($obj); | |||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||
| 181 | elsif($type eq 'SCALAR') | ||||||||||||||||||||||||||||
| 182 | { | ||||||||||||||||||||||||||||
| 183 | 248 | return cast_scalar_or_die($obj); | |||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||
| 185 | else | ||||||||||||||||||||||||||||
| 186 | { | ||||||||||||||||||||||||||||
| 187 | 0 | die "Bad type $type?"; | |||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||
| 191 | sub cast_valuation_or_die | ||||||||||||||||||||||||||||
| 192 | { | ||||||||||||||||||||||||||||
| 193 | 55 | ▶ | my $obj = shift; | ||||||||||||||||||||||||||
|
Subroutine
cast_valuation_or_die: called CC=11 SCAR=28.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||
| 195 | 55 | ▶ | if(ref($obj) && ref($obj) eq "CODE") | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $obj and ref $obj eq "CODE"
MC/DC50%1/2
ref $obj and ref $obj eq "CODE"
ref $obj
ref $obj eq "CODE"
Truth table66%2/3
A and B
A= ref $objB= ref $obj eq "CODE"
| |||||||||||||||||||||||||||||
| 196 | { | ||||||||||||||||||||||||||||
| 197 | 1 | return App::RecordStream::DomainLanguage::Valuation::Sub->new($obj); | |||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||
| 200 | 54 | ▶ | if(blessed($obj) && $obj->isa('App::RecordStream::DomainLanguage::Value')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Value")
MC/DC0%0/2
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Value")
builtin::blessed($obj)
$obj->isa("App::RecordStream::DomainLanguage::Value")
Truth table33%1/3
A and B
A= builtin::blessed($obj)B= $obj->isa("App::RecordStream::DomainLanguage::Value")
| |||||||||||||||||||||||||||||
| 201 | { | ||||||||||||||||||||||||||||
| 202 | 54 | my @val = $obj->get_possibilities('VALUATION'); | |||||||||||||||||||||||||||
| 203 | 54 | ▶ | if(@val > 1) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 204 | { | ||||||||||||||||||||||||||||
| 205 | 0 | die "Multiple valuations for " . $obj->get_description(); | |||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||
| 207 | 54 | ▶ | if(@val == 1) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 208 | { | ||||||||||||||||||||||||||||
| 209 | 1 | return $val[0]; | |||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||
| 213 | 53 | ▶ | if(blessed($obj) && $obj->isa('App::RecordStream::Aggregator::Aggregation')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($obj) and $obj->isa("App::RecordStream::Aggregator::Aggregation")
MC/DC0%0/2
builtin::blessed($obj) and $obj->isa("App::RecordStream::Aggregator::Aggregation")
builtin::blessed($obj)
$obj->isa("App::RecordStream::Aggregator::Aggregation")
Truth table33%1/3
A and B
A= builtin::blessed($obj)B= $obj->isa("App::RecordStream::Aggregator::Aggregation")
| |||||||||||||||||||||||||||||
| 214 | { | ||||||||||||||||||||||||||||
| 215 | 0 | die "Aggregation found where valuation expected"; | |||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||
| 218 | 53 | ▶ | if(blessed($obj) && $obj->isa('App::RecordStream::DomainLanguage::Valuation')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Valuation")
MC/DC0%0/2
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Valuation")
builtin::blessed($obj)
$obj->isa("App::RecordStream::DomainLanguage::Valuation")
Truth table33%1/3
A and B
A= builtin::blessed($obj)B= $obj->isa("App::RecordStream::DomainLanguage::Valuation")
| |||||||||||||||||||||||||||||
| 219 | { | ||||||||||||||||||||||||||||
| 220 | 0 | return $obj; | |||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||
| 223 | 53 | die "Unknown found where valuation expected"; | |||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||
| 226 | sub cast_agg_or_die | ||||||||||||||||||||||||||||
| 227 | { | ||||||||||||||||||||||||||||
| 228 | 75 | ▶ | my $obj = shift; | ||||||||||||||||||||||||||
|
Subroutine
cast_agg_or_die: called CC=11 SCAR=35.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||
| 230 | 75 | ▶ | if(blessed($obj) && $obj->isa('App::RecordStream::DomainLanguage::Value')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Value")
MC/DC0%0/2
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Value")
builtin::blessed($obj)
$obj->isa("App::RecordStream::DomainLanguage::Value")
Truth table33%1/3
A and B
A= builtin::blessed($obj)B= $obj->isa("App::RecordStream::DomainLanguage::Value")
| |||||||||||||||||||||||||||||
| 231 | { | ||||||||||||||||||||||||||||
| 232 | 75 | my @agg = $obj->get_possibilities('AGGREGATOR'); | |||||||||||||||||||||||||||
| 233 | 75 | ▶ | if(@agg > 1) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 234 | { | ||||||||||||||||||||||||||||
| 235 | 0 | die "Multiple aggregators for " . $obj->get_description(); | |||||||||||||||||||||||||||
| 236 | } | ||||||||||||||||||||||||||||
| 237 | 75 | ▶ | if(@agg == 1) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 238 | { | ||||||||||||||||||||||||||||
| 239 | 73 | return $agg[0]; | |||||||||||||||||||||||||||
| 240 | } | ||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||
| 242 | 2 | my @scalar = $obj->get_possibilities('SCALAR'); | |||||||||||||||||||||||||||
| 243 | 2 | ▶ | if(@scalar > 1) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 244 | { | ||||||||||||||||||||||||||||
| 245 | 0 | die "No aggregators and multiple scalars for " . $obj->get_description(); | |||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||
| 247 | 2 | ▶ | if(@scalar == 1) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 248 | { | ||||||||||||||||||||||||||||
| 249 | 0 | $obj = $scalar[0]; | |||||||||||||||||||||||||||
| 250 | } | ||||||||||||||||||||||||||||
| 251 | else | ||||||||||||||||||||||||||||
| 252 | { | ||||||||||||||||||||||||||||
| 253 | 2 | die "No usable possibilities for " . $obj->get_description(); | |||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||
| 255 | } | ||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||
| 257 | 0 | ▶ | if(blessed($obj) && $obj->isa('App::RecordStream::Aggregator::Aggregation')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
builtin::blessed($obj) and $obj->isa("App::RecordStream::Aggregator::Aggregation")
MC/DC0%0/2
builtin::blessed($obj) and $obj->isa("App::RecordStream::Aggregator::Aggregation")
builtin::blessed($obj)
$obj->isa("App::RecordStream::Aggregator::Aggregation")
Truth table0%0/3
A and B
A= builtin::blessed($obj)B= $obj->isa("App::RecordStream::Aggregator::Aggregation")
| |||||||||||||||||||||||||||||
| 258 | { | ||||||||||||||||||||||||||||
| 259 | 0 | return $obj; | |||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||
| 262 | 0 | ▶ | if(blessed($obj) && $obj->isa('App::RecordStream::DomainLanguage::Valuation')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Valuation")
MC/DC0%0/2
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Valuation")
builtin::blessed($obj)
$obj->isa("App::RecordStream::DomainLanguage::Valuation")
Truth table0%0/3
A and B
A= builtin::blessed($obj)B= $obj->isa("App::RecordStream::DomainLanguage::Valuation")
| |||||||||||||||||||||||||||||
| 263 | { | ||||||||||||||||||||||||||||
| 264 | 0 | die "Valuation found where aggregator expected"; | |||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||
| 267 | # running out of ideas here | ||||||||||||||||||||||||||||
| 268 | 0 | return App::RecordStream::Aggregator::Internal::Constant->new($obj); | |||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||
| 271 | sub cast_deagg_or_die | ||||||||||||||||||||||||||||
| 272 | { | ||||||||||||||||||||||||||||
| 273 | 0 | ▶ | my $obj = shift; | ||||||||||||||||||||||||||
|
Subroutine
cast_deagg_or_die: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||
| 275 | 0 | ▶ | if(blessed($obj) && $obj->isa('App::RecordStream::DomainLanguage::Value')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Value")
MC/DC0%0/2
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Value")
builtin::blessed($obj)
$obj->isa("App::RecordStream::DomainLanguage::Value")
Truth table0%0/3
A and B
A= builtin::blessed($obj)B= $obj->isa("App::RecordStream::DomainLanguage::Value")
| |||||||||||||||||||||||||||||
| 276 | { | ||||||||||||||||||||||||||||
| 277 | 0 | my @deagg = $obj->get_possibilities('DEAGGREGATOR'); | |||||||||||||||||||||||||||
| 278 | 0 | ▶ | if(@deagg > 1) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 279 | { | ||||||||||||||||||||||||||||
| 280 | 0 | die "Multiple deaggregators for " . $obj->get_description(); | |||||||||||||||||||||||||||
| 281 | } | ||||||||||||||||||||||||||||
| 282 | 0 | ▶ | if(@deagg == 1) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 283 | { | ||||||||||||||||||||||||||||
| 284 | 0 | return $deagg[0]; | |||||||||||||||||||||||||||
| 285 | } | ||||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||
| 287 | 0 | die "No usable possibilities for " . $obj->get_description(); | |||||||||||||||||||||||||||
| 288 | } | ||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||
| 290 | 0 | ▶ | if(blessed($obj) && $obj->isa('App::RecordStream::Deaggregator::Base')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
builtin::blessed($obj) and $obj->isa("App::RecordStream::Deaggregator::Base")
MC/DC0%0/2
builtin::blessed($obj) and $obj->isa("App::RecordStream::Deaggregator::Base")
builtin::blessed($obj)
$obj->isa("App::RecordStream::Deaggregator::Base")
Truth table0%0/3
A and B
A= builtin::blessed($obj)B= $obj->isa("App::RecordStream::Deaggregator::Base")
| |||||||||||||||||||||||||||||
| 291 | { | ||||||||||||||||||||||||||||
| 292 | 0 | return $obj; | |||||||||||||||||||||||||||
| 293 | } | ||||||||||||||||||||||||||||
| 294 | |||||||||||||||||||||||||||||
| 295 | 0 | my $s = "unknown"; | |||||||||||||||||||||||||||
| 296 | 0 | ▶ | if(blessed($obj)) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 297 | { | ||||||||||||||||||||||||||||
| 298 | 0 | $s = ref($obj); | |||||||||||||||||||||||||||
| 299 | } | ||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||
| 301 | 0 | die "Could not turn $s into a deaggregator"; | |||||||||||||||||||||||||||
| 302 | } | ||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||
| 304 | sub cast_clumper_or_die | ||||||||||||||||||||||||||||
| 305 | { | ||||||||||||||||||||||||||||
| 306 | 0 | ▶ | my $obj = shift; | ||||||||||||||||||||||||||
|
Subroutine
cast_clumper_or_die: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||
| 308 | 0 | ▶ | if(blessed($obj) && $obj->isa('App::RecordStream::DomainLanguage::Value')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Value")
MC/DC0%0/2
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Value")
builtin::blessed($obj)
$obj->isa("App::RecordStream::DomainLanguage::Value")
Truth table0%0/3
A and B
A= builtin::blessed($obj)B= $obj->isa("App::RecordStream::DomainLanguage::Value")
| |||||||||||||||||||||||||||||
| 309 | { | ||||||||||||||||||||||||||||
| 310 | 0 | my @clumper = $obj->get_possibilities('CLUMPER'); | |||||||||||||||||||||||||||
| 311 | 0 | ▶ | if(@clumper > 1) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 312 | { | ||||||||||||||||||||||||||||
| 313 | 0 | die "Multiple clumpers for " . $obj->get_description(); | |||||||||||||||||||||||||||
| 314 | } | ||||||||||||||||||||||||||||
| 315 | 0 | ▶ | if(@clumper == 1) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 316 | { | ||||||||||||||||||||||||||||
| 317 | 0 | return $clumper[0]; | |||||||||||||||||||||||||||
| 318 | } | ||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||
| 320 | 0 | die "No usable possibilities for " . $obj->get_description(); | |||||||||||||||||||||||||||
| 321 | } | ||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||
| 323 | 0 | ▶ | if(blessed($obj) && $obj->isa('App::RecordStream::Clumper::Base')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
builtin::blessed($obj) and $obj->isa("App::RecordStream::Clumper::Base")
MC/DC0%0/2
builtin::blessed($obj) and $obj->isa("App::RecordStream::Clumper::Base")
builtin::blessed($obj)
$obj->isa("App::RecordStream::Clumper::Base")
Truth table0%0/3
A and B
A= builtin::blessed($obj)B= $obj->isa("App::RecordStream::Clumper::Base")
| |||||||||||||||||||||||||||||
| 324 | { | ||||||||||||||||||||||||||||
| 325 | 0 | return $obj; | |||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||
| 328 | 0 | my $s = "unknown"; | |||||||||||||||||||||||||||
| 329 | 0 | ▶ | if(blessed($obj)) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 330 | { | ||||||||||||||||||||||||||||
| 331 | 0 | $s = ref($obj); | |||||||||||||||||||||||||||
| 332 | } | ||||||||||||||||||||||||||||
| 333 | |||||||||||||||||||||||||||||
| 334 | 0 | die "Could not turn $s into a clumper"; | |||||||||||||||||||||||||||
| 335 | } | ||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||
| 337 | sub cast_scalar_or_die | ||||||||||||||||||||||||||||
| 338 | { | ||||||||||||||||||||||||||||
| 339 | 248 | ▶ | my $obj = shift; | ||||||||||||||||||||||||||
|
Subroutine
cast_scalar_or_die: called CC=9 SCAR=26.7
Pod
undocumented
| |||||||||||||||||||||||||||||
| 340 | |||||||||||||||||||||||||||||
| 341 | 248 | ▶ | if(blessed($obj) && $obj->isa('App::RecordStream::DomainLanguage::Value')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Value")
MC/DC50%1/2
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Value")
builtin::blessed($obj)
$obj->isa("App::RecordStream::DomainLanguage::Value")
Truth table66%2/3
A and B
A= builtin::blessed($obj)B= $obj->isa("App::RecordStream::DomainLanguage::Value")
| |||||||||||||||||||||||||||||
| 342 | { | ||||||||||||||||||||||||||||
| 343 | 54 | my @scalar = $obj->get_possibilities('SCALAR'); | |||||||||||||||||||||||||||
| 344 | 54 | ▶ | if(@scalar > 1) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 345 | { | ||||||||||||||||||||||||||||
| 346 | 0 | die "Multiple scalar values for " . $obj->get_description(); | |||||||||||||||||||||||||||
| 347 | } | ||||||||||||||||||||||||||||
| 348 | 54 | ▶ | if(@scalar == 1) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 349 | { | ||||||||||||||||||||||||||||
| 350 | 0 | return $scalar[0]; | |||||||||||||||||||||||||||
| 351 | } | ||||||||||||||||||||||||||||
| 352 | |||||||||||||||||||||||||||||
| 353 | 54 | die "No scalar possibilities for " . $obj->get_description(); | |||||||||||||||||||||||||||
| 354 | } | ||||||||||||||||||||||||||||
| 355 | |||||||||||||||||||||||||||||
| 356 | 194 | ▶ | if(blessed($obj) && $obj->isa('App::RecordStream::Aggregator::Aggregation')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($obj) and $obj->isa("App::RecordStream::Aggregator::Aggregation")
MC/DC0%0/2
builtin::blessed($obj) and $obj->isa("App::RecordStream::Aggregator::Aggregation")
builtin::blessed($obj)
$obj->isa("App::RecordStream::Aggregator::Aggregation")
Truth table33%1/3
A and B
A= builtin::blessed($obj)B= $obj->isa("App::RecordStream::Aggregator::Aggregation")
| |||||||||||||||||||||||||||||
| 357 | { | ||||||||||||||||||||||||||||
| 358 | 0 | die "Aggregator found where scalar expected"; | |||||||||||||||||||||||||||
| 359 | } | ||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||
| 361 | 194 | ▶ | if(blessed($obj) && $obj->isa('App::RecordStream::DomainLanguage::Valuation')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Valuation")
MC/DC0%0/2
builtin::blessed($obj) and $obj->isa("App::RecordStream::DomainLanguage::Valuation")
builtin::blessed($obj)
$obj->isa("App::RecordStream::DomainLanguage::Valuation")
Truth table33%1/3
A and B
A= builtin::blessed($obj)B= $obj->isa("App::RecordStream::DomainLanguage::Valuation")
| |||||||||||||||||||||||||||||
| 362 | { | ||||||||||||||||||||||||||||
| 363 | 0 | die "Valuation found where scalar expected"; | |||||||||||||||||||||||||||
| 364 | } | ||||||||||||||||||||||||||||
| 365 | |||||||||||||||||||||||||||||
| 366 | 194 | return $obj; | |||||||||||||||||||||||||||
| 367 | } | ||||||||||||||||||||||||||||
| 368 | |||||||||||||||||||||||||||||
| 369 | 29 | 1; | |||||||||||||||||||||||||||