| 1 | package ODS::Table::Column::Boolean; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use YAOO; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||
| 5 | 2 | extends 'ODS::Table::Column::Base'; | |||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use ODS::Utils qw/clone error/; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | 2 | has reference => isa(boolean); | |||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||
| 11 | sub validation { | ||||||||||||||||||||||||||||||||
| 12 | 0 | ▶ | if (ref($_[1] || "") ne 'SCALAR' && ${$_[1]} !~ m/1|0/) { | ||||||||||||||||||||||||||||||
|
Subroutine
validation: not called CC=4 SCAR=30.0
Pod
undocumented
Branch: 1 branch
Condition0%0/5
ref($_[1] || "") ne "SCALAR" and not ${$_[1];} =~ /1|0/
$_[1] || ''
MC/DC0%0/2
ref($_[1] || "") ne "SCALAR" and not ${$_[1];} =~ /1|0/
$_[1]
not ${$_[1];} =~ /1|0/
Truth table0%0/3
A and not(B)
A= $_[1]B= not ${$_[1];} =~ /1|0/
| |||||||||||||||||||||||||||||||||
| 13 | 0 | croak sprintf "The value passed to the %s column does not match the boolean constraint.", | |||||||||||||||||||||||||||||||
| 14 | $_[0]->name; | ||||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||||
| 16 | 0 | return $_[1]; | |||||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||
| 19 | sub inflation { | ||||||||||||||||||||||||||||||||
| 20 | 2 | ▶ | my ($self, $value) = @_; | ||||||||||||||||||||||||||||||
|
Subroutine
inflation: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 21 | 2 | ▶ | if (! ref $value) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 22 | 1 | $self->reference(\1); | |||||||||||||||||||||||||||||||
| 23 | 1 | $value = \!!$value; | |||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||
| 27 | sub deflation { | ||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | my ($self, $value) = @_; | ||||||||||||||||||||||||||||||
|
Subroutine
deflation: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | if ($self->reference && ref $value) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->reference and ref $value
MC/DC0%0/2
$self->reference and ref $value
$self->reference
ref $value
Truth table0%0/3
A and B
A= $self->referenceB= ref $value
| |||||||||||||||||||||||||||||||||
| 30 | 0 | $value = $$value; | |||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||
| 32 | 0 | return $value; | |||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||
| 35 | 2 | 1; | |||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||
| 37 | __END__ | ||||||||||||||||||||||||||||||||