ACL/XMLHelper.pm

filter: Statementstmt 100% 25 / 25 Branchbran n/a Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 89.1% 33 / 37 CC 2 SCAR 2.6
CC
2
Cov
93%
xpc
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« ACL/Grant/Email.pm ↑ Summary
1 package Net::Amazon::S3::ACL::XMLHelper;
2  
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use XML::LibXML;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use XML::LibXML::XPathContext;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 ▶use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 our @ISA = qw( Exporter );
11 4 our @EXPORT_OK = qw( xpc );
12  
13 4 our $Parser;
14  
15 # Copied and adapted from Net::Amazon::S3
16 3 ▶sub xpc {
Subroutine xpc: called CC=2 SCAR=7.1
Pod documented
17 3 my ($content) = @_;
18  
19 3 ▶ my $parser = $Parser || XML::LibXML->new();
Condition33%1/3
$Net::Amazon::S3::ACL::XMLHelper::Parser || 'XML::LibXML'->new
l!l&&r!l&&!r
030
MC/DC0%0/2
$Net::Amazon::S3::ACL::XMLHelper::Parser || 'XML::LibXML'->new
$Net::Amazon::S3::ACL::XMLHelper::Parser 'XML::LibXML'->new
Truth table33%1/3
A || B
A= $Net::Amazon::S3::ACL::XMLHelper::ParserB= 'XML::LibXML'->new
ABresult
1X1
011
000
20 3 my $doc = $parser->parse_string($content);
21 3 my $xpc = XML::LibXML::XPathContext->new($doc);
22 3 $xpc->registerNs('s3', 'http://s3.amazonaws.com/doc/2006-03-01/');
23  
24 3 return $xpc;
25 } ## end sub xpc
26  
27 4 1; # Magic true value required at end of module
28 __END__
« ACL/Grant/Email.pm ↑ Summary