Proxy/BodyFilter/htmlparser.pm

filter: Statementstmt 96.3% 26 / 27 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 100% 3 / 3 totaltotal 93.0% 40 / 43 CC 4 SCAR 6.4
CC
4
Cov
94%
filter
3.0
init
2.0
will_modify
2.0
CRAP 1.9
« Proxy/Engine/Threaded.pm ↑ Summary Proxy/BodyFilter/tags.pm »
1 package HTTP::Proxy::BodyFilter::htmlparser;
2 2 $HTTP::Proxy::BodyFilter::htmlparser::VERSION = '0.304';
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use HTTP::Proxy::BodyFilter;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use vars qw( @ISA );
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 @ISA = qw( HTTP::Proxy::BodyFilter );
8  
9 3 ▶sub init {
Subroutine init: called CC=2 SCAR=6.9
Pod documented
10 3 ▶ croak "First parameter must be a HTML::Parser object"
Branch: 1 branch
BranchTrueFalseTotal
unless $_[1]->isa("HTML::Parser") 1 2 3
11 unless $_[1]->isa('HTML::Parser');
12  
13 2 my $self = shift;
14 2 $self->{_parser} = shift;
15  
16 2 my %args = (@_);
17 2 $self->{rw} = delete $args{rw};
18 }
19  
20 2 ▶sub filter {
Subroutine filter: called CC=3 SCAR=11.0
Pod documented
21 2 my ( $self, $dataref, $message, $protocol, $buffer ) = @_;
22  
23 2 @{ $self->{_parser} }{qw( output message protocol )} =
24 ( "", $message, $protocol );
25  
26 2 $self->{_parser}->parse($$dataref);
27 2 ▶ $self->{_parser}->eof if not defined $buffer; # last chunk
Branch: 1 branch
BranchTrueFalseTotal
unless defined $buffer 2 0 2
28 2 ▶ $$dataref = $self->{_parser}{output} if $self->{rw};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"rw"} 1 1 2
29 }
30  
31 0 ▶sub will_modify { $_[0]->{rw} }
Subroutine will_modify: not called CC=1 SCAR=6.9
Pod documented
32  
33 2 1;
34  
35 __END__
« Proxy/Engine/Threaded.pm ↑ Summary Proxy/BodyFilter/tags.pm »