Branch Coverage

blib/lib/Net/MitDK.pm
Criterion Covered Total %
branch 0 160 0.0


line true false branch
29 0 0 if defined $opt{'homepath'}
31 0 0 if (defined $self->{'profile'})
33 0 0 unless $config
45 0 0 if ($self->mgr->refresh_needed($self->profile))
47 0 0 unless $config
60 0 0 unless $#_
62 0 0 if $profile eq $self->{'profile'}
65 0 0 unless $config
79 0 0 unless $ok
82 0 0 if ($method eq 'get') { }
102 0 0 unless ref $response
105 0 0 unless ($response->is_success)
106 0 0 if ($response->header('content-type') eq 'application/json') { }
108 0 0 if $@
109 0 0 if grep {not exists $json->{$_};} "code", "message"
112 0 0 if $json->{'fieldError'} and ref $_->{'fieldError'} eq "ARRAY"
120 0 0 if $options->{'raw'}
122 0 0 unless $response->header("Content-Type") eq "application/json"
126 0 0 unless $json
129 0 0 if ($json->{'errorMessages'} and ref $json->{'errorMessages'} eq "ARRAY")
133 0 0 if $_->{'fieldError'} and ref $_->{'fieldError'} eq "ARRAY"
136 0 0 if length $error
175 0 0 unless $json
176 0 0 unless exists $json->{'dpp'} and exists $json->{'ngdp'}
188 0 0 if $self->{'session'}{'mailboxes'}
193 0 0 unless $json
196 0 0 unless $json
206 0 0 if $self->{'session'}{'folders'}
210 0 0 unless $_[0]
217 0 0 unless $json
222 0 0 unless keys %folders
234 0 0 unless $_[0]
265 0 0 unless $json
268 0 0 if @{$json->{'results'};} < $limit
307 0 0 unless @files
313 0 0 if (defined $resp) { }
314 0 0 if ($error_policy eq 'strict') { }
0 0 elsif ($error_policy eq 'warning') { }
326 0 0 unless (@files)
328 0 0 if @ret
342 0 0 utf8::is_utf8($text) || $text =~ /[\x80-\xff]/ ? :
353 0 0 if ($received =~ /^(\d{4})-(\d{2})-(\d{2})T(\d\d):(\d\d):(\d\d)/) { }
392 0 0 unless $fn =~ /[^\x00-\x80]/
427 0 0 if (exists $ENV{'HOME'}) { }
0 0 elsif ($^O =~ /win/i and exists $ENV{'USERPROFILE'}) { }
0 0 elsif ($^O =~ /win/i and exists $ENV{'WINDIR'}) { }
438 0 0 $#_ ? :
442 0 0 $#_ ? :
450 0 0 unless -d $home
453 0 0 unless $profile =~ m[\/([^\/]+)\.profile]
464 0 0 if (-f $file)
465 0 0 if $opt{'ok_if_exists'}
475 0 0 if flock $f, 6
477 0 0 if flock $f, 6
487 0 0 unless -f $file
489 0 0 unless open my $f, "<", $file
490 0 0 unless Net::MitDK::ProfileManager::lock($f)
497 0 0 unless $json
508 0 0 if $self->readonly
511 0 0 unless (-d $home)
512 0 0 unless mkdir $home
513 0 0 unless chmod 0750, $home
514 0 0 unless ($^O =~ /win32/i)
516 0 0 unless defined $name
517 0 0 unless chown $>, $gid, $home
524 0 0 if $@
528 0 0 if (-f $file) { }
529 0 0 unless open $f, "+<", $file
530 0 0 unless Net::MitDK::ProfileManager::lock($f)
532 0 0 unless truncate $f, 0
534 0 0 unless open $f, ">", $file
536 0 0 unless print $f $json
537 0 0 unless close $f
539 0 0 unless ($^O =~ /win32/i)
540 0 0 unless chmod 0640, $file
542 0 0 unless defined $name
543 0 0 unless chown $>, $gid, $file
554 0 0 unless unlink $self->homepath . "/$profile.profile"
561 0 0 unless exists $self->{'timestamps'}{$profile}
565 0 0 unless defined $mtime