SPOPS/Exception/DBI.pm

filter: Statementstmt 87.5% 21 / 24 Branchbran 37.5% 3 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 3 totaltotal 70.7% 29 / 41 CC 5 SCAR 13.2
CC
5
Cov
75%
to_string
6.3
spops_dbi_error
2.0
BEGIN
1.0
CRAP 3.7
« SPOPS/Import.pm ↑ Summary SPOPS/DBI/Sybase.pm »
1 package SPOPS::Exception::DBI;
2  
3 # $Id: DBI.pm,v 3.3 2004/06/02 00:48:22 lachoy Exp $
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use base qw( SPOPS::Exception );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 $SPOPS::Exception::DBI::VERSION = sprintf("%d.%02d", q$Revision: 3.3 $ =~ /(\d+)\.(\d+)/);
9 1 @SPOPS::Exception::DBI::EXPORT_OK = qw( spops_dbi_error );
10  
11 1 my @FIELDS = qw( sql bound_value action );
12 1 SPOPS::Exception::DBI->mk_accessors( @FIELDS );
13  
14 1 ▶sub get_fields {
Subroutine get_fields: called CC=1 SCAR=0.0
Pod undocumented
15 1 return ( $_[0]->SUPER::get_fields, @FIELDS );
16 }
17  
18 0 ▶sub spops_dbi_error {
Subroutine spops_dbi_error: not called CC=1 SCAR=6.9
Pod undocumented
19 0 goto &SPOPS::Exception::throw( 'SPOPS::Exception::DBI', @_ );
20 }
21  
22 1 ▶sub to_string {
Subroutine to_string: called CC=5 SCAR=18.3
Pod undocumented
23 1 my ( $self ) = @_;
24 1 my $class = ref $self;
25 1 ▶ return "Invalid -- not called from object." unless ( $class );
Branch: 1 branch
BranchTrueFalseTotal
unless $class 0 1 1
26  
27 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
28 1 ▶ if ( $self->sql ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->sql) { } 1 0 1
29 1 ▶ return ( ${ $class . '::ShowTrace' } )
Branch: 1 branch
BranchTrueFalseTotal
${$class . '::ShowTrace';} ? : 0 1 1
30 ? join( "\n", $self->message, $self->sql, $self->trace->as_string )
31 : join( "\n", $self->message(), $self->sql );
32 }
33 else {
34 0 ▶ return ( ${ $class . '::ShowTrace' } )
Branch: 1 branch
BranchTrueFalseTotal
${$class . '::ShowTrace';} ? : 0 0 0
35 ? join( "\n", $self->message, $self->trace->as_string )
36 : $self->message();
37 }
38 }
39  
40 1 1;
41  
42 __END__
« SPOPS/Import.pm ↑ Summary SPOPS/DBI/Sybase.pm »