blib/lib/Text/APL.pm

filter: Statementstmt 82.1% 23 / 28 Branchbran 66.6% 4 / 6 Conditioncond 40.0% 2 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 73.4% 36 / 49 SCAR 18.9
CC
6
Cov
74%
_build_reader
5.3
new
4.2
BEGIN
1.0
CRAP 6.6
« blib/lib/Text/APL/Translator.pm ↑ Summary blib/lib/Text/APL/WithCaching.pm »
1 package Text::APL;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = 0.08;
7  
8 2 ▶use Text::APL::Core;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Text::APL::WithCaching;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub new {
12 20 ▶ my $class = shift;
Subroutine new: called CC=4 SCAR=14.2
Pod documented
13 20 my (%options) = @_;
14  
15 20 ▶ $options{charset} ||= 'UTF-8';
Condition50%1/2
$options{"charset"} ||= "UTF-8"
l!l
020
MC/DC0%0/1
$options{"charset"} ||= "UTF-8"
$options{"charset"}
Truth table50%1/2
A
A= $options{"charset"}
Aresult
11
00
16  
17 20 ▶ $options{reader} ||= $class->_build_reader(charset => $options{charset});
Condition33%1/3
$options{"reader"} ||= $class->_build_reader("charset", $options{"charset"})
l!l&&r!l&&!r
0200
MC/DC0%0/2
$options{"reader"} ||= $class->_build_reader("charset", $options{"charset"})
$options{"reader"} $class->_build_reader("charset", $options{"charset"})
Truth table33%1/3
A ||= B
A= $options{"reader"}B= $class->_build_reader("charset", $options{"charset"})
ABresult
1X1
011
000
18  
19 20 ▶ if (delete $options{cache}) {
Branch: 1 branch
BranchTrueFalseTotal
if (delete $options{"cache"}) 1 19 20
20 1 return Text::APL::WithCaching->new(%options);
21 }
22  
23 19 return Text::APL::Core->new(%options);
24 }
25  
26 sub _build_reader {
27 20 ▶ my $self = shift;
Subroutine _build_reader: called CC=3 SCAR=16.7
28  
29 exists $INC{"AnyEvent.pm"}
30 ? do {
31 0 require AnyEvent::AIO;
32 0 require Text::APL::Reader::AIO;
33 0 ▶ Text::APL::Reader::AIO->new(@_);
Branch: 1 branch
BranchTrueFalseTotal
exists $INC{'IO/AIO.pm'} ? : 0 20 20
34 }
35 : exists $INC{"IO/AIO.pm"}
36 20 ▶ ? do { require Text::APL::Reader::AIO; Text::APL::Reader->AIO->new(@_) }
Branch: 1 branch
BranchTrueFalseTotal
exists $INC{'AnyEvent.pm'} ? : 0 20 20
37 : Text::APL::Reader->new(@_);
38 }
39  
40 2 1;
41 __END__
« blib/lib/Text/APL/Translator.pm ↑ Summary blib/lib/Text/APL/WithCaching.pm »