Branch Coverage

blib/lib/FusionInventory/Agent/Task/Collect.pm
Criterion Covered Total %
branch 36 130 27.6


line true false branch
63 0 0 unless ($self->{'target'}->isa('FusionInventory::Agent::Target::Server'))
74 7 58 if (ref $spec eq 'HASH')
75 1 6 unless (exists $base->{$key})
81 0 47 unless $self->_validateSpec($base->{$key}, $attribute, $spec->{$attribute})
86 20 38 if ($spec == _MANDATORY())
87 5 15 unless (exists $base->{$key})
95 0 38 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 10 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'} ? :
218 1 0 unless ($job->{'uuid'})
225 0 0 unless ($job->{'function'})
230 0 0 unless (defined $functions{$job->{'function'}})
240 0 0 unless $count
243 0 0 unless ref $result eq 'HASH'
244 0 0 unless not $count or keys %$result
248 0 0 if $token
256 0 0 exists $answer->{'token'} ? :
268 0 0 if ($type == 3 or $type >= 8) { }
280 0 0 unless 'FusionInventory::Agent::Tools::Win32'->require
289 0 0 unless $values
292 0 0 if (ref $values eq 'HASH') { }
295 0 0 if $k =~ m[/$]
314 0 0 unless -d $params{'dir'}
321 0 0 if (not $params{'recursive'} and $File::Find::name ne $params{'dir'})
326 0 0 if ($params{'filter'}{'is_dir'} and not $params{'filter'}{'checkSumSHA512'} and not $params{'filter'}{'checkSumSHA2'})
330 0 0 unless -d $File::Find::name
333 0 0 if ($params{'filter'}{'is_file'})
334 0 0 unless -f $File::Find::name
339 0 0 if ($params{'filter'}{'name'})
340 0 0 if $filename ne $params{'filter'}{'name'}
343 0 0 if ($params{'filter'}{'iname'})
344 0 0 if lc $filename ne lc $params{'filter'}{'iname'}
347 0 0 if ($params{'filter'}{'regex'})
349 0 0 unless $File::Find::name =~ /$re/
354 0 0 if ($params{'filter'}{'sizeEquals'})
355 0 0 unless $size == $params{'filter'}{'sizeEquals'}
358 0 0 if ($params{'filter'}{'sizeGreater'})
359 0 0 if $size < $params{'filter'}{'sizeGreater'}
362 0 0 if ($params{'filter'}{'sizeLower'})
363 0 0 if $size > $params{'filter'}{'sizeLower'}
366 0 0 if ($params{'filter'}{'checkSumSHA512'})
370 0 0 if $sha->hexdigest ne $params{'filter'}{'checkSumSHA512'}
373 0 0 if ($params{'filter'}{'checkSumSHA2'})
377 0 0 if $sha->hexdigest ne $params{'filter'}{'checkSumSHA2'}
384 0 0 if @results >= $params{'limit'}
401 0 0 if ($params{'filter'}{'firstMatch'}) { }
0 0 elsif ($params{'filter'}{'firstLine'}) { }
0 0 elsif ($params{'filter'}{'lineCount'}) { }
425 0 0 unless 'FusionInventory::Agent::Tools::Win32'->require
427 0 0 unless $params{'properties'}
428 0 0 unless $params{'class'}