Branch Coverage

blib/lib/Acme/Wabby.pm
Criterion Covered Total %
branch 55 116 47.4


line true false branch
31 1 2 if (@_ == 1) { }
0 2 elsif (@_ % 2 != 0) { }
33 0 1 if (not ref $ref) { }
1 0 elsif (ref $ref eq 'HASH') { }
57 1 2 unless (exists $conf{'case_sensitive'})
60 1 2 unless (exists $conf{'min_len'})
63 1 2 unless (exists $conf{'max_len'})
66 1 2 unless (exists $conf{'max_attempts'})
69 1 2 unless (exists $conf{'punctuation'})
72 1 2 unless (exists $conf{'hash_file'})
75 1 2 unless (exists $conf{'list_file'})
78 1 2 unless (exists $conf{'autosave_on_destroy'})
83 0 3 if ($conf{'min_len'} > $conf{'max_len'})
87 0 3 if ($conf{'min_len'} < 1)
90 0 3 if ($conf{'max_len'} < 1)
93 0 3 if ($conf{'max_attempts'} < 1)
96 0 3 if (ref $conf{'punctuation'} ne 'ARRAY')
99 0 3 if (scalar @{$conf{'punctuation'};} < 1)
102 0 3 if ($conf{'list_file'} eq $conf{'hash_file'})
116 0 3 unless ref $self eq 'Acme::Wabby'
118 0 3 if ($$self{'conf'}{'autosave_on_destroy'})
128 0 0 unless ref $self eq 'Acme::Wabby'
133 0 0 unless (store($$self{'data'}{'list'}, $$self{'conf'}{'list_file'}))
137 0 0 if ($@)
142 0 0 unless (store($$self{'data'}{'hash'}, $$self{'conf'}{'hash_file'}))
146 0 0 if ($@)
158 0 0 unless ref $self eq 'Acme::Wabby'
164 0 0 unless ($ref = retrieve($$self{'conf'}{'list_file'}))
168 0 0 if ($@)
174 0 0 unless ($ref = retrieve($$self{'conf'}{'hash_file'}))
178 0 0 if ($@)
193 0 3 unless ref $self eq 'Acme::Wabby'
197 0 3 unless ($text)
202 0 3 unless ($$self{'conf'}{'case_sensitive'})
221 3 3 if $phrase eq ''
247 0 3 if (length $word == 1 and lc $word ne 'i' and lc $word ne 'a')
254 318 0 if ($word ne '')
268 0 318 if ($word eq '')
274 174 144 if (not exists $$self{'data'}{'hash'}{$word}) { }
289 0 174 if ($idx == $last_word)
305 0 144 if ($idx == $last_word)
335 0 6 unless ref $self eq 'Acme::Wabby'
340 0 6 if (scalar keys %{$$self{'data'}{'hash'};} < $$self{'conf'}{'min_len'} * 10)
349 3 3 if ($text) { }
353 0 3 unless ($$self{'conf'}{'case_sensitive'})
368 0 3 unless ($text =~ /([-a-zA-Z0-9']+)$/)
373 0 3 unless (exists ${$$self{'data'}{'hash'};}{$1})
416 2 152 if (scalar @{${$$self{'data'}{'list'};}[$next]{'num'};} < 1) { }
427 152 2 if ($next != -1)
434 0 6 if ($count < $$self{'conf'}{'min_len'})
437 0 0 if ($attempts < $$self{'conf'}{'max_attempts'}) { }
448 0 0 if ($directed) { }
469 0 6 unless ($$self{'conf'}{'case_sensitive'})
488 0 0 unless ref $self eq 'Acme::Wabby'
494 0 0 if ($word_count == 0)
495 0 0 wantarray ? :
501 0 0 if defined $$_{'num'}
507 0 0 wantarray ? :