blib/lib/Class/DBI/Plugin/DateFormat/Oracle.pm

filter: Statementstmt 65.7% 23 / 35 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod n/a totaltotal 61.7% 29 / 47 CC 3 SCAR 9.3
CC
3
Cov
59%
__ANON__
4.9
__ANON__
4.7
import
1.3
CRAP 2.5
↑ Summary
1 package Class::DBI::Plugin::DateFormat::Oracle;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 $VERSION = '0.01';
9  
10 1 ▶sub import {
Subroutine import: called CC=1 SCAR=2.3
11 1 my $class = shift;
12 1 my $pkg = caller(0);
13  
14 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶ *{"$pkg\::set_nls_date_format"} = sub {
Subroutine __ANON__: not called CC=2 SCAR=15.4
16 0 my $self = shift;
17 0 my $format = shift;
18  
19 0 eval {
20 0 $pkg->db_Main->do(qq[ALTER SESSION SET NLS_DATE_FORMAT = '$format']);
21 };
22 0 ▶ $self->_croak("ALTER SESSION ERROR ".$@ ) if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 0 0
23 1 };
24  
25 1 ▶ *{"$pkg\::get_nls_date_format"} = sub {
Subroutine __ANON__: not called CC=2 SCAR=15.9
26 0 my $self = shift;
27 0 my $date_format;
28  
29 0 $self->set_sql(nls_date_format => q[SELECT VALUE FROM v$nls_parameters WHERE PARAMETER = 'NLS_DATE_FORMAT']);
30  
31 0 eval {
32 0 $date_format = $self->search_nls_date_format->first->{value};
33 };
34  
35 0 ▶ $self->_croak("SELECT NLS_DATE_FORMAT ERROR ".$@ ) if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 0 0
36 0 return $date_format;
37 }
38 1 }
39  
40 1 1;
41 __END__
↑ Summary