Syntax/Highlight/CSS.pm

filter: Statementstmt 62.5% 20 / 32 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 6 / 9 Podpod 100% 1 / 1 totaltotal 47.3% 27 / 57 CC 7 SCAR 32.9
CC
7
Cov
44%
_process_request
56.0
_methods_define
2.0
parse
2.0
CRAP 26.8
« WWW/Cache/Google.pm ↑ Summary Syntax/Highlight/HTML.pm »
1 package POE::Component::Syntax::Highlight::CSS;
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::CSS;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use LWP::UserAgent;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 0 ▶sub _methods_define {
Subroutine _methods_define: not called CC=1 SCAR=6.9
14 0 return ( parse => '_wheel_entry' );
15 }
16  
17 0 ▶sub parse {
Subroutine parse: not called CC=1 SCAR=6.9
Pod documented
18 0 $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 my $obj = Syntax::Highlight::CSS->new(
24 ( defined $in_ref->{nnn} ? ( nnn => $in_ref->{nnn} ) : () ),
25 0 ▶ ( defined $in_ref->{pre} ? ( pre => $in_ref->{pre} ) : () ),
Branch: 2 branches
BranchTrueFalseTotal
defined $in_ref->{'nnn'} ? : 0 0 0
defined $in_ref->{'pre'} ? : 0 0 0
26 );
27  
28 0 ▶ if ( $in_ref->{uri} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($in_ref->{'uri'}) { } 0 0 0
29 $in_ref->{uri} =~ m{^(?:ht|f)tps?://}
30 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
31  
32 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
33 0 my $response = $ua->get( $in_ref->{uri} );
34  
35 0 ▶ if ( $response->is_success ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($response->is_success) { } 0 0 0
36 0 $in_ref->{out} = $obj->parse( $response->content );
37 }
38 else {
39 0 $in_ref->{error} = $response->status_line;
40 }
41 }
42 else {
43 0 $in_ref->{out} = $obj->parse( $in_ref->{in} );
44 }
45 }
46  
47 2 1;
48 __END__
« WWW/Cache/Google.pm ↑ Summary Syntax/Highlight/HTML.pm »