Branch Coverage

blib/lib/Text/Todo.pm
Criterion Covered Total %
branch 70 110 63.6


line true false branch
42 2 3 if ($options)
43 0 2 if (ref $options eq 'HASH') { }
45 0 0 if (exists $path_of{$ident}{$opt}) { }
0 0 elsif ($opt eq 'tags' and ref $$options{$opt} eq 'HASH') { }
60 0 2 if (-d $options) { }
2 0 elsif ($options =~ /\.txt$/imsx) { }
75 2 3 if (defined $file and -e $file)
86 0 36 if ($type eq 'todo_dir')
87 0 0 if ($path)
93 14 22 if ($path)
98 0 14 if ($volume)
104 14 0 if ($directories)
109 36 0 if ($type =~ /(todo|done|report)_file/msx)
110 32 4 if (my($pre, $post) = $path_of{$ident}{$type} =~ /^(.*)$1(.*)\.txt$/imsx)
114 10 86 unless (defined $path_of{$ident}{$f . '_file'})
122 32 4 if (defined $path_of{$ident}{'todo_dir'})
134 11 18 if (defined $file and exists $path_of{$ident}{$file}) { }
152 6 0 if ($list_of{$ident} = $self->listfile($file))
166 0 7 unless (defined $file)
171 0 7 unless (-e $file)
177 0 7 unless open my $fh, '<', $file
182 0 7 unless close $fh
184 1 6 wantarray ? :
192 0 3 unless (defined $file)
196 0 3 unless open my $fh, '>', $file
198 0 17 unless print {$fh;} $e->text . "\n"
201 0 3 unless close $fh
212 0 48 unless $list_of{$ident}
213 41 7 wantarray ? :
220 1 0 if ($pri) { }
222 0 1 unless ($pri =~ /^[A-Z]$/msx)
225 2 4 if defined $_->priority
232 1 0 wantarray ? :
239 8 6 if (not ref $entry) { }
0 6 elsif (ref $entry ne 'Text::Todo::Entry') { }
310 3 0 wantarray ? :
332 0 222 unless (exists $tags{$t})
341 9 222 if (not exists $$kt{$t} or $tags{$t} ne $$kt{$t})
356 0 1 if (not defined $loaded_of{$ident} or $loaded_of{$ident} ne $self->file('todo_file'))
365 1 4 if ($e->done) { }
1 3 elsif ($e->text eq '') { }
366 1 0 if ($self->addto('done_file', $e) and $self->del($e)) { }
375 1 0 if ($self->del($e)) { }
385 1 0 if ($changed)
397 0 2 unless (defined $file)
401 1 1 if (ref $entry)
402 1 0 if (ref $entry eq 'Text::Todo::Entry') { }
411 0 2 unless open my $fh, '>>', $file
412 0 2 unless print {$fh;} $entry, "\n"
414 0 2 unless close $fh
416 1 1 if (defined $loaded_of{$ident} and $file eq $loaded_of{$ident})
427 4 1 if (ref $entry) { }
1 0 elsif ($entry =~ /^\d+$/msx) { }
428 0 4 if (ref $entry ne 'Text::Todo::Entry')
436 4 10 if ($list[$id] eq $entry)