| 1 | package DBD::PO::Table; | ||||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||||
| 6 | 1 | our $VERSION = '2.00'; | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use DBD::File; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use parent qw(-norequire DBD::File::Table); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use English qw(-no_match_vars $INPUT_RECORD_SEPARATOR); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 0 | ▶ | sub fetch_row { | ||||||||||||||||||||||||||
|
Subroutine
fetch_row: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 15 | 0 | my ($self, $data) = @_; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | my $file_handle = $self->{fh}; | |||||||||||||||||||||||||||
| 18 | 0 | my $file_name = $self->{file}; | |||||||||||||||||||||||||||
| 19 | 0 | my $fields; | |||||||||||||||||||||||||||
| 20 | 0 | ▶ | if (exists $self->{cached_row}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | 0 | $fields = delete $self->{cached_row}; | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | else { | ||||||||||||||||||||||||||||
| 24 | 0 | my $po = $self->{po_po}; | |||||||||||||||||||||||||||
| 25 | 0 | local $INPUT_RECORD_SEPARATOR = $po->{eol}; | |||||||||||||||||||||||||||
| 26 | 0 | $fields = $po->read_entry($file_name, $file_handle); | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 0 | ▶ | return $self->{row} = @{$fields} ? $fields : (); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 0 | ▶ | sub push_row { | ||||||||||||||||||||||||||
|
Subroutine
push_row: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 33 | 0 | my ($self, $data, $fields) = @_; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 0 | my $po = $self->{po_po}; | |||||||||||||||||||||||||||
| 36 | 0 | my $file_handle = $self->{fh}; | |||||||||||||||||||||||||||
| 37 | 0 | my $file_name = $self->{file}; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | # Remove undef from the right end of the fields, so that at least | ||||||||||||||||||||||||||||
| 40 | # in these cases undef is returned from FetchRow | ||||||||||||||||||||||||||||
| 41 | 0 | ▶ | while (@{$fields} && ! defined $fields->[-1]) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@{$fields;} and not defined $fields->[-1]
MC/DC0%0/2
@{$fields;} and not defined $fields->[-1]
@{$fields;}
not defined $fields->[-1]
Truth table0%0/3
A and not(B)
A= @{$fields;}B= not defined $fields->[-1]
| |||||||||||||||||||||||||||||
| 42 | 0 | pop @{$fields}; | |||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||
| 44 | 0 | $po->write_entry($file_name, $file_handle, $fields); | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 0 | return 1; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 0 | ▶ | sub push_names { | ||||||||||||||||||||||||||
|
Subroutine
push_names: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 50 | 0 | my ($self, $data, $fields) = @_; | |||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 0 | return 1; | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 1 | 1; | |||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | __END__ | ||||||||||||||||||||||||||||