lib/Pod/Tree/Stream.pm

filter: Statementstmt 100% 26 / 26 Branchbran 100% 10 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 95.3% 41 / 43 CC 6 SCAR 13.9
CC
6
Cov
100%
get_paragraph
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.0
« lib/Pod/Tree/HTML.pm ↑ Summary lib/Pod/Tree/Node.pm »
1 package Pod::Tree::Stream;
2 34 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 34 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 34 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 34 our $VERSION = '1.31';
7  
8 187 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
9 187 my ( $package, $fh ) = @_;
10  
11 187 my $stream = {
12 fh => $fh,
13 line => ''
14 };
15  
16 187 bless $stream, $package;
17 }
18  
19 3222 ▶sub get_paragraph {
Subroutine get_paragraph: called CC=6 SCAR=17.9
Pod undocumented
20 3222 my $stream = shift;
21 3222 my $fh = $stream->{fh};
22 3222 my $line = $stream->{line};
23  
24 3222 ▶ defined $line or return undef; ##no critic (ProhibitExplicitReturnUndef)
Branch: 1 branch
BranchTrueFalseTotal
defined $line or return undef 3036 186 3222
25  
26 3036 my (@lines) = ($line);
27 3036 ▶ while ( $line = $fh->getline ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($line = $fh->getline) 3753 114 3867
28 3753 push @lines, $line;
29 3753 ▶ $line =~ /\S/ or last;
Branch: 1 branch
BranchTrueFalseTotal
$line =~ /\S/ or last 831 2922 3753
30 }
31  
32 3036 ▶ while ( $line = $fh->getline ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($line = $fh->getline) 3140 187 3327
33 3140 ▶ $line =~ /\S/ and last;
Branch: 1 branch
BranchTrueFalseTotal
$line =~ /\S/ and last 2849 291 3140
34 291 push @lines, $line;
35 }
36  
37 3036 $stream->{line} = $line;
38 3036 join '', @lines;
39 }
40  
41 34 1;
42  
« lib/Pod/Tree/HTML.pm ↑ Summary lib/Pod/Tree/Node.pm »