Branch Coverage

blib/lib/Hardware/PortScanner.pm
Criterion Covered Total %
branch 35 162 21.6


line true false branch
36 1 0 if $_[0] =~ /::/
51 0 0 if ($parm eq 'MAX_PORT')
54 0 0 unless ($value =~ /^\d+$/)
61 0 0 unless ($parm_found)
83 0 20 if ($IsWin) { }
109 0 0 if (grep {$_ =~ /can.t getattr:/;} @_) { }
120 0 20 if ($IsWin) { }
139 0 3 if $debug
146 0 0 unless defined $$serial{'SCAN_LOG'}
169 0 0 defined $$serial{'FOUND_DEVICE'} ? :
175 0 1 defined $$serial{'FOUND_DEVICE'} ? :
195 0 20 if ($PortObj)
240 0 5 if ($parm eq $key)
241 0 0 if (ref $value eq 'ARRAY') { }
0 0 elsif (ref $value eq '') { }
252 0 0 unless (/^\d+$/)
260 1 4 if ($parm eq $key)
262 1 0 if (ref $value eq 'ARRAY') { }
0 0 elsif (ref $value eq '') { }
273 0 0 unless (/^\d+$/ and $_ > 0 and $_ <= 50)
281 1 4 if ($parm eq $key)
282 1 0 ref $value eq 'ARRAY' ? :
285 1 0 if (/^([5678])([NEO])([12])([NRX])?$/) { }
289 1 0 $2 eq 'O' ? :
0 1 $2 eq 'E' ? :
291 0 1 $4 eq 'X' ? :
0 1 $4 eq 'R' ? :
312 1 4 if ($parm eq $key)
313 0 1 unless ($value =~ /^\d+$/ or $value =~ /^\d+[.]\d+$/)
317 1 0 if (ref $value eq '') { }
327 1 4 if ($parm eq $key)
328 1 0 if (ref $value eq '') { }
338 1 4 if ($parm eq $key)
339 1 0 if (ref $value eq '') { }
348 0 5 unless ($parm_found)
354 0 1 unless (exists $$config{'TEST_STRING'} and exists $$config{'VALID_REPLY_RE'})
360 1 0 unless (exists $$config{'BAUD'})
364 0 1 unless (exists $$config{'COM'})
368 0 1 unless (exists $$config{'SETTING'})
386 1 0 if (exists $$config{'MAX_WAIT'}) { }
389 0 1 if $read_iterations < 1
419 0 0 if ($PortObj) { }
422 0 0 unless ($PortObj->baudrate($baud))
438 0 0 if ($PortObj->write_settings)
468 0 0 if ($bytes_read > 0)
472 0 0 if $feedback =~ /$$config{'VALID_REPLY_RE'}/
480 0 0 if ($feedback =~ /$$config{'VALID_REPLY_RE'}/)
496 0 0 if exists $$config{'MAX_WAIT'}
538 0 0 if (defined $$serial{'CONNECTION'})
547 0 0 if (scalar @_ == 0)
548 0 0 if ($serial->num_found_devices == 1) { }
0 0 elsif ($serial->num_found_devices == 0) { }
566 0 0 if ($parm eq $key)
567 0 0 if (ref $value eq '') { }
577 0 0 unless ($$config{$key} =~ /^\d+$/)
584 0 0 if ($parm eq $key)
586 0 0 if (ref $value eq '') { }
596 0 0 unless ($value =~ /^\d+$/ and $value > 0 and $value <= 50)
606 0 0 if ($parm eq $key)
608 0 0 if ($value =~ /^([5678])([NEO])([12])([NRX])?$/) { }
614 0 0 $2 eq 'O' ? :
0 0 $2 eq 'E' ? :
616 0 0 $4 eq 'X' ? :
0 0 $4 eq 'R' ? :
633 0 0 if ($parm eq $key)
636 0 0 unless (defined $device)
657 0 0 unless ($parm_found)
665 0 0 unless (exists $$config{'BAUD'})
671 0 0 unless (exists $$config{'COM'})
677 0 0 unless (exists $$config{'SETTING'})
691 0 0 if ($PortObj) { }
702 0 0 unless ($PortObj->write_settings)
763 0 0 if (ref $_[0]) { }
782 0 0 if ($_[0])
795 0 0 if ($_[0])
808 0 0 if ($_[0])
821 0 0 if ($_[0])
834 0 0 if ($_[0])
847 0 0 if ($_[0])
860 0 0 if ($_[0])
874 0 0 if ($_[0])