DocumentsList/Metadata.pm

filter: Statementstmt 64.2% 27 / 42 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 62.5% 5 / 8 Podpod n/a totaltotal 58.1% 32 / 55 CC 4 SCAR 16.1
CC
4
Cov
59%
__ANON__
12.0
__ANON__
6.0
__ANON__
2.0
CRAP 5.0
« DocumentsList.pm ↑ Summary DocumentsList/ACL.pm »
1 package Net::Google::DocumentsList::Metadata;
2 14 ▶use Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 14 ▶use Net::Google::DataAPI;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 14 with 'Net::Google::DataAPI::Role::Entry';
5 14 ▶use XML::Atom::Util qw(nodelist first);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 14 ▶use String::CamelCase ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 14 has 'kind' => (is => 'ro', isa => 'Str', default => 'metadata');
9 14 entry_has 'updated' => ( tagname => 'updated', is => 'ro' );
10 entry_has largest_changestamp => (
11 is => 'ro',
12 isa => 'Int',
13 0 ▶ from_atom => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
14 0 my ($self, $atom) = @_;
15 0 ▶ my $elem = first($atom->elem, $self->ns('docs')->{uri}, 'largestChangestamp') or return;
Branch: 1 branch
BranchTrueFalseTotal
my $elem = first($atom->elem, $self->ns("docs")->{"uri"}, "largestChangestamp") or return 0 0 0
16 0 $elem->getAttribute('value');
17 }
18 14 );
19 14 entry_has quota_bytes_total => (is => 'ro', isa => 'Int', tagname => 'quotaBytesTotal', ns => 'gd');
20 14 entry_has quota_bytes_used => (is => 'ro', isa => 'Int', tagname => 'quotaBytesUsed', ns => 'gd');
21 14 entry_has quota_bytes_used_in_trash => (is => 'ro', isa => 'Int', tagname => 'quotaBytesUsed', ns => 'gd');
22 entry_has max_upload_size => (is => 'ro', isa => 'HashRef',
23 0 ▶ from_atom => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
24 0 my ($self, $atom) = @_;
25 +{
26 0 map { $_->getAttribute('kind') => $_->textContent }
27 0 nodelist($atom->elem, $self->ns('docs')->{uri}, 'maxUploadSize')
28 }
29 },
30 14 );
31 14 for my $tag (qw(importFormat exportFormat)) {
32 entry_has String::CamelCase::decamelize($tag) => (is => 'ro', isa => 'HashRef',
33 0 ▶ from_atom => sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
34 0 my ($self, $atom) = @_;
35 0 my $res = {};
36 0 for my $node (nodelist($atom->elem, $self->ns('docs')->{uri}, $tag)) {
37 0 my $source = $node->getAttribute('source');
38 0 my $target = $node->getAttribute('target');
39 0 ▶ $res->{$source} ||= [];
Condition0%0/2
$res->{$source} ||= []
l!l
00
MC/DC0%0/1
$res->{$source} ||= []
$res->{$source}
Truth table0%0/2
A
A= $res->{$source}
Aresult
11
00
40 0 push @{$res->{$source}}, $target;
41 }
42 0 return $res;
43 }
44 28 );
45 }
46  
47 14 __PACKAGE__->meta->make_immutable;
48  
49 14 ▶no Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
50  
51 14 1;
52 __END__
« DocumentsList.pm ↑ Summary DocumentsList/ACL.pm »