Branch Coverage

blib/lib/Net/MitDK.pm
Criterion Covered Total %
branch 0 154 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
305 0 0 unless @files
311 0 0 unless defined $resp
315 0 0 unless @files
327 0 0 utf8::is_utf8($text) || $text =~ /[\x80-\xff]/ ? :
338 0 0 if ($received =~ /^(\d{4})-(\d{2})-(\d{2})T(\d\d):(\d\d):(\d\d)/) { }
377 0 0 unless $fn =~ /[^\x00-\x80]/
412 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'}) { }
423 0 0 $#_ ? :
427 0 0 $#_ ? :
435 0 0 unless -d $home
438 0 0 unless $profile =~ m[\/([^\/]+)\.profile]
449 0 0 if (-f $file)
450 0 0 if $opt{'ok_if_exists'}
460 0 0 if flock $f, 6
462 0 0 if flock $f, 6
472 0 0 unless -f $file
474 0 0 unless open my $f, "<", $file
475 0 0 unless Net::MitDK::ProfileManager::lock($f)
482 0 0 unless $json
493 0 0 if $self->readonly
496 0 0 unless (-d $home)
497 0 0 unless mkdir $home
498 0 0 unless chmod 0750, $home
499 0 0 unless ($^O =~ /win32/i)
501 0 0 unless defined $name
502 0 0 unless chown $>, $gid, $home
509 0 0 if $@
513 0 0 if (-f $file) { }
514 0 0 unless open $f, "+<", $file
515 0 0 unless Net::MitDK::ProfileManager::lock($f)
517 0 0 unless truncate $f, 0
519 0 0 unless open $f, ">", $file
521 0 0 unless print $f $json
522 0 0 unless close $f
524 0 0 unless ($^O =~ /win32/i)
525 0 0 unless chmod 0640, $file
527 0 0 unless defined $name
528 0 0 unless chown $>, $gid, $file
539 0 0 unless unlink $self->homepath . "/$profile.profile"
546 0 0 unless exists $self->{'timestamps'}{$profile}
550 0 0 unless defined $mtime