DBD/PO/Table.pm

filter: Statementstmt 46.5% 20 / 43 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 6 / 9 Podpod 100% 3 / 3 totaltotal 43.9% 29 / 66 CC 5 SCAR 18.2
CC
5
Cov
38%
fetch_row
12.0
push_row
12.0
push_names
2.0
CRAP 6.2
« DBD/PO/Locale/PO.pm ↑ Summary Test/DBD/PO/Defaults.pm »
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
BranchTrueFalseTotal
if (exists $self->{'cached_row'}) { } 0 0 0
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
BranchTrueFalseTotal
@{$fields;} ? : 0 0 0
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
BranchTrueFalseTotal
if (@{$fields;} and not defined $fields->[-1]) 0 0 0
Condition0%0/3
@{$fields;} and not defined $fields->[-1]
!ll&&!rl&&r
000
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]
ABresult
0X0
100
111
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__
« DBD/PO/Locale/PO.pm ↑ Summary Test/DBD/PO/Defaults.pm »