blib/lib/Text/CSV/Unicode.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 8 / 8 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 7 / 7 Podpod 100% 3 / 3 totaltotal 100% 50 / 50 SCAR 20.8
CC
8
Cov
100%
new
4.0
combine
3.0
parse
3.0
CRAP 8.0
« Build ↑ Summary
1 package Text::CSV::Unicode;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use base qw(Text::CSV);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 our $VERSION = '0.399_001';
9  
10 sub new {
11 5 ▶ my ($self, $hash) = @_;
Subroutine new: called CC=4 SCAR=13.9
Pod documented
12 5 ▶ if ( $hash and $hash -> {binary} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($hash and $hash->{"binary"}) 2 3 5
Condition100%3/3
$hash and $hash->{"binary"}
!ll&&!rl&&r
122
MC/DC100%2/2
$hash and $hash->{"binary"}
$hash $hash->{"binary"}
Truth table100%3/3
A and B
A= $hashB= $hash->{"binary"}
ABresult
0X0
100
111
13 2 warnings::warnif("deprecated",
14 "binary is deprecated: use Text::CSV");
15 2 return Text::CSV->new( $hash );
16 }
17 3 ▶ return $self->SUPER::new( { binary => 1, %{ $hash || {} } } );
Branch: 1 branch
BranchTrueFalseTotal
$hash or {} 1 2 3
18 }
19  
20 sub combine {
21 11 ▶ my $self = shift;
Subroutine combine: called CC=3 SCAR=11.0
Pod documented
22 11 ▶ for (grep defined, @_) { return unless _ok(); }
Branch: 1 branch
BranchTrueFalseTotal
unless _ok() 1 19 20
23 10 return $self->SUPER::combine(@_);
24 }
25  
26 sub parse {
27 8 ▶ my $self = shift;
Subroutine parse: called CC=3 SCAR=11.0
Pod documented
28 8 for (map +$_, grep defined, @_) {
29 7 chomp;
30 7 ▶ return unless _ok();
Branch: 1 branch
BranchTrueFalseTotal
unless _ok() 1 6 7
31 }
32 7 return $self->SUPER::parse( @_ );
33 }
34  
35 27 ▶sub _ok { m{\A [\t \P{Cntrl}]* \z}x; } # test $_
Subroutine _ok: called CC=1 SCAR=0.0
36  
37 3 1;
38  
39  
40 __END__
« Build ↑ Summary