Parser/DocumentArchive.pm

filter: Statementstmt 44.8% 13 / 29 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 40.0% 4 / 10 Podpod 83.3% 5 / 6 totaltotal 44.9% 22 / 49 CC 3 SCAR 11.0
CC
3
Cov
39%
new
6.0
sheet
6.0
workbook
2.0
CRAP 3.0
« Parser/Relationships.pm ↑ Summary Parser/Workbook.pm »
1 package Data::XLSX::Parser::DocumentArchive;
2 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 9 ▶use Archive::Zip;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
9 0 my ($class, $filename) = @_;
10  
11 0 my $zip = Archive::Zip->new;
12 0 ▶ if ($zip->read($filename) != Archive::Zip::AZ_OK) {
Branch: 1 branch
BranchTrueFalseTotal
if ($zip->read($filename) != 0) 0 0 0
13 0 confess "couldn't open file: $filename $!";
14 }
15  
16 bless {
17 0 _zip => $zip,
18 }, $class;
19 }
20  
21 0 ▶sub workbook {
Subroutine workbook: not called CC=1 SCAR=6.9
Pod documented
22 0 my ($self) = @_;
23 0 $self->{_zip}->memberNamed('xl/workbook.xml');
24 }
25  
26 0 ▶sub sheet {
Subroutine sheet: not called CC=2 SCAR=17.9
Pod documented
27 0 my ($self, $path) = @_;
28 # only add xl/ if not already there, as some tools add absolute paths in relations
29 0 ▶ $path = sprintf ('xl/%s', $path) unless $path =~ /^xl\//;
Branch: 1 branch
BranchTrueFalseTotal
unless $path =~ m[^xl/] 0 0 0
30 0 $self->{_zip}->memberNamed($path);
31 }
32  
33 0 ▶sub shared_strings {
Subroutine shared_strings: not called CC=1 SCAR=6.9
Pod documented
34 0 my ($self) = @_;
35 0 $self->{_zip}->memberNamed('xl/sharedStrings.xml');
36 }
37  
38 0 ▶sub styles {
Subroutine styles: not called CC=1 SCAR=6.9
Pod documented
39 0 my ($self) = @_;
40 0 $self->{_zip}->memberNamed('xl/styles.xml');
41 }
42  
43 0 ▶sub relationships {
Subroutine relationships: not called CC=1 SCAR=6.9
Pod documented
44 0 my ($self) = @_;
45 0 $self->{_zip}->memberNamed('xl/_rels/workbook.xml.rels');
46 }
47  
48 9 1;
49 __END__
« Parser/Relationships.pm ↑ Summary Parser/Workbook.pm »