MSSQL/Storage/StopAtFirstError.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 4 / 4 Conditioncond 88.8% 8 / 9 MC/DCmcdc 80.0% 4 / 5 Subroutinesub 88.8% 8 / 9 Podpod 33.3% 1 / 3 totaltotal 90.7% 49 / 54 CC 6 SCAR 7.0
CC
6
Cov
97%
can
3.0
__ANON__
3.0
execute_for_fetch
2.0
CRAP 2.0
« MSSQL/Storage/DateTime/Format.pm ↑ Summary MSSQL/Storage/Sybase/DateTime/Format.pm »
1 package DBIO::MSSQL::Storage::StopAtFirstError;
2 # ABSTRACT: A statement handle whose execute_for_fetch stops at the first failing tuple
3  
4 25 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 25 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 25 our $VERSION = '0.900007';
8  
9 25 ▶use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 25 our $AUTOLOAD;
12  
13  
14 9 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
15 9 my ($class, $sth) = @_;
16 9 return bless { sth => $sth }, $class;
17 }
18  
19  
20 9 ▶sub execute_for_fetch {
Subroutine execute_for_fetch: called CC=2 SCAR=6.9
Pod documented
21 9 my ($self, $fetch_tuple, $tuple_status, @rest) = @_;
22  
23 9 ▶ $tuple_status = [] unless $tuple_status;
Branch: 1 branch
BranchTrueFalseTotal
unless $tuple_status 1 8 9
24  
25 return $self->{sth}->execute_for_fetch(
26 26 ▶ sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
27 26 ▶ return undef if @$tuple_status and ref $tuple_status->[-1];
Branch: 1 branch
BranchTrueFalseTotal
if @$tuple_status and ref $tuple_status->[-1] 2 24 26
Condition100%3/3
@$tuple_status and ref $tuple_status->[-1]
!ll&&!rl&&r
9152
MC/DC100%2/2
@$tuple_status and ref $tuple_status->[-1]
@$tuple_status ref $tuple_status->[-1]
Truth table100%3/3
A and B
A= @$tuple_statusB= ref $tuple_status->[-1]
ABresult
0X0
100
111
28 24 return $fetch_tuple->();
29 },
30 9 $tuple_status,
31 @rest,
32 );
33 }
34  
35 3 ▶sub can {
Subroutine can: called CC=3 SCAR=11.0
Pod undocumented
36 3 my ($self, $method) = @_;
37 3 ▶ return $self->SUPER::can($method) || ( ref $self && $self->{sth}->can($method) );
Condition83%5/6
$self->SUPER::can($method) || ref $self && $self->{'sth'}->can($method)
l!l&&r!l&&!r
111
ref $self and $self->{"sth"}->can($method)
!ll&&!rl&&r
011
MC/DC66%2/3
$self->SUPER::can($method) || ref $self && $self->{'sth'}->can($method)
$self->SUPER::can($method) ref $self $self->{"sth"}->can($method)
Truth table75%3/4
A || B and C
A= $self->SUPER::can($method)B= ref $selfC= $self->{"sth"}->can($method)
ABCresult
1XX1
0111
00X0
0100
38 }
39  
40 0 ▶sub DESTROY { }
Subroutine DESTROY: not called CC=1 SCAR=0.0
41  
42 17 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: called CC=1 SCAR=0.0
43 17 my $self = shift;
44 17 ( my $method = $AUTOLOAD ) =~ s/.*:://;
45 17 return $self->{sth}->$method(@_);
46 }
47  
48 25 1;
49  
50 __END__
« MSSQL/Storage/DateTime/Format.pm ↑ Summary MSSQL/Storage/Sybase/DateTime/Format.pm »