Enbld/HTML.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 3 totaltotal 92.3% 36 / 39 SCAR 16.1
CC
5
Cov
100%
parse_version
4.0
extract
2.0
BEGIN
1.0
CRAP 5.0
« Enbld/Archivefile.pm ↑ Summary Enbld/Target/AttributeExtension/Command.pm »
1 package Enbld::HTML;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 sub new {
7 37 ▶ my ( $class, $html ) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
8  
9 37 my $self = {
10 html => $html,
11 };
12  
13 37 return bless $self, $class;
14 }
15  
16 sub parse_version {
17 37 ▶ my ( $self, $parser, $version_form ) = @_;
Subroutine parse_version: called CC=4 SCAR=13.9
Pod undocumented
18  
19 37 my $filenames = $self->extract( $parser );
20  
21 37 my %list;
22  
23 37 foreach my $filename ( @{ $filenames } ) {
24 71 ▶ while ( $filename =~ /$version_form/g ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($filename =~ /$version_form/g) 71 71 142
25 71 $list{$&}++;
26 }
27 }
28  
29 37 ▶ return unless ( keys %list );
Branch: 1 branch
BranchTrueFalseTotal
unless keys %list 1 36 37
30  
31 36 my @versions = keys %list;
32  
33 36 return \@versions;
34 }
35  
36 sub extract {
37 37 ▶ my ( $self, $parser ) = @_;
Subroutine extract: called CC=2 SCAR=6.9
Pod undocumented
38  
39 37 my @candidate;
40 37 ▶ while( $self->{html} =~ /$parser/g ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"html"} =~ /$parser/g) 71 37 108
41 71 push @candidate, $&;
42 }
43  
44 37 return \@candidate;
45 }
46  
47 4 1;
« Enbld/Archivefile.pm ↑ Summary Enbld/Target/AttributeExtension/Command.pm »