Database/CsvProvider.pm

filter: Statementstmt 94.1% 32 / 34 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 81.8% 9 / 11 Podpod 66.6% 2 / 3 totaltotal 86.2% 44 / 51 CC 2 SCAR 2.9
CC
2
Cov
92%
_init
2.0
backup
2.0
restore
2.0
CRAP 1.3
« Database/Command/db.pm ↑ Summary
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Footprintless::Plugin::Database::CsvProvider;
5 1 $Footprintless::Plugin::Database::CsvProvider::VERSION = '1.06';
6 # ABSTRACT: A CSV file provider implementation
7 # PODNAME: Footprintless::Plugin::Database::CsvProvider
8  
9 1 ▶use parent qw(Footprintless::Plugin::Database::AbstractProvider);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use overload q{""} => 'to_string', fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Footprintless::Util qw(dynamic_module_new);
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use Log::Any;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 my $logger = Log::Any->get_logger();
17  
18 0 ▶sub backup {
Subroutine backup: not called CC=1 SCAR=6.9
Pod documented
19 0 die("not yet implemented");
20 }
21  
22 20 ▶sub _connection_string {
Subroutine _connection_string: called CC=1 SCAR=0.0
23 20 my ($self) = @_;
24 20 my ( $hostname, $port ) = $self->_hostname_port();
25 return
26 20 join( '', 'DBI:CSV:', 'f_dir=', $self->{f_dir}, ';', 'csv_eol=', $self->{csv_eol}, ';' );
27 }
28  
29 7 ▶sub _init {
Subroutine _init: called CC=2 SCAR=7.0
30 7 my ( $self, %options ) = @_;
31 7 $self->Footprintless::Plugin::Database::AbstractProvider::_init(%options);
32  
33 7 my $entity = $self->_entity( $self->{coordinate} );
34  
35 7 $self->{f_dir} = $entity->{f_dir};
36 7 ▶ $self->{csv_eol} = $entity->{csv_eol} || "\n";
Condition50%1/2
$entity->{'csv_eol'} || "\n"
l!l
07
MC/DC0%0/1
$entity->{'csv_eol'} || "\n"
$entity->{'csv_eol'}
Truth table50%1/2
A
A= $entity->{'csv_eol'}
Aresult
11
00
37  
38 7 return $self;
39 }
40  
41 0 ▶sub restore {
Subroutine restore: not called CC=1 SCAR=6.9
Pod documented
42 0 die("not yet implemented");
43 }
44  
45 15 ▶sub to_string {
Subroutine to_string: called CC=1 SCAR=0.0
Pod undocumented
46 15 my ($self) = @_;
47 15 return $self->_connection_string();
48 }
49  
50 1 1;
51  
52 __END__
« Database/Command/db.pm ↑ Summary