| 1 | package DBD::Mock::StatementTrack; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 41 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 41 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||
| 6 | 41 | ▶ | use List::Util qw( reduce ); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||
| 8 | 156 | ▶ | sub new { | ||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=11 SCAR=24.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 9 | 156 | my ( $class, %params ) = @_; | |||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||
| 11 | # these params have default values | ||||||||||||||||||||||||||||||||
| 12 | # but can be overridden | ||||||||||||||||||||||||||||||||
| 13 | 156 | ▶ | $params{return_data} ||= []; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$params{"return_data"} ||= []
MC/DC100%1/1
$params{"return_data"} ||= []
$params{"return_data"}
Truth table100%2/2
A
A= $params{"return_data"}
| |||||||||||||||||||||||||||||||||
| 14 | 156 | ▶ | $params{fields} ||= $DBD::Mock::DefaultFieldsToUndef ? undef : []; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$params{"fields"} ||= $DBD::Mock::DefaultFieldsToUndef ? undef : []
MC/DC100%2/2
$params{"fields"} ||= $DBD::Mock::DefaultFieldsToUndef ? undef : []
$params{"fields"}
$DBD::Mock::DefaultFieldsToUndef ? undef : []
Truth table100%3/3
A ||= B
A= $params{"fields"}B= $DBD::Mock::DefaultFieldsToUndef ? undef : []
| |||||||||||||||||||||||||||||||||
| 15 | 156 | ▶ | $params{bound_params} ||= []; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$params{"bound_params"} ||= []
MC/DC100%1/1
$params{"bound_params"} ||= []
$params{"bound_params"}
Truth table100%2/2
A
A= $params{"bound_params"}
| |||||||||||||||||||||||||||||||||
| 16 | 156 | ▶ | $params{bound_param_attrs} ||= []; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
$params{"bound_param_attrs"} ||= []
MC/DC0%0/1
$params{"bound_param_attrs"} ||= []
$params{"bound_param_attrs"}
Truth table50%1/2
A
A= $params{"bound_param_attrs"}
| |||||||||||||||||||||||||||||||||
| 17 | 156 | ▶ | $params{statement} ||= ""; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$params{"statement"} ||= ""
MC/DC100%1/1
$params{"statement"} ||= ""
$params{"statement"}
Truth table100%2/2
A
A= $params{"statement"}
| |||||||||||||||||||||||||||||||||
| 18 | 156 | ▶ | $params{failure} ||= undef; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$params{"failure"} ||= undef
MC/DC100%1/1
$params{"failure"} ||= undef
$params{"failure"}
Truth table100%2/2
A
A= $params{"failure"}
| |||||||||||||||||||||||||||||||||
| 19 | 156 | ▶ | $params{callback} ||= undef; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$params{"callback"} ||= undef
MC/DC100%1/1
$params{"callback"} ||= undef
$params{"callback"}
Truth table100%2/2
A
A= $params{"callback"}
| |||||||||||||||||||||||||||||||||
| 20 | 156 | ▶ | $params{driver_attributes} ||= {}; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$params{"driver_attributes"} ||= {}
MC/DC100%1/1
$params{"driver_attributes"} ||= {}
$params{"driver_attributes"}
Truth table100%2/2
A
A= $params{"driver_attributes"}
| |||||||||||||||||||||||||||||||||
| 21 | 156 | ▶ | $params{execute_attributes} ||= {}; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$params{"execute_attributes"} ||= {}
MC/DC100%1/1
$params{"execute_attributes"} ||= {}
$params{"execute_attributes"}
Truth table100%2/2
A
A= $params{"execute_attributes"}
| |||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||
| 23 | # these params should never be overridden | ||||||||||||||||||||||||||||||||
| 24 | # and should always start out in a default | ||||||||||||||||||||||||||||||||
| 25 | # state to assure the sanity of this class | ||||||||||||||||||||||||||||||||
| 26 | 156 | $params{is_executed} = 'no'; | |||||||||||||||||||||||||||||||
| 27 | 156 | $params{is_finished} = 'no'; | |||||||||||||||||||||||||||||||
| 28 | 156 | $params{current_record_num} = 0; | |||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||
| 30 | # NOTE: | ||||||||||||||||||||||||||||||||
| 31 | # changed from \%params here because that | ||||||||||||||||||||||||||||||||
| 32 | # would bind the hash sent in so that it | ||||||||||||||||||||||||||||||||
| 33 | # would reflect alterations in the object | ||||||||||||||||||||||||||||||||
| 34 | # this violates encapsulation | ||||||||||||||||||||||||||||||||
| 35 | 156 | my $self = bless {%params}, $class; | |||||||||||||||||||||||||||||||
| 36 | 156 | return $self; | |||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||
| 39 | 160 | ▶ | sub has_failure { | ||||||||||||||||||||||||||||||
|
Subroutine
has_failure: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 40 | 160 | my ($self) = @_; | |||||||||||||||||||||||||||||||
| 41 | 160 | ▶ | $self->{failure} ? 1 : 0; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||
| 44 | 3 | ▶ | sub get_failure { | ||||||||||||||||||||||||||||||
|
Subroutine
get_failure: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 45 | 3 | my ($self) = @_; | |||||||||||||||||||||||||||||||
| 46 | 3 | @{ $self->{failure} }; | |||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||
| 49 | 4 | ▶ | sub num_fields { | ||||||||||||||||||||||||||||||
|
Subroutine
num_fields: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 50 | 4 | my ($self) = @_; | |||||||||||||||||||||||||||||||
| 51 | 4 | ▶ | return $self->{fields} ? scalar @{ $self->{fields} } : $self->{fields}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||
| 54 | 48 | ▶ | sub num_rows { | ||||||||||||||||||||||||||||||
|
Subroutine
num_rows: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 55 | 48 | my ($self) = @_; | |||||||||||||||||||||||||||||||
| 56 | 48 | return scalar @{ $self->{return_data} }; | |||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||
| 59 | 146 | ▶ | sub num_params { | ||||||||||||||||||||||||||||||
|
Subroutine
num_params: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 60 | 146 | my ($self) = @_; | |||||||||||||||||||||||||||||||
| 61 | 146 | return scalar @{ $self->{bound_params} }; | |||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||
| 64 | 13 | ▶ | sub bind_col { | ||||||||||||||||||||||||||||||
|
Subroutine
bind_col: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 65 | 13 | my ( $self, $param_num, $ref ) = @_; | |||||||||||||||||||||||||||||||
| 66 | 13 | $self->{bind_cols}->[ $param_num - 1 ] = $ref; | |||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||
| 69 | 17 | ▶ | sub bound_param { | ||||||||||||||||||||||||||||||
|
Subroutine
bound_param: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 70 | 17 | my ( $self, $param_num, $value, $attr ) = @_; | |||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||
| 72 | # Basic support for named parameters | ||||||||||||||||||||||||||||||||
| 73 | 17 | ▶ | if ( $param_num !~ /^\d+/ ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 74 | 2 | $param_num = $self->num_params + 1; | |||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||
| 77 | 17 | $self->{bound_params}->[ $param_num - 1 ] = $value; | |||||||||||||||||||||||||||||||
| 78 | 17 | ▶ | $self->{bound_param_attrs}->[ $param_num - 1 ] = ref $attr eq "HASH" ? { %$attr } : $attr; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||
| 80 | 17 | return $self->bound_params; | |||||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||
| 83 | 1 | ▶ | sub bound_param_trailing { | ||||||||||||||||||||||||||||||
|
Subroutine
bound_param_trailing: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 84 | 1 | my ( $self, @values ) = @_; | |||||||||||||||||||||||||||||||
| 85 | 1 | push @{ $self->{bound_params} }, @values; | |||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||
| 88 | 126 | ▶ | sub bind_cols { | ||||||||||||||||||||||||||||||
|
Subroutine
bind_cols: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 89 | 126 | my $self = shift; | |||||||||||||||||||||||||||||||
| 90 | 126 | ▶ | return @{ $self->{bind_cols} || [] }; | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{'bind_cols'} || []
MC/DC100%1/1
$self->{'bind_cols'} || []
$self->{'bind_cols'}
Truth table100%2/2
A
A= $self->{'bind_cols'}
| |||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||
| 93 | 57 | ▶ | sub bind_params { | ||||||||||||||||||||||||||||||
|
Subroutine
bind_params: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 94 | 57 | my ( $self, @values ) = @_; | |||||||||||||||||||||||||||||||
| 95 | 57 | @{ $self->{bound_params} } = @values; | |||||||||||||||||||||||||||||||
| 96 | 57 | @{ $self->{bound_param_attrs} } = map { undef } @values; | |||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||
| 99 | # Rely on the DBI's notion of Active: a statement is active if it's | ||||||||||||||||||||||||||||||||
| 100 | # currently in a SELECT and has more records to fetch | ||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||
| 102 | 10 | ▶ | sub is_active { | ||||||||||||||||||||||||||||||
|
Subroutine
is_active: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 103 | 10 | my ($self) = @_; | |||||||||||||||||||||||||||||||
| 104 | 10 | ▶ | return 0 unless $self->statement =~ /^\s*select/ism; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 105 | 7 | ▶ | return 0 unless $self->is_executed eq 'yes'; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 106 | 6 | ▶ | return 0 if $self->is_depleted; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 107 | 3 | return 1; | |||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||
| 110 | 50 | ▶ | sub is_finished { | ||||||||||||||||||||||||||||||
|
Subroutine
is_finished: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 111 | 50 | my ( $self, $value ) = @_; | |||||||||||||||||||||||||||||||
| 112 | 50 | ▶ | if ( defined $value && $value eq 'yes' ) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
defined $value and $value eq "yes"
MC/DC100%2/2
defined $value and $value eq "yes"
defined $value
$value eq "yes"
Truth table100%3/3
A and B
A= defined $valueB= $value eq "yes"
| |||||||||||||||||||||||||||||||||
| 113 | 39 | $self->{is_finished} = 'yes'; | |||||||||||||||||||||||||||||||
| 114 | 39 | $self->current_record_num(0); | |||||||||||||||||||||||||||||||
| 115 | 39 | $self->{return_data} = []; | |||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||
| 117 | elsif ( defined $value ) { | ||||||||||||||||||||||||||||||||
| 118 | 1 | $self->{is_finished} = 'no'; | |||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||
| 120 | 50 | return $self->{is_finished}; | |||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||
| 123 | #################### | ||||||||||||||||||||||||||||||||
| 124 | # RETURN VALUES | ||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||
| 126 | 142 | ▶ | sub mark_executed { | ||||||||||||||||||||||||||||||
|
Subroutine
mark_executed: called CC=7 SCAR=19.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 127 | 142 | my ($self) = @_; | |||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||
| 130 | 142 | push @{$self->{execution_history} }, { | |||||||||||||||||||||||||||||||
| 131 | 142 | params => [ @{ $self->{bound_params} } ], | |||||||||||||||||||||||||||||||
| 132 | 142 | attrs => [ @{ $self->{bound_param_attrs} } ], | |||||||||||||||||||||||||||||||
| 133 | }; | ||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||
| 135 | 142 | $self->is_executed('yes'); | |||||||||||||||||||||||||||||||
| 136 | 142 | $self->current_record_num(0); | |||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||
| 138 | 142 | $self->{driver_attributes} = { %{ $self->{driver_attributes} }, %{ $self->{execute_attributes} } }; | |||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||
| 140 | 142 | ▶ | if (ref $self->{callback} eq "CODE") { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 141 | 13 | my %recordSet = $self->{callback}->(@{ $self->{bound_params} }); | |||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||
| 143 | 13 | ▶ | if (ref $recordSet{fields} eq "ARRAY") { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 144 | 10 | $self->{fields} = $recordSet{fields}; | |||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||
| 147 | 13 | ▶ | if (ref $recordSet{rows} eq "ARRAY") { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 148 | 13 | ▶ | die "DBD::Mock error - a resultset's callback should return rows as an arrayref of arrayrefs" if reduce { ref $b ne "ARRAY" ? 1 : $a } 0, @{ $recordSet{rows} }; | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 149 | 12 | $self->{return_data} = $recordSet{rows}; | |||||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||
| 152 | 12 | ▶ | if (defined $recordSet{last_insert_id}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 153 | 2 | $self->{last_insert_id} = $recordSet{last_insert_id}; | |||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||
| 156 | 12 | ▶ | if (defined $recordSet{execute_attributes}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 157 | 1 | $self->{driver_attributes} = { %{ $self->{driver_attributes} }, %{ $recordSet{execute_attributes} } }; | |||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||
| 162 | 174 | ▶ | sub next_record { | ||||||||||||||||||||||||||||||
|
Subroutine
next_record: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 163 | 174 | my ($self) = @_; | |||||||||||||||||||||||||||||||
| 164 | 174 | ▶ | return if $self->is_depleted; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 165 | 145 | my $rec_num = $self->current_record_num; | |||||||||||||||||||||||||||||||
| 166 | 145 | my $rec = $self->return_data->[$rec_num]; | |||||||||||||||||||||||||||||||
| 167 | 145 | $self->current_record_num( $rec_num + 1 ); | |||||||||||||||||||||||||||||||
| 168 | 145 | return $rec; | |||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||
| 171 | 193 | ▶ | sub is_depleted { | ||||||||||||||||||||||||||||||
|
Subroutine
is_depleted: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 172 | 193 | my ($self) = @_; | |||||||||||||||||||||||||||||||
| 173 | 193 | return ( $self->current_record_num >= scalar @{ $self->return_data } ); | |||||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||
| 176 | # DEBUGGING AID | ||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | sub to_string { | ||||||||||||||||||||||||||||||
|
Subroutine
to_string: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 179 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||
| 180 | return join "\n" => ( | ||||||||||||||||||||||||||||||||
| 181 | $self->{statement}, | ||||||||||||||||||||||||||||||||
| 182 | 0 | "Values: [" . join( '] [', @{ $self->{bound_params} } ) . "]", | |||||||||||||||||||||||||||||||
| 183 | "Records: on $self->{current_record_num} of " | ||||||||||||||||||||||||||||||||
| 184 | 0 | . scalar( @{ $self->return_data } ) . "\n", | |||||||||||||||||||||||||||||||
| 185 | "Executed? $self->{is_executed}; Finished? $self->{is_finished}" | ||||||||||||||||||||||||||||||||
| 186 | ); | ||||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||
| 189 | # PROPERTIES | ||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||
| 191 | # boolean | ||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||
| 193 | 156 | ▶ | sub is_executed { | ||||||||||||||||||||||||||||||
|
Subroutine
is_executed: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 194 | 156 | my ( $self, $yes_no ) = @_; | |||||||||||||||||||||||||||||||
| 195 | 156 | ▶ | $self->{is_executed} = $yes_no if defined $yes_no; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 196 | 156 | ▶ | return ( $self->{is_executed} eq 'yes' ) ? 'yes' : 'no'; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||
| 199 | # single-element fields | ||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||
| 201 | 29 | ▶ | sub statement { | ||||||||||||||||||||||||||||||
|
Subroutine
statement: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 202 | 29 | my ( $self, $value ) = @_; | |||||||||||||||||||||||||||||||
| 203 | 29 | ▶ | $self->{statement} = $value if defined $value; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 204 | 29 | return $self->{statement}; | |||||||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||
| 207 | 681 | ▶ | sub current_record_num { | ||||||||||||||||||||||||||||||
|
Subroutine
current_record_num: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 208 | 681 | my ( $self, $value ) = @_; | |||||||||||||||||||||||||||||||
| 209 | 681 | ▶ | $self->{current_record_num} = $value if defined $value; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 210 | 681 | return $self->{current_record_num}; | |||||||||||||||||||||||||||||||
| 211 | } | ||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||
| 213 | 0 | ▶ | sub callback { | ||||||||||||||||||||||||||||||
|
Subroutine
callback: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 214 | 0 | my ( $self, $callback ) = @_; | |||||||||||||||||||||||||||||||
| 215 | 0 | ▶ | $self->{callback} = $callback if defined $callback; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 216 | 0 | return $self->{callback}; | |||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||
| 219 | # multi-element fields | ||||||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||||||
| 221 | 341 | ▶ | sub return_data { | ||||||||||||||||||||||||||||||
|
Subroutine
return_data: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 222 | 341 | my ( $self, @values ) = @_; | |||||||||||||||||||||||||||||||
| 223 | 0 | ▶ | push @{ $self->{return_data} }, @values if scalar @values; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 224 | 341 | return $self->{return_data}; | |||||||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||
| 227 | 166 | ▶ | sub fields { | ||||||||||||||||||||||||||||||
|
Subroutine
fields: called CC=3 SCAR=12.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 228 | 166 | my ( $self, @values ) = @_; | |||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||
| 230 | 166 | ▶ | $self->{fields} ||= []; | ||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->{"fields"} ||= []
MC/DC0%0/1
$self->{"fields"} ||= []
$self->{"fields"}
Truth table50%1/2
A
A= $self->{"fields"}
| |||||||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||||||
| 232 | 0 | ▶ | push @{ $self->{fields} }, @values if scalar @values; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||
| 234 | 166 | return $self->{fields}; | |||||||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||
| 237 | 93 | ▶ | sub bound_params { | ||||||||||||||||||||||||||||||
|
Subroutine
bound_params: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 238 | 93 | my ( $self, @values ) = @_; | |||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | push @{ $self->{bound_params} }, @values if scalar @values; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 240 | 93 | return $self->{bound_params}; | |||||||||||||||||||||||||||||||
| 241 | } | ||||||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||||||
| 243 | 6 | ▶ | sub bound_param_attrs { | ||||||||||||||||||||||||||||||
|
Subroutine
bound_param_attrs: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 244 | 6 | my ( $self, @values ) = @_; | |||||||||||||||||||||||||||||||
| 245 | 0 | ▶ | push @{ $self->{bound_param_attrs} }, @values if scalar @values; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 246 | 6 | return $self->{bound_param_attrs}; | |||||||||||||||||||||||||||||||
| 247 | } | ||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||
| 249 | 1 | ▶ | sub execution_history { | ||||||||||||||||||||||||||||||
|
Subroutine
execution_history: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 250 | 1 | my ( $self, @values ) = @_; | |||||||||||||||||||||||||||||||
| 251 | 0 | ▶ | push @{ $self->{execution_history} }, @values if scalar @values; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 252 | 1 | return $self->{execution_history}; | |||||||||||||||||||||||||||||||
| 253 | } | ||||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||||
| 255 | 41 | 1; | |||||||||||||||||||||||||||||||