Branch Coverage

blib/lib/Net/Google/Drive/Simple/V3.pm
Criterion Covered Total %
branch 49 354 13.8


line true false branch
74 4 1 if defined $_
75 7 1 if defined $_
76 3 1 if defined $_
77 5 1 if defined $_
79 2 1 if defined $_
83 1 34 unless (exists $param_data->{$param_name})
93 2 34 unless (exists $param_values->{$param_name})
94 1 1 if $is_required
101 1 33 unless ($validation_cb)
106 20 13 unless my $success = &$validation_cb()
118 2 19 if (my $perm_for_view = $options->{'includePermissionsForView'})
119 1 1 unless $perm_for_view eq "published"
124 8 12 if (defined $page_size)
125 4 4 unless $page_size >= 1 and $page_size <= 1000
129 6 10 if (my $upload_type = $options->{'uploadType'})
130 3 3 unless $upload_type =~ /^( media | multipart | resumable )$/msx
141 1 6 $path =~ /^http/msx ? :
143 4 3 if $options and %{$options;}
158 13 13 if ($alt)
173 6 0 exists $options->{$_} ? :
176 3 3 if keys %{$body_options;} == 0
198 1 4 if (my $param_check = $info->{'parameter_checks'})
200 1 2 unless defined $options->{$name}
204 0 2 unless ref $cb eq "CODE"
209 1 1 if $error_str
226 0 4 if ($info->{'return_http_request'})
240 0 0 unless ref $options eq "HASH"
286 0 0 unless ref $options eq "HASH"
309 0 0 unless /^( drive | appDataFolder | photos )$/msx
368 0 0 unless ref $options eq "HASH"
389 0 0 unless /^web_?hook$/msx
413 0 0 unless defined $fileId and length $fileId
416 0 0 unless ref $options eq "HASH"
445 0 0 unless defined $fileId and length $fileId
448 0 0 unless defined $commentId and length $commentId
465 0 0 unless defined $fileId and length $fileId
468 0 0 unless defined $commentId and length $commentId
471 0 0 unless ref $options eq "HASH"
493 0 0 unless defined $fileId and length $fileId
496 0 0 unless ref $options eq "HASH"
521 0 0 unless defined $fileId and length $fileId
524 0 0 unless defined $commentId and length $commentId
527 0 0 unless ref $options eq "HASH"
556 0 0 unless defined $fileId and length $fileId
559 0 0 unless ref $options eq "HASH"
608 0 0 unless defined $name and length $name
611 0 0 unless defined $parent_id and length $parent_id
629 0 0 unless ref $options eq "HASH"
672 0 0 if (defined $options->{'enforceSingleParent'})
685 0 0 unless defined $file and length $file
688 0 0 unless -r $file
692 0 0 unless $size <= 5242880
723 0 0 if (defined $options->{'enforceSingleParent'})
739 0 0 unless defined $file and length $file
742 0 0 unless -r $file
746 0 0 unless $size <= 5242880
758 0 0 unless open my $fh, "<", $file
764 0 0 unless close $fh
811 0 0 if (defined $options->{'enforceSingleParent'})
827 0 0 unless defined $file and length $file
830 0 0 unless -r $file
834 0 0 unless $size <= '5497558138880'
849 0 0 if (keys %{$options;} > 1)
897 0 0 if (defined $options->{'enforceSingleParent'})
906 0 0 unless $response->is_success
922 0 0 if (my $mimeType = delete $options->{'mediaType'})
927 0 0 if (keys %{$options;} > 1)
975 0 0 if (defined $options->{'enforceSingleParent'})
984 0 0 unless $response->is_success
996 0 0 unless defined $upload_uri and length $upload_uri
999 0 0 unless $upload_uri =~ m[^https://.*\bupload_id=.+]imsx
1002 0 0 unless defined $file and length $file
1005 0 0 unless -r $file
1009 0 0 unless $size <= '5497558138880'
1031 0 0 unless defined $upload_uri and length $upload_uri
1034 0 0 unless $upload_uri =~ m[^https://.*upload_id=.+]msx
1037 0 0 unless defined $file and length $file
1040 0 0 unless -r $file
1044 0 0 unless $size <= '5497558138880'
1051 0 0 unless $chunk_size > 0
1054 0 0 unless $chunk_size % 262144 == 0
1065 0 0 if ($response->code == 200)
1069 0 0 if ($response->code != 308)
1082 0 0 unless defined $upload_uri and length $upload_uri
1085 0 0 unless $upload_uri =~ m[^https://.*upload_id=.+]msx
1088 0 0 unless defined $file and length $file
1091 0 0 unless -r $file
1095 0 0 unless $size <= '5497558138880'
1102 0 0 unless $chunk_size > 0
1105 0 0 unless $chunk_size % 262144 == 0
1113 0 0 if $size % $chunk_size
1118 0 0 if $chunks-- == 0
1124 0 0 unless open my $fh, "<", $file
1132 0 0 unless close $fh
1171 0 0 unless defined $fileId and length $fileId
1188 0 0 if (defined $options->{'enforceSingleParent'})
1200 0 0 unless defined $fileId and length $fileId
1203 0 0 unless ref $options eq "HASH"
1237 0 0 unless /^( files | shortcuts )$/msx
1257 0 0 unless defined $fileId and length $fileId
1274 0 0 unless $_ eq "media"
1286 0 0 if ($options->{'alt'} eq "media")
1331 0 0 unless /^( user | drive | domain | allDrives )$/msx
1334 0 0 if ($_ eq "drive")
1335 0 0 unless defined $options->{'driveId'}
1343 0 0 unless /^( domain | user )$/msx
1350 0 0 unless /^( drive | appDataFolder )$/msx
1371 0 0 unless defined $fileId and length $fileId
1374 0 0 unless ref $options eq "HASH"
1416 0 0 if (defined $options->{'enforceSingleParent'})
1429 0 0 unless defined $fileId and length $fileId
1432 0 0 unless ref $options eq "HASH"
1473 0 0 if (defined $options->{'enforceSingleParent'})
1485 0 0 unless defined $fileId and length $fileId
1488 0 0 unless ref $options eq "HASH"
1541 0 0 if (defined $options->{'enforceSingleParent'})
1555 0 0 unless defined $fileId and length $fileId
1558 0 0 unless ref $options eq "HASH"
1603 0 0 unless defined $fileId and length $fileId
1606 0 0 unless defined $permissionId and length $permissionId
1631 0 0 unless defined $fileId and length $fileId
1634 0 0 unless defined $permissionId and length $permissionId
1660 0 0 unless defined $fileId and length $fileId
1689 0 0 unless defined $fileId and length $fileId
1692 0 0 unless defined $permissionId and length $permissionId
1722 0 0 unless defined $fileId and length $fileId
1725 0 0 unless defined $commentId and length $commentId
1728 0 0 unless ref $options eq "HASH"
1745 0 0 unless /^( resolve | reopen )$/msx
1765 0 0 unless defined $fileId and length $fileId
1768 0 0 unless defined $commentId and length $commentId
1785 0 0 unless defined $fileId and length $fileId
1788 0 0 unless defined $commentId and length $commentId
1791 0 0 unless defined $replyId and length $replyId
1794 0 0 unless ref $options eq "HASH"
1816 0 0 unless defined $fileId and length $fileId
1819 0 0 unless defined $commentId and length $commentId
1822 0 0 unless ref $options eq "HASH"
1846 0 0 unless defined $fileId and length $fileId
1849 0 0 unless defined $commentId and length $commentId
1852 0 0 unless defined $replyId and length $replyId
1855 0 0 unless ref $options eq "HASH"
1882 0 0 unless defined $fileId and length $fileId
1899 0 0 unless defined $fileId and length $fileId
1902 0 0 unless defined $revisionId and length $revisionId
1926 0 0 unless defined $fileId and length $fileId
1951 0 0 unless defined $fileId and length $fileId
1954 0 0 unless defined $revisionId and length $revisionId
1957 0 0 unless ref $options eq "HASH"
1989 0 0 unless ref $options eq "HASH"
2015 0 0 unless defined $driveId and length $driveId
2032 0 0 unless defined $driveId and length $driveId
2055 0 0 unless defined $driveId and length $driveId
2095 0 0 unless defined $driveId and length $driveId
2112 0 0 unless defined $driveId and length $driveId
2115 0 0 unless ref $options eq "HASH"
2149 0 0 unless defined $path
2154 0 0 if $opts->{'maxResults'}
2159 0 0 unless defined $folder_id
2162 0 0 unless my $children = $self->children_by_folder_id($folder_id, $opts, $search_opts)
2172 0 0 unless $folder_id
2177 0 0 unless defined $opts
2178 0 0 unless defined $search_opts
2180 0 0 if exists $search_opts->{'page'}
2183 0 0 if exists $search_opts->{'title'}
2189 0 0 if (defined $opts->{'q'} and length $opts->{'q'}) { }
2198 0 0 if (my $name = $search_opts->{'name'})
2204 0 0 if ($opts->{'fields'})
2213 0 0 unless my $data = $self->files($opts)
2216 0 0 unless $data->{'files'}
2219 0 0 if ($item->{'trashed'})
2229 0 0 if ($search_opts->{'auto_paging'} and $data->{'nextPageToken'}) { }
2245 0 0 unless defined $opts
2246 0 0 unless defined $search_opts
2264 0 0 unless my $children = $self->children_by_folder_id($folder_id, {}, {%{$search_opts;}, "name", $name})
2270 0 0 if ($child->name eq $part)
2286 0 0 if (@ids == 1)