Branch Coverage

blib/lib/FusionInventory/Agent/Task/Collect.pm
Criterion Covered Total %
branch 36 134 26.8


line true false branch
63 0 0 unless ($self->{'target'}->isa('FusionInventory::Agent::Target::Server'))
74 5 45 if (ref $spec eq 'HASH')
75 1 4 unless (exists $base->{$key})
81 0 28 unless $self->_validateSpec($base->{$key}, $attribute, $spec->{$attribute})
86 22 23 if ($spec == _MANDATORY())
87 5 17 unless (exists $base->{$key})
95 0 23 if ($spec == _OPTIONAL() and exists $base->{$key})
105 0 14 unless (defined $answer)
110 1 13 if (ref $answer ne 'HASH')
115 2 11 if (not defined $answer->{'jobs'} or ref $answer->{'jobs'} ne 'ARRAY')
123 2 17 unless (defined $job->{$_})
130 1 7 unless (exists $functions{$function})
135 0 7 unless (exists $json_validation{$function})
141 0 14 unless ($self->_validateSpec($job, $attribute, $json_validation{$function}{$attribute}))
174 1 18 unless $globalRemoteConfig->{'schedule'}
175 0 18 unless ref $globalRemoteConfig->{'schedule'} eq 'ARRAY'
179 1 16 unless ref $job eq 'HASH' and exists $job->{'task'} and $job->{'task'} eq 'Collect'
189 1 15 unless ($remoteUrl)
201 1 14 if (ref $answer eq 'HASH' and not keys %$answer)
206 0 2 unless $self->_validateAnswer($answer)
208 1 1 unless my(@jobs) = @{$answer->{'jobs'};}
211 0 1 exists $answer->{'postmethod'} && $answer->{'postmethod'} eq 'POST' ? :
212 0 1 exists $answer->{'token'} ? :
219 1 0 unless ($job->{'uuid'})
226 0 0 unless ($job->{'function'})
231 0 0 unless (defined $functions{$job->{'function'}})
241 0 0 unless $count
244 0 0 unless ref $result eq 'HASH'
245 0 0 unless not $count or keys %$result
249 0 0 if $token
252 0 0 if exists $job->{'_sid'}
259 0 0 exists $answer->{'token'} ? :
277 0 0 unless $answer
288 0 0 if (defined $type and $type == 3 || $type >= 8) { }
300 0 0 unless 'FusionInventory::Agent::Tools::Win32'->require
309 0 0 unless $values
312 0 0 if (ref $values eq 'HASH') { }
315 0 0 if $k =~ m[/$]
334 0 0 unless -d $params{'dir'}
341 0 0 if (not $params{'recursive'} and $File::Find::name ne $params{'dir'})
346 0 0 if ($params{'filter'}{'is_dir'} and not $params{'filter'}{'checkSumSHA512'} and not $params{'filter'}{'checkSumSHA2'})
350 0 0 unless -d $File::Find::name
353 0 0 if ($params{'filter'}{'is_file'})
354 0 0 unless -f $File::Find::name
359 0 0 if ($params{'filter'}{'name'})
360 0 0 if $filename ne $params{'filter'}{'name'}
363 0 0 if ($params{'filter'}{'iname'})
364 0 0 if lc $filename ne lc $params{'filter'}{'iname'}
367 0 0 if ($params{'filter'}{'regex'})
369 0 0 unless $File::Find::name =~ /$re/
374 0 0 if ($params{'filter'}{'sizeEquals'})
375 0 0 unless $size == $params{'filter'}{'sizeEquals'}
378 0 0 if ($params{'filter'}{'sizeGreater'})
379 0 0 if $size < $params{'filter'}{'sizeGreater'}
382 0 0 if ($params{'filter'}{'sizeLower'})
383 0 0 if $size > $params{'filter'}{'sizeLower'}
386 0 0 if ($params{'filter'}{'checkSumSHA512'})
390 0 0 if $sha->hexdigest ne $params{'filter'}{'checkSumSHA512'}
393 0 0 if ($params{'filter'}{'checkSumSHA2'})
397 0 0 if $sha->hexdigest ne $params{'filter'}{'checkSumSHA2'}
404 0 0 if @results >= $params{'limit'}
421 0 0 if ($params{'filter'}{'firstMatch'}) { }
0 0 elsif ($params{'filter'}{'firstLine'}) { }
0 0 elsif ($params{'filter'}{'lineCount'}) { }
445 0 0 unless 'FusionInventory::Agent::Tools::Win32'->require
447 0 0 unless $params{'properties'}
448 0 0 unless $params{'class'}