| 1 | package Data::TableReader::Decoder::XLSX; | ||||||||||||||||||||||||||||
| 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 @xlsx_probe_modules= ( [ 'Spreadsheet::ParseXLSX', '0.30' ], 'Spreadsheet::XLSX' ); | |||||||||||||||||||||||||||
| 7 | 1 | our $default_xlsx_module; | |||||||||||||||||||||||||||
| 8 | 1 | ▶ | sub default_xlsx_module { | ||||||||||||||||||||||||||
|
Subroutine
default_xlsx_module: called CC=2 SCAR=9.2
Pod
documented
| |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | $default_xlsx_module ||= | ||||||||||||||||||||||||||
|
Condition33%1/3
$Data::TableReader::Decoder::XLSX::default_xlsx_module ||= Data::TableReader::Decoder::_first_sufficient_module("XLSX parser", \@Data::TableReader::Decoder::XLSX::xlsx_probe_modules)
MC/DC0%0/2
$Data::TableReader::Decoder::XLSX::default_xlsx_module ||= Data::TableReader::Decoder::_first_sufficient_module("XLSX parser", \@Data::TableReader::Decoder::XLSX::xlsx_probe_modules)
$Data::TableReader::Decoder::XLSX::default_xlsx_module
Data::TableReader::Decoder::_first_sufficient_module("XLSX parser", \@Data::TableReader::Decoder::XLSX::xlsx_probe_modules)
Truth table33%1/3
A ||= B
A= $Data::TableReader::Decoder::XLSX::default_xlsx_moduleB= Data::TableReader::Decoder::_first_sufficient_module("XLSX parser", \@Data::TableReader::Decoder::XLSX::xlsx_probe_modules)
| |||||||||||||||||||||||||||||
| 10 | Data::TableReader::Decoder::_first_sufficient_module('XLSX parser', \@xlsx_probe_modules); | ||||||||||||||||||||||||||||
| 11 | } | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | # ABSTRACT: Access sheets/rows of a modern Microsoft Excel workbook | ||||||||||||||||||||||||||||
| 14 | 1 | our $VERSION = '0.023'; # VERSION | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | sub _build_workbook { | ||||||||||||||||||||||||||
|
Subroutine
_build_workbook: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||
| 18 | 0 | my $self= shift; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 0 | my $wbook; | |||||||||||||||||||||||||||
| 21 | 0 | my $f= $self->file_handle; | |||||||||||||||||||||||||||
| 22 | 0 | ▶ | if (ref $f and ref($f)->can('worksheets')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $f and ref($f)->can("worksheets")
MC/DC0%0/2
ref $f and ref($f)->can("worksheets")
ref $f
ref($f)->can("worksheets")
Truth table0%0/3
A and B
A= ref $fB= ref($f)->can("worksheets")
| |||||||||||||||||||||||||||||
| 23 | 0 | $wbook= $f; | |||||||||||||||||||||||||||
| 24 | } else { | ||||||||||||||||||||||||||||
| 25 | 0 | my $class= $self->default_xlsx_module; | |||||||||||||||||||||||||||
| 26 | # Spreadsheet::XLSX has an incompatible constructor | ||||||||||||||||||||||||||||
| 27 | 0 | ▶ | if ($class->isa('Spreadsheet::XLSX')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | 0 | $wbook= $class->new($f); | |||||||||||||||||||||||||||
| 29 | } else { | ||||||||||||||||||||||||||||
| 30 | 0 | $wbook= $class->new->parse($f, $self->xls_formatter); | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | 0 | ▶ | defined $wbook or croak "Can't parse file '".$self->file_name."'"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | 0 | return $wbook; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 1 | 1; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | __END__ | ||||||||||||||||||||||||||||