Branch Coverage

blib/lib/Word/Rhymes.pm
Criterion Covered Total %
branch 86 100 86.0


line true false branch
57 1 27 unless (defined $word)
61 1 26 if (defined $context and not $context =~ /^\w+$/)
67 0 26 unless ($self->file)
72 26 0 if ($self->file or $response->is_success) { }
76 26 0 if ($self->file) { }
79 0 26 unless open my $fh, '<', $self->file
92 2 24 if $self->return_raw
104 17 105 if (defined $file)
105 2 15 unless -e $file
106 2 13 unless -f $file
115 1006 101 if (defined $limit)
116 2 1004 unless $limit =~ /^\d+$/
117 4 1000 if ($limit < 1 or $limit > 1000)
134 1006 3 if (defined $max)
135 2 1004 unless $max =~ /^\d+$/
136 4 1000 if ($max < 1 or $max > 1000)
153 1615 8644 if (defined $min)
154 2 1613 unless $min =~ /^-?\d+$/
155 4 1609 if ($min < 0 or $min > 1000000)
172 110 9509 if (defined $min)
173 2 108 unless $min =~ /^-?\d+$/
174 4 104 if ($min < 1 or $min > 100)
191 3 26 if (defined $bool)
202 0 0 defined $context ? :
212 0 0 $column_width > 15 ? :
217 0 0 if $_ % $columns == 0 and $_ != 0
228 2 26 if (defined $ret)
237 7 287 if (defined $sort_by)
238 1 6 unless (grep /^$sort_by$/, ('score_desc', 'score_asc', 'alpha_desc', 'alpha_asc'))
242 4 2 if ($sort_by =~ /^alpha/) { }
2 0 elsif ($sort_by =~ /^score/) { }
243 2 2 $sort_by =~ /desc/ ? :
248 0 2 $sort_by =~ /desc/ ? :
263 15 26 if exists $args->{'file'}
266 3 36 if exists $args->{'limit'}
269 3 33 if exists $args->{'max_results'}
272 3 30 if exists $args->{'min_score'}
275 3 27 if exists $args->{'min_syllables'}
278 2 25 if exists $args->{'multi_word'}
281 1 26 if exists $args->{'return_raw'}
284 3 24 if exists $args->{'sort_by'}
292 1 23 if ($self->multi_word) { }
296 16077 2392 if $_->{'score'}
306 6497 2146 if $_->{'score'} >= $self->min_score
310 10 90 if ($self->sort_by == 2) { }
10 80 elsif ($self->sort_by == 3) { }
70 10 elsif ($self->sort_by == 0) { }
10 0 elsif ($self->sort_by == 1) { }
327 100 0 if scalar @{$organized{$_};} <= $self->limit
339 1 1 if (defined $context) { }