Branch Coverage

blib/lib/MogileFS/Client.pm
Criterion Covered Total %
branch 1 118 0.8


line true false branch
93 0 0 unless ref $self
108 0 0 unless $self
121 0 0 $args{'readonly'} ? :
124 0 0 unless $$self{'domain'} = $args{'domain'}
129 0 0 if ($$self{'backend'}) { }
136 0 0 unless $$self{'backend'}
215 0 0 $_[0] ? :
0 0 if @_
268 0 0 if $$self{'readonly'}
282 0 0 unless my $res = $$self{'backend'}->do_request('create_open', {%$create_open_args, 'domain', $$self{'domain'}, 'class', $class, 'key', $key, 'fid', $$opts{'fid'} || 0, 'multi_dest', 1})
295 0 0 if (not exists $$res{'dev_count'}) { }
307 0 0 unless ($main_path =~ m[^http://])
313 0 0 $$opts{'largefile'} ? :
373 0 0 if $$self{'readonly'}
377 0 0 unless my $res = $$self{'backend'}->do_request('edit_file', {'domain', $$self{'domain'}, 'key', $key})
387 0 0 unless ($resp->is_success)
424 0 0 unless $path
462 0 0 if $$self{'readonly'}
468 0 0 unless my $fh = $self->new_file($key, $class, undef, $opts)
470 0 0 if (ref $file) { }
473 0 0 unless open $fh_from, $file
483 0 0 unless ref $file
484 0 0 unless $fh->close
501 0 0 if $$self{'readonly'}
507 0 0 unless my $fh = $self->new_file($key, $class, undef, $opts)
508 0 0 ref $content eq 'SCALAR' ? :
513 0 0 unless $fh->close
567 0 0 unless (ref $opts)
572 0 0 if $$opts{'noverify'}
575 0 0 if (my $pathcount = delete $$opts{'pathcount'})
581 0 0 $noverify ? :
0 0 unless my $res = $$self{'backend'}->do_request('get_paths', {'domain', $$self{'domain'}, 'key', $key, 'noverify', $noverify ? 1 : 0, 'zone', $zone, %extra_args})
617 0 0 unless @paths
621 0 0 unless defined $path
622 0 0 if ($path =~ m[^http://]) { }
628 0 0 if ($res->is_success)
635 0 0 unless open FILE, "<$path"
639 0 0 if $contents
658 0 0 if $$self{'readonly'}
669 0 0 unless defined $rv or $$self{'backend'}{'lasterr'} eq 'unknown_key'
688 0 0 if $$self{'readonly'}
700 0 0 unless defined $rv or $$self{'backend'}{'lasterr'} eq 'unknown_key'
724 0 0 unless exists $opts{'domain'}
726 0 0 unless my $res = $$self{'backend'}->do_request('file_debug', {%opts})
752 0 0 if keys %$opts
754 0 0 unless my $res = $$self{'backend'}->do_request('file_info', {'domain', $$self{'domain'}, 'key', $key, %extra})
787 0 0 unless my $res = $$self{'backend'}->do_request('list_keys', {'domain', $$self{'domain'}, 'prefix', $prefix, 'after', $after, 'limit', $limit})
801 0 0 wantarray ? :
820 0 0 unless ref $callback eq 'CODE'
823 0 0 if %opts
830 0 0 unless my $res = $$self{'backend'}->do_request('list_keys', {'domain', $$self{'domain'}, 'prefix', $prefix, 'after', $last, 'limit', $max})
852 0 0 unless $$self{'backend'}->do_request('sleep', {'duration', $duration + 0})
870 0 0 unless my $res = $$self{'backend'}->do_request('updateclass', {'domain', $$self{'domain'}, 'key', $key, 'class', $class})
894 0 0 if $$self{'backend'}
914 0 0 if $method eq 'DESTROY'
951 0 0 if (@_) { }
963 0 0 unless $hook
967 0 0 if $@
993 1 0 unless $MogileFS::DEBUG