Atompub.pm

filter: Statementstmt 82.8% 53 / 64 Branchbran 75.0% 15 / 20 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 63.1% 12 / 19 Podpod n/a totaltotal 77.6% 80 / 103 CC 1 SCAR 2.1
CC
1
Cov
81%
__ANON__
2.0
__ANON__
2.0
__ANON__
2.0
CRAP 1.2
« Atompub/MediaType.pm ↑ Summary
1 package Atompub;
2  
3 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 10 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 10 ▶use version 0.74; our $VERSION = qv('0.3.7');
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 10 ▶use HTTP::Headers;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 10 ▶use HTTP::Request;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 10 ▶use HTTP::Response;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 10 ▶use XML::Atom;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 10 ▶use XML::Atom::Service 0.15.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 10 our %REQUEST_HEADERS = (
16 accept => 'Accept',
17 if_match => 'If-Match',
18 if_none_match => 'If-None-Match',
19 if_modified_since => 'If-Modified-Since',
20 if_unmodified_since => 'If-Unmodified-Since',
21 );
22  
23 10 our %RESPONSE_HEADERS = (
24 content_location => 'Content-Location',
25 etag => 'ETag',
26 location => 'Location',
27 );
28  
29 10 our %ENTITY_HEADERS = (
30 last_modified => 'Last-Modified',
31 slug => 'Slug',
32 );
33  
34 10 ▶while (my($method, $header) = each %REQUEST_HEADERS) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %Atompub::REQUEST_HEADERS) 50 10 60
35 10 ▶ no strict 'refs'; ## no critic
Subroutine BEGIN: called CC=1 SCAR=0.0
36 0 ▶ *{"HTTP::Headers::$method"} = sub { shift->header($header, @_) }
Subroutine __ANON__: not called CC=1 SCAR=1.2
37 50 ▶ unless HTTP::Headers->can($method);
Branch: 1 branch
BranchTrueFalseTotal
unless "HTTP::Headers"->can($method) 30 20 50
38 0 ▶ *{"HTTP::Request::$method"} = sub { shift->header($header, @_)}
Subroutine __ANON__: not called CC=1 SCAR=6.9
39 50 ▶ unless (HTTP::Request->can($method));
Branch: 1 branch
BranchTrueFalseTotal
unless "HTTP::Request"->can($method) 0 50 50
40 }
41  
42 10 ▶while (my($method, $header) = each %RESPONSE_HEADERS) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %Atompub::RESPONSE_HEADERS) 30 10 40
43 10 ▶ no strict 'refs'; ## no critic
Subroutine BEGIN: called CC=1 SCAR=0.0
44 0 ▶ *{"HTTP::Headers::$method"} = sub { shift->header($header, @_) }
Subroutine __ANON__: not called CC=1 SCAR=1.2
45 30 ▶ unless HTTP::Headers->can($method);
Branch: 1 branch
BranchTrueFalseTotal
unless "HTTP::Headers"->can($method) 30 0 30
46 0 ▶ *{"HTTP::Response::$method"} = sub { shift->header($header, @_) }
Subroutine __ANON__: not called CC=1 SCAR=6.9
47 30 ▶ unless HTTP::Response->can($method);
Branch: 1 branch
BranchTrueFalseTotal
unless "HTTP::Response"->can($method) 0 30 30
48 }
49  
50 10 ▶while (my($method, $header) = each %ENTITY_HEADERS) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %Atompub::ENTITY_HEADERS) 20 10 30
51 10 ▶ no strict 'refs'; ## no critic
Subroutine BEGIN: called CC=1 SCAR=0.0
52 0 ▶ *{"HTTP::Headers::$method"} = sub { shift->header($header, @_) }
Subroutine __ANON__: not called CC=1 SCAR=1.2
53 20 ▶ unless HTTP::Headers->can($method);
Branch: 1 branch
BranchTrueFalseTotal
unless "HTTP::Headers"->can($method) 10 10 20
54 0 ▶ *{"HTTP::Request::$method"} = sub { shift->header($header, @_) }
Subroutine __ANON__: not called CC=1 SCAR=6.9
55 20 ▶ unless HTTP::Request->can($method);
Branch: 1 branch
BranchTrueFalseTotal
unless "HTTP::Request"->can($method) 0 20 20
56 0 ▶ *{"HTTP::Response::$method"} = sub { shift->header($header, @_) }
Subroutine __ANON__: not called CC=1 SCAR=6.9
57 20 ▶ unless HTTP::Response->can($method);
Branch: 1 branch
BranchTrueFalseTotal
unless "HTTP::Response"->can($method) 0 20 20
58 }
59  
60 10 1; # Magic true value required at end of module
61 __END__
« Atompub/MediaType.pm ↑ Summary