Syntax/Highlight/HTML.pm

filter: Statementstmt 68.7% 22 / 32 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 88.8% 8 / 9 Podpod 100% 1 / 1 totaltotal 54.3% 31 / 57 CC 7 SCAR 32.8
CC
7
Cov
49%
_process_request
56.0
BEGIN
1.0
BEGIN
1.0
CRAP 26.7
« Syntax/Highlight/CSS.pm ↑ Summary App/PNGCrush.pm »
1 package POE::Component::Syntax::Highlight::HTML;
2  
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '2.001002'; # VERSION
7  
8 2 ▶use POE;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use base 'POE::Component::NonBlockingWrapper::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Syntax::Highlight::HTML;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use LWP::UserAgent;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶sub _methods_define {
Subroutine _methods_define: called CC=1 SCAR=0.0
14 1 return ( parse => '_wheel_entry' );
15 }
16  
17 1 ▶sub parse {
Subroutine parse: called CC=1 SCAR=0.0
Pod documented
18 1 $poe_kernel->post( shift->{session_id} => parse => @_ );
19 }
20  
21 0 ▶sub _process_request {
Subroutine _process_request: not called CC=7 SCAR=40.3
22 0 my ( $self, $in_ref ) = @_;
23  
24 my $p = Syntax::Highlight::HTML->new(
25 ( defined $in_ref->{pre} ? ( pre => $in_ref->{pre} ) : () ),
26 0 ▶ ( defined $in_ref->{nnn} ? ( nnn => $in_ref->{nnn} ) : () ),
Branch: 2 branches
BranchTrueFalseTotal
defined $in_ref->{'pre'} ? : 0 0 0
defined $in_ref->{'nnn'} ? : 0 0 0
27 );
28  
29 0 ▶ if ( $in_ref->{uri} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($in_ref->{'uri'}) { } 0 0 0
30 $in_ref->{uri} =~ m{^(?:ht|f)tps?://}
31 0 ▶ or $in_ref->{uri} = "http://$in_ref->{uri}";
Branch: 1 branch
BranchTrueFalseTotal
$in_ref->{"uri"} =~ m[^(?:ht|f)tps?://] or $in_ref->{"uri"} = qq[http://$in_ref->{"uri"}] 0 0 0
32  
33 0 ▶ my $ua = $self->{ua} || LWP::UserAgent->new( timeout => 30, agent => 'Opera 9.5' );
Condition0%0/3
$self->{'ua'} || 'LWP::UserAgent'->new('timeout', 30, 'agent', 'Opera 9.5')
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{'ua'} || 'LWP::UserAgent'->new('timeout', 30, 'agent', 'Opera 9.5')
$self->{'ua'} 'LWP::UserAgent'->new('timeout', 30, 'agent', 'Opera 9.5')
Truth table0%0/3
A || B
A= $self->{'ua'}B= 'LWP::UserAgent'->new('timeout', 30, 'agent', 'Opera 9.5')
ABresult
1X1
011
000
34 0 my $response = $ua->get( $in_ref->{uri} );
35  
36 0 ▶ if ( $response->is_success ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($response->is_success) { } 0 0 0
37 0 $in_ref->{out} = $p->parse( $response->content );
38 }
39 else {
40 0 $in_ref->{error} = $response->status_line;
41 }
42 }
43 else {
44 0 $in_ref->{out} = $p->parse( $in_ref->{in} );
45 }
46  
47 }
48  
49 2 1;
50 __END__
« Syntax/Highlight/CSS.pm ↑ Summary App/PNGCrush.pm »