Branch Coverage

blib/lib/PICA/Writer.pm
Criterion Covered Total %
branch 43 134 32.0


line true false branch
36 4 2 @_ ? :
42 6 0 @_ % 2 ? :
47 2 4 if (not defined $output) { }
0 4 elsif (ref $output eq 'GLOB') { }
0 4 elsif (UNIVERSAL::isa('IO::Handle', $output)) { }
1 3 elsif (ref $output eq 'SCALAR') { }
59 0 3 if not defined $format and $output =~ /\.xml$/
62 0 6 if ($options{'pretty'})
69 6 0 unless defined $format and $format =~ /^(plain|normalized|xml)$/i
72 0 6 if ($format =~ /^xml$/i and defined $output) { }
74 0 0 unless defined $options{'header'}
80 0 6 if (defined $output and not $$self{'io'})
84 0 6 if ($$self{'options'}{'stats'}) { }
86 0 0 if $$self{'options'}{'stats'} > 1
98 6 1 if @_
109 0 9 if $self->status == 3
110 6 3 if $self->status != 2
114 0 9 if (UNIVERSAL::isa($_[0], 'PICA::Field')) { }
117 0 0 if (UNIVERSAL::isa($field, 'PICA::Field')) { }
118 0 0 if ($format eq 'plain') { }
0 0 elsif ($format eq 'normalized') { }
0 0 elsif ($format eq 'xml' and defined $$self{'xmlwriter'}) { }
119 0 0 if $$self{'io'}
121 0 0 if $$self{'io'}
134 10 0 if (UNIVERSAL::isa($record, 'PICA::Record')) { }
0 0 elsif (ref \$record eq 'SCALAR') { }
135 10 0 if ($format eq 'plain') { }
0 0 elsif ($format eq 'normalized') { }
0 0 elsif ($format eq 'xml' and defined $$self{'xmlwriter'}) { }
136 1 9 if $$self{'recordcounter'} > 0 and $$self{'io'}
138 5 5 if $$self{'io'}
140 0 0 if $$self{'recordcounter'} > 0 and $$self{'io'}
142 0 0 if $$self{'io'}
148 0 0 unless $record
151 0 0 if ($format eq 'xml') { }
152 0 0 if defined $$self{'xmlwriter'}
155 0 0 if $$self{'io'}
169 0 6 if $self->status == 2
170 0 6 if $self->status == 0
173 0 6 if ($$self{'options'}{'format'} eq 'xml' and defined $writer)
174 0 0 if (UNIVERSAL::isa($writer, 'XML::Writer::Namespaces')) { }
190 0 4 if $self->status == 0
191 0 4 if $self->status == 3
192 0 4 if $self->status != 2
194 0 4 if ($$self{'options'}{'format'} eq 'xml') { }
195 0 0 if (defined $$self{'xmlwriter'})
203 4 0 if defined $$self{'io'}
241 0 0 length $tag < 5 ? :
243 0 0 if (defined $subfieldstat)
248 0 0 if defined $$s{$_}{'val'}
264 4 2 unless defined $params{'NAMESPACES'}
265 4 2 unless (defined $params{'PREFIX_MAP'} and defined $params{'PREFIX_MAP'}{$PICA::Record::XMLNAMESPACE})
270 1 5 if $params{'header'}
271 0 6 if ($params{'xslt'})
283 0 0 unless defined $$self{'subfieldstat'}
294 0 0 if (exists $v{$sf}) { }
295 0 0 unless defined $v{$sf} and $v{$sf} eq $value
305 0 0 if ($$sfstat{$tag}) { }
308 0 0 if ($o{$sf}) { }
310 0 0 if $o{$sf} > 1 and $$cur{'occ'} < 2
313 0 0 unless defined $v{$sf} and defined $$cur{'val'} and $v{$sf} eq $$cur{'val'}
318 0 0 $$cur{'occ'} > 1 ? :
340 10 0 unless (defined $$self{'fieldstat'})
357 0 0 if ($count{$tag}) { }
358 0 0 if ($count{$tag} > 1 and $$fieldstat{$tag} < 2)
363 0 0 $$fieldstat{$tag} > 1 ? :
369 0 0 $count{$tag} > 1 ? :