MyConText/URL.pm

filter: Statementstmt 63.6% 14 / 22 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 59.3% 19 / 32 CC 3 SCAR 17.4
CC
3
Cov
54%
index_document
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.7
« MyConText/Column.pm ↑ Summary MyConText/File.pm »
1  
2 package MyConText::URL;
3 1 ▶use MyConText::String;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use vars qw! @ISA !;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 @ISA = qw! MyConText::String !;
7  
8 1 ▶use LWP::UserAgent;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶sub index_document {
Subroutine index_document: not called CC=3 SCAR=24.8
Pod documented
11 0 my ($self, $uri) = @_;
12 my $ua = ( defined $self->{'user_agent'}
13 ? $self->{'user_agent'}
14 0 ▶ : $self->{'user_agent'} = new LWP::UserAgent );
Branch: 1 branch
BranchTrueFalseTotal
defined $self->{'user_agent'} ? : 0 0 0
15  
16 0 my $request = new HTTP::Request('GET', $uri);
17 0 my $response = $ua->simple_request($request);
18 0 ▶ if ($response->is_success) {
Branch: 1 branch
BranchTrueFalseTotal
if ($response->is_success) { } 0 0 0
19 0 return $self->SUPER::index_document($uri, $response->content);
20 }
21 else {
22 0 $self->{'errstr'} = $response->message;
23 }
24 0 return;
25 }
26  
27 1 1;
28  
« MyConText/Column.pm ↑ Summary MyConText/File.pm »