| 1 | package URI::Fetch::Response; | ||||||||||||||||||||||||||||
| 2 | 1 | $URI::Fetch::Response::VERSION = '0.15'; | |||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 7 | 0 | my $class = shift; | |||||||||||||||||||||||||||
| 8 | 0 | my $feed = bless { }, $class; | |||||||||||||||||||||||||||
| 9 | 0 | $feed; | |||||||||||||||||||||||||||
| 10 | } | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 0 | ▶ | sub _var { | ||||||||||||||||||||||||||
|
Subroutine
_var: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 13 | 0 | my $feed = shift; | |||||||||||||||||||||||||||
| 14 | 0 | my $var = shift; | |||||||||||||||||||||||||||
| 15 | 0 | ▶ | $feed->{$var} = shift if @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 16 | 0 | $feed->{$var}; | |||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 0 | ▶ | sub status { shift->_var('status', @_) } | ||||||||||||||||||||||||||
|
Subroutine
status: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 20 | 0 | ▶ | sub http_status { shift->_var('http_status', @_) } | ||||||||||||||||||||||||||
|
Subroutine
http_status: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub http_response { shift->_var('http_response', @_) } | ||||||||||||||||||||||||||
|
Subroutine
http_response: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | sub etag { shift->_var('etag', @_) } | ||||||||||||||||||||||||||
|
Subroutine
etag: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub last_modified { shift->_var('last_modified', @_) } | ||||||||||||||||||||||||||
|
Subroutine
last_modified: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 24 | 0 | ▶ | sub uri { shift->_var('uri', @_) } | ||||||||||||||||||||||||||
|
Subroutine
uri: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 25 | 0 | ▶ | sub content { shift->_var('content', @_) } | ||||||||||||||||||||||||||
|
Subroutine
content: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub content_type { shift->_var('content_type', @_) } | ||||||||||||||||||||||||||
|
Subroutine
content_type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | ▶ | sub is_success { | ||||||||||||||||||||||||||
|
Subroutine
is_success: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 29 | 0 | my $response = shift; | |||||||||||||||||||||||||||
| 30 | 0 | ▶ | if ($response->http_response) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | 0 | ▶ | return 1 if $response->http_response->code == 304 | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$response->http_response->code == 304 and defined $response->content
MC/DC0%0/2
$response->http_response->code == 304 and defined $response->content
$response->http_response->code == 304
defined $response->content
Truth table0%0/3
A and B
A= $response->http_response->code == 304B= defined $response->content
| |||||||||||||||||||||||||||||
| 32 | && defined($response->content); | ||||||||||||||||||||||||||||
| 33 | 0 | return $response->http_response->is_success; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | 0 | return 1; | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 0 | ▶ | sub is_redirect { | ||||||||||||||||||||||||||
|
Subroutine
is_redirect: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 39 | 0 | my $response = shift; | |||||||||||||||||||||||||||
| 40 | 0 | ▶ | return $response->http_response->is_redirect if $response->http_response; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 41 | 0 | return; | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 0 | ▶ | sub is_error { | ||||||||||||||||||||||||||
|
Subroutine
is_error: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 45 | 0 | my $response = shift; | |||||||||||||||||||||||||||
| 46 | 0 | ▶ | return $response->http_response->is_error if $response->http_response; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 47 | 0 | return; | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 1 | 1; | |||||||||||||||||||||||||||
| 51 | __END__ | ||||||||||||||||||||||||||||