TableReader/Decoder/XLS.pm

filter: Statementstmt 95.0% 19 / 20 Branchbran 50.0% 2 / 4 Conditioncond 50.0% 3 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 74.3% 29 / 39 CC 5 SCAR 11.2
CC
5
Cov
80%
_build_workbook
4.6
default_xls_module
2.1
BEGIN
1.0
CRAP 3.1
« TableReader/Field.pm ↑ Summary TableReader/Iterator.pm »
1 package Data::TableReader::Decoder::XLS;
2 1 ▶use Moo 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 extends 'Data::TableReader::Decoder::Spreadsheet';
5  
6 1 our @xls_probe_modules= ( [ 'Spreadsheet::ParseExcel', '0.66' ] );
7 1 our $default_xls_module;
8 2 ▶sub default_xls_module {
Subroutine default_xls_module: called CC=2 SCAR=7.2
Pod documented
9 2 ▶ $default_xls_module ||=
Condition66%2/3
$Data::TableReader::Decoder::XLS::default_xls_module ||= Data::TableReader::Decoder::_first_sufficient_module("XLS parser", \@Data::TableReader::Decoder::XLS::xls_probe_modules)
l!l&&r!l&&!r
110
MC/DC0%0/2
$Data::TableReader::Decoder::XLS::default_xls_module ||= Data::TableReader::Decoder::_first_sufficient_module("XLS parser", \@Data::TableReader::Decoder::XLS::xls_probe_modules)
$Data::TableReader::Decoder::XLS::default_xls_module Data::TableReader::Decoder::_first_sufficient_module("XLS parser", \@Data::TableReader::Decoder::XLS::xls_probe_modules)
Truth table66%2/3
A ||= B
A= $Data::TableReader::Decoder::XLS::default_xls_moduleB= Data::TableReader::Decoder::_first_sufficient_module("XLS parser", \@Data::TableReader::Decoder::XLS::xls_probe_modules)
ABresult
1X1
011
000
10 Data::TableReader::Decoder::_first_sufficient_module('XLS parser', \@xls_probe_modules);
11 }
12  
13 # ABSTRACT: Access sheets/rows of a Microsoft Excel '97 workbook
14 1 our $VERSION = '0.023'; # VERSION
15  
16  
17 1 ▶sub _build_workbook {
Subroutine _build_workbook: called CC=4 SCAR=15.2
18 1 my $self= shift;
19
20 1 my $wbook;
21 1 my $f= $self->file_handle;
22 1 ▶ if (ref $f and ref($f)->can('worksheets')) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $f and ref($f)->can('worksheets')) { } 0 1 1
Condition33%1/3
ref $f and ref($f)->can("worksheets")
!ll&&!rl&&r
010
MC/DC0%0/2
ref $f and ref($f)->can("worksheets")
ref $f ref($f)->can("worksheets")
Truth table33%1/3
A and B
A= ref $fB= ref($f)->can("worksheets")
ABresult
0X0
100
111
23 0 $wbook= $f;
24 } else {
25 1 $wbook= $self->default_xls_module->new->parse($f, $self->xls_formatter);
26 }
27 1 ▶ defined $wbook or croak "Can't parse file '".$self->file_name."'";
Branch: 1 branch
BranchTrueFalseTotal
defined $wbook or croak(q[Can't parse file '] . $self->file_name . q[']) 1 0 1
28 1 return $wbook;
29 }
30  
31 1 1;
32  
33 __END__
« TableReader/Field.pm ↑ Summary TableReader/Iterator.pm »