Branch Coverage

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


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 ref $options eq "HASH"
651 0 0 if (defined $options->{'enforceSingleParent'})
664 0 0 unless defined $file and length $file
667 0 0 unless -r $file
671 0 0 unless $size <= 5242880
702 0 0 if (defined $options->{'enforceSingleParent'})
718 0 0 unless defined $file and length $file
721 0 0 unless -r $file
725 0 0 unless $size <= 5242880
737 0 0 unless open my $fh, "<", $file
743 0 0 unless close $fh
790 0 0 if (defined $options->{'enforceSingleParent'})
806 0 0 unless defined $file and length $file
809 0 0 unless -r $file
813 0 0 unless $size <= '5497558138880'
828 0 0 if (keys %{$options;} > 1)
876 0 0 if (defined $options->{'enforceSingleParent'})
885 0 0 unless $response->is_success
901 0 0 if (my $mimeType = delete $options->{'mediaType'})
906 0 0 if (keys %{$options;} > 1)
954 0 0 if (defined $options->{'enforceSingleParent'})
963 0 0 unless $response->is_success
975 0 0 unless defined $upload_uri and length $upload_uri
978 0 0 unless $upload_uri =~ m[^https://.*\bupload_id=.+]imsx
981 0 0 unless defined $file and length $file
984 0 0 unless -r $file
988 0 0 unless $size <= '5497558138880'
1010 0 0 unless defined $upload_uri and length $upload_uri
1013 0 0 unless $upload_uri =~ m[^https://.*upload_id=.+]msx
1016 0 0 unless defined $file and length $file
1019 0 0 unless -r $file
1023 0 0 unless $size <= '5497558138880'
1030 0 0 unless $chunk_size > 0
1033 0 0 unless $chunk_size % 262144 == 0
1044 0 0 if ($response->code == 200)
1048 0 0 if ($response->code != 308)
1061 0 0 unless defined $upload_uri and length $upload_uri
1064 0 0 unless $upload_uri =~ m[^https://.*upload_id=.+]msx
1067 0 0 unless defined $file and length $file
1070 0 0 unless -r $file
1074 0 0 unless $size <= '5497558138880'
1081 0 0 unless $chunk_size > 0
1084 0 0 unless $chunk_size % 262144 == 0
1092 0 0 if $size % $chunk_size
1097 0 0 if $chunks-- == 0
1103 0 0 unless open my $fh, "<", $file
1111 0 0 unless close $fh
1150 0 0 unless defined $fileId and length $fileId
1167 0 0 if (defined $options->{'enforceSingleParent'})
1179 0 0 unless defined $fileId and length $fileId
1182 0 0 unless ref $options eq "HASH"
1216 0 0 unless /^( files | shortcuts )$/msx
1236 0 0 unless defined $fileId and length $fileId
1295 0 0 unless /^( user | drive | domain | allDrives )$/msx
1298 0 0 if ($_ eq "drive")
1299 0 0 unless defined $options->{'driveId'}
1307 0 0 unless /^( domain | user )$/msx
1314 0 0 unless /^( drive | appDataFolder )$/msx
1335 0 0 unless defined $fileId and length $fileId
1338 0 0 unless ref $options eq "HASH"
1380 0 0 if (defined $options->{'enforceSingleParent'})
1393 0 0 unless defined $fileId and length $fileId
1396 0 0 unless ref $options eq "HASH"
1437 0 0 if (defined $options->{'enforceSingleParent'})
1449 0 0 unless defined $fileId and length $fileId
1452 0 0 unless ref $options eq "HASH"
1505 0 0 if (defined $options->{'enforceSingleParent'})
1519 0 0 unless defined $fileId and length $fileId
1522 0 0 unless ref $options eq "HASH"
1567 0 0 unless defined $fileId and length $fileId
1570 0 0 unless defined $permissionId and length $permissionId
1595 0 0 unless defined $fileId and length $fileId
1598 0 0 unless defined $permissionId and length $permissionId
1624 0 0 unless defined $fileId and length $fileId
1653 0 0 unless defined $fileId and length $fileId
1656 0 0 unless defined $permissionId and length $permissionId
1686 0 0 unless defined $fileId and length $fileId
1689 0 0 unless defined $commentId and length $commentId
1692 0 0 unless ref $options eq "HASH"
1709 0 0 unless /^( resolve | reopen )$/msx
1729 0 0 unless defined $fileId and length $fileId
1732 0 0 unless defined $commentId and length $commentId
1749 0 0 unless defined $fileId and length $fileId
1752 0 0 unless defined $commentId and length $commentId
1755 0 0 unless defined $replyId and length $replyId
1758 0 0 unless ref $options eq "HASH"
1780 0 0 unless defined $fileId and length $fileId
1783 0 0 unless defined $commentId and length $commentId
1786 0 0 unless ref $options eq "HASH"
1810 0 0 unless defined $fileId and length $fileId
1813 0 0 unless defined $commentId and length $commentId
1816 0 0 unless defined $replyId and length $replyId
1819 0 0 unless ref $options eq "HASH"
1846 0 0 unless defined $fileId and length $fileId
1863 0 0 unless defined $fileId and length $fileId
1866 0 0 unless defined $revisionId and length $revisionId
1890 0 0 unless defined $fileId and length $fileId
1915 0 0 unless defined $fileId and length $fileId
1918 0 0 unless defined $revisionId and length $revisionId
1921 0 0 unless ref $options eq "HASH"
1953 0 0 unless ref $options eq "HASH"
1979 0 0 unless defined $driveId and length $driveId
1996 0 0 unless defined $driveId and length $driveId
2019 0 0 unless defined $driveId and length $driveId
2059 0 0 unless defined $driveId and length $driveId
2076 0 0 unless defined $driveId and length $driveId
2079 0 0 unless ref $options eq "HASH"
2113 0 0 unless defined $path
2118 0 0 if $opts->{'maxResults'}
2123 0 0 unless defined $folder_id
2126 0 0 unless my $children = $self->children_by_folder_id($folder_id, $opts, $search_opts)
2136 0 0 unless $folder_id
2141 0 0 unless defined $opts
2142 0 0 unless defined $search_opts
2144 0 0 if exists $search_opts->{'page'}
2147 0 0 if exists $search_opts->{'title'}
2153 0 0 if (defined $opts->{'q'} and length $opts->{'q'}) { }
2162 0 0 if (my $name = $search_opts->{'name'})
2168 0 0 if ($opts->{'fields'})
2177 0 0 unless my $data = $self->files($opts)
2180 0 0 unless $data->{'files'}
2183 0 0 if ($item->{'trashed'})
2193 0 0 if ($search_opts->{'auto_paging'} and $data->{'nextPageToken'}) { }
2209 0 0 unless defined $search_opts
2223 0 0 if (defined $search_opts->{'q'} and length $search_opts->{'q'}) { }
2231 0 0 unless my $children = $self->children_by_folder_id($folder_id, {}, $search_opts)
2237 0 0 if ($child->name eq $part)
2253 0 0 if (@ids == 1)