Branch Coverage

blib/lib/MCE/Core/Validation.pm
Criterion Covered Total %
branch 85 150 56.6


line true false branch
40 18 422 if (defined $_s->{'input_data'} and ref $_s->{'input_data'} eq "")
42 0 18 unless -e $_s->{'input_data'}
47 0 0 if $_s->{$_k} and !&looks_like_number($_s->{$_k}) || $_s->{$_k} < 0
51 0 2640 if $_s->{$_k} and ref $_s->{$_k} ne "CODE"
56 267 173 if (defined $_s->{'user_tasks'})
79 856 0 if (defined $_s->{'max_workers'})
83 0 856 unless $_s->{'max_workers'} =~ /\A\d+\z/
86 440 416 if (defined $_s->{'chunk_size'})
87 0 440 if ($_s->{'chunk_size'} =~ /([0-9\.]+)K\z/i) { }
0 440 elsif ($_s->{'chunk_size'} =~ /([0-9\.]+)M\z/i) { }
95 0 440 if not $_s->{'chunk_size'} =~ /\A[0-9e\+]+\z/ or $_s->{'chunk_size'} == 0
101 0 856 if $_s->{'RS'} and ref $_s->{'RS'} ne ""
103 0 856 if $_s->{'max_retries'} and not $_s->{'max_retries'} =~ /\A\d+\z/
107 0 4280 if $_s->{$_k} and ref $_s->{$_k} ne "CODE"
110 287 569 if (defined $_s->{'gather'})
113 0 162 if $_ref ne "MCE::Queue" and $_ref ne "Thread::Queue" and $_ref ne "ARRAY" and $_ref ne "HASH" and $_ref ne "CODE"
118 18 838 if (defined $_s->{'sequence'})
121 18 0 if (ref $_seq eq 'ARRAY') { }
128 0 0 if ref $_seq ne "HASH"
134 0 36 unless defined $_seq->{$_k}
139 0 54 if defined $_seq->{$_p} and not &looks_like_number($_seq->{$_p})
142 18 0 unless (defined $_seq->{'step'})
143 18 0 $_seq->{'begin'} <= $_seq->{'end'} ? :
144 18 0 if (ref $_s->{'sequence'} eq "ARRAY")
149 0 18 if (ref $_s->{'sequence'} eq 'HASH') { }
152 0 0 unless $_s->{'sequence'}{$_k} =~ /\./
158 54 0 unless $_s->{'sequence'}[$_i] =~ /\./
162 0 18 if ($_seq->{'step'} < 0 and $_seq->{'begin'} < $_seq->{'end'} or $_seq->{'step'} > 0 and $_seq->{'begin'} > $_seq->{'end'} or $_seq->{'step'} == 0)
170 0 856 if (defined $_s->{'interval'})
171 0 0 if (ref $_s->{'interval'} eq "")
177 0 0 if ref $_i ne "HASH"
180 0 0 unless defined $_i->{'delay'}
182 0 0 if not &looks_like_number($_i->{'delay'}) or $_i->{'delay'} < 0
189 0 0 if defined $_i->{$_p} and !&looks_like_number($_i->{$_p}) || int $_i->{$_p} != $_i->{$_p} || $_i->{$_p} < 1
193 0 0 unless exists $_i->{'max_nodes'}
194 0 0 unless exists $_i->{'node_id'}
214 0 173 if $self->{'_wid'}
216 0 173 if $self->{'_send_cnt'}
218 0 173 if $self->{'_total_running'}
235 0 187 unless defined $_chunk_size and defined $_max_workers
237 0 187 if (defined $_params and exists $_params->{'chunk_size'})
241 0 187 if ($_chunk_size =~ /([0-9\.]+)K\z/i) { }
0 187 elsif ($_chunk_size =~ /([0-9\.]+)M\z/i) { }
248 187 0 if ($_chunk_size eq "auto")
250 0 187 if (defined $_params and ref $_params->{'input_data'} =~ /^(?:CODE|Iterator::)/ or defined $_input_data and ref $_input_data =~ /^(?:CODE|Iterator::)/)
273 24 163 if (defined $_input_data)
274 18 6 if (ref $_input_data eq 'ARRAY') { }
6 0 elsif (ref $_input_data eq 'HASH') { }
281 18 169 if (defined $_params and exists $_params->{'sequence'}) { }
36 133 elsif (defined $_params and exists $_params->{'_file'}) { }
24 109 elsif (defined $_input_data) { }
284 0 18 if (ref $_params->{'sequence'} eq 'HASH') { }
295 18 0 unless (defined $_input_data or $_array_size)
302 0 36 if ($_ref eq 'SCALAR') { }
18 18 elsif ($_ref eq '') { }
313 0 24 if (ref($_input_data) =~ /^(?:GLOB|FileHandle|IO::)/) { }
0 24 elsif (ref $_input_data eq 'SCALAR') { }
321 36 151 if (defined $_is_file) { }
322 18 18 if ($_size)
324 0 18 if $_chunk_size > 5242880
325 18 0 if ($_chunk_size <= 8192)
326 12 6 (caller()) =~ /^MCE::(?:Grep|Map|Stream)/ ? :
332 0 151 if $_chunk_size > 8000
333 151 0 if ($_chunk_size < 2)
334 49 102 (caller()) =~ /^MCE::(?:Grep|Map|Stream)/ ? :
348 0 1139 unless defined $_max_workers
350 135 1004 if ($_max_workers =~ m[^auto(?:$|\s*([\-\+/\*])\s*(.+)$)]i) { }
54 950 elsif ($_max_workers =~ /^([0-9.]+)%$/) { }
354 135 0 if $_ncpu_ul > 8
356 48 87 if (defined $1 and defined $2) { }
358 12 36 if not $_max_workers or $_max_workers < 1
359 0 48 if $_max_workers > $_ncpu
370 12 42 if $_max_workers < 1
380 0 81 unless defined $_n
384 0 81 if (not &looks_like_number($_n) or int $_n != $_n or $_n < 1)