Branch Coverage

blib/lib/Net/SharePoint/Basic.pm
Criterion Covered Total %
branch 52 114 45.6


line true false branch
188 2 2 if $ENV{'NET_SHAREPOINT_VERBOSE'} or $ENV{'NET_SHAREPOINT_DEBUG'}
202 1 9 if $ENV{'NET_SHAREPOINT_DEBUG'}
216 1 0 if $ENV{'NET_SHAREPOINT_DEBUG'}
230 0 1 unless shift()
247 1 1 unless open my $mail_fh, '<', $file
271 1 0 unless -d $dir
272 0 1 $binary ? :
0 1 unless open my $fh, $binary ? '>:raw' : '>:encoding(utf8)', $file
273 0 1 if $binary
293 0 5 unless open my $conf_fh, '<', $config_file
295 2 38 if /^\#/
296 2 36 unless /\S/
300 2 34 unless ($value)
307 0 6 if $extra_value =~ /^\#/
308 0 6 unless $extra_value =~ /\S/
335 4 4 if ($opts->{'config_file'}) { }
339 0 4 if -f $DEFAULT_SHAREPOINT_CONFIG_FILE
344 4 5 if $key eq 'config_file'
345 0 5 unless defined $opts->{$key}
395 0 2 unless $opts
397 3 3 if (not $opts->{$id}) { }
0 3 elsif (not $opts->{$id} =~ /^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/) { }
406 1 1 unless $opts->{'sharepoint_client_secret'} and $opts->{'sharepoint_client_secret'} =~ /^(\S){43}\=/
409 1 1 unless $opts->{'sharepoint_access_url'} and $opts->{'sharepoint_access_url'} =~ m[^https://]
411 1 1 unless $opts->{'sharepoint_host'}
414 1 1 unless $opts->{'sharepoint_site'} and $opts->{'sharepoint_site'} =~ m[^sites/.+]
417 0 0 unless $opts->{$extra_opt}
441 1 2 if @{$self->{'log'};} > $self->{'config'}{'max_log_size'}
488 0 0 unless ($token_response->is_success)
518 0 0 if (-f $token_file) { }
522 0 0 if time > $self->{'token'}{'ts'} - 1200 and not $self->update_token
526 0 0 unless $self->update_token
554 1 38 unless $opts and $opts->{'pattern'} || $opts->{'type'}
556 0 38 if $folder eq '/'
560 38 0 unless ($pattern)
561 1 37 unless ($PATTERNS{$opts->{'type'}})
565 21 16 if (ref $PATTERNS{$opts->{'type'}}) { }
566 1 20 unless ($opts->{'subtype'} and $PATTERNS{$opts->{'type'}}{$opts->{'subtype'}})
578 0 36 if $self->{'config'}{'base_subfolder'}
620 0 0 $opts->{'action'} eq 'download' || $opts->{'action'} eq 'list' ? :
623 0 0 unless ($self->init_token)
630 0 0 if ($response->is_success)
691 0 0 ref $item ? :
698 0 0 ref $item ? :
703 0 0 $chunk_n ? :
720 0 0 unless $r
749 0 0 if (not $object and $opts->{'type'} ne 'file')
754 0 0 if ($opts->{'type'} eq 'file')
755 0 0 unless (-f $item)
766 0 0 ref $item ? :
0 0 if (length(ref $item ? $$item : $item) > $self->{'config'}{'chunk_size'}) { }
778 0 0 unless $r
818 0 0 if $target
832 0 0 unless defined $response
833 0 0 unless $opts->{'save_file'}
834 0 0 if -d $opts->{'save_file'}
872 0 0 unless defined $list_response