Zoom/ReadFH.pm

filter: Statementstmt 77.7% 14 / 18 Branchbran 66.6% 4 / 6 Conditioncond 66.6% 4 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 4 totaltotal 58.1% 25 / 43 SCAR 19.0
CC
6
Cov
73%
to_zoom
6.0
getline
5.0
close
2.0
CRAP 6.7
« Zoom/Producer/BuiltIn.pm ↑ Summary Zoom/Transform.pm »
1 package HTML::Zoom::ReadFH;
2  
3 15 ▶use strictures 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 sub from_zoom {
6 2 ▶ my ($class, $zoom) = @_;
Subroutine from_zoom: called CC=1 SCAR=0.0
Pod undocumented
7 2 bless({ _zoom => $zoom }, $class)
8 }
9  
10 sub to_zoom {
11 0 ▶ my $self = shift;
Subroutine to_zoom: not called CC=2 SCAR=17.9
Pod undocumented
12 # A small defense against accidental footshots. I hope.
13 # If this turns out to merely re-aim the gun at your left nipple, please
14 # come complain with a documented use case and we'll discuss deleting it.
15 die "Already started reading - there ain't no going back now"
16 0 ▶ if $self->{_stream};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"_stream"} 0 0 0
17 $self->{_zoom}
18 0 }
19  
20 sub getline {
21 5 ▶ my $self = shift;
Subroutine getline: called CC=5 SCAR=16.2
Pod undocumented
22 5 my $html;
23 5 ▶ my $stream = $self->{_stream} ||= $self->{_zoom}->to_stream;
Condition66%2/3
$self->{"_stream"} ||= $self->{"_zoom"}->to_stream
l!l&&r!l&&!r
320
MC/DC0%0/2
$self->{"_stream"} ||= $self->{"_zoom"}->to_stream
$self->{"_stream"} $self->{"_zoom"}->to_stream
Truth table66%2/3
A ||= B
A= $self->{"_stream"}B= $self->{"_zoom"}->to_stream
ABresult
1X1
011
000
24 5 ▶ my $producer = $self->{_producer} ||= $self->{_zoom}->zconfig->producer;
Condition66%2/3
$self->{"_producer"} ||= $self->{"_zoom"}->zconfig->producer
l!l&&r!l&&!r
320
MC/DC0%0/2
$self->{"_producer"} ||= $self->{"_zoom"}->zconfig->producer
$self->{"_producer"} $self->{"_zoom"}->zconfig->producer
Truth table66%2/3
A ||= B
A= $self->{"_producer"}B= $self->{"_zoom"}->zconfig->producer
ABresult
1X1
011
000
25 5 ▶ while (my ($evt) = $stream->next) {
Branch: 1 branch
BranchTrueFalseTotal
if (my($evt) = $stream->next) 32 4 36
26 32 $html .= $producer->event_to_html($evt);
27 32 ▶ last if $evt->{flush};
Branch: 1 branch
BranchTrueFalseTotal
if $evt->{"flush"} 1 31 32
28 }
29 5 return $html
30 }
31  
32 0 ▶sub close { "The door shuts behind you with a ominous boom" }
Subroutine close: not called CC=1 SCAR=6.9
Pod undocumented
33  
34 15 1;
« Zoom/Producer/BuiltIn.pm ↑ Summary Zoom/Transform.pm »