Branch Coverage

blib/lib/Lab/Instrument.pm
Criterion Covered Total %
branch 128 236 54.2


line true false branch
61 10 0 if (ref $_[0] eq 'HASH') { }
72 18 20 if ($flag == 1)
75 10 28 if ($isa eq "Lab::Instrument")
89 0 10 if ($class eq "Lab::Instrument")
96 0 10 if defined $self->config("device_name")
98 0 10 if defined $self->config("device_comment")
122 26 189 if ($element eq 'device_settings') { }
18 171 elsif ($element eq 'connection_settings') { }
126 10 16 unless exists $self->{'device_settings'}
136 10 8 unless exists $self->{'connection_settings'}
160 28 0 if $class ne "Lab::Instrument"
174 10 18 if ($class eq $package and $class ne "Lab::Instrument")
208 3 15 if (defined ${$class . "::MODIFIED";})
223 29 9 if ($class->can("set_" . $cache_param) and exists &$set_methode)
245 0 75 if (defined $self->{'requestID'} or $self->connection->is_blocked)
254 0 75 unless (defined $__PACKAGE__::SELF)
259 0 75 if (defined $__PACKAGE__::SELF->{'config'}{'fast_cache'} and $__PACKAGE__::SELF->{'config'}{'fast_cache'} > 0)
273 75 0 if ($__PACKAGE__::SELF->can($get_sub) and not $__PACKAGE__::SELF->{'config'}{'no_cache'})
286 34 4 if ($class->can("get_" . $cache_param) and exists &$get_methode)
317 0 188 if not defined $read_mode and exists $self->{'config'}{'default_read_mode'}
319 0 294 if ($self->connection->is_blocked == 1)
320 0 0 if (defined $self->device_cache($parameter)) { }
328 0 294 if (defined $self->{'requestID'})
332 0 0 if ($subroutine ne $class . '::' . $get_sub) { }
333 0 0 if (defined $self->device_cache($parameter)) { }
349 98 2 if (defined $read_mode and $read_mode eq "cache" and defined $self->device_cache($parameter) and not $self->{'config'}{'no_cache'})
361 0 196 unless (defined $__PACKAGE__::SELF)
367 0 196 if (not defined $retval or ref $retval eq 'Hook::LexWrap::Cleanup') { }
372 3 193 wantarray ? :
417 2 0 if (defined $self->connection)
432 0 16 if (defined $self->config($ckey) and $self->can($subname))
440 0 49 if ($self->can($subname))
456 0 0 unless exists $self->device_cache->{$ckey}
457 0 0 if (not defined $self->device_cache->{$ckey} || defined $self->config->{$ckey}) { }
460 0 0 unless $self->can($subname)
467 0 0 unless $self->can($subname)
468 0 0 unless $self->can($subname)
487 0 0 scalar @_ > 0 ? :
500 0 0 if ($self->device_cache and $self->connection)
503 0 0 if (@order) { }
506 0 0 if exists $ckeyhash{$ckey}
531 0 40 if (ref $config ne 'HASH') { }
544 14 491 if exists $config->{$fields_key}
565 0 10 unless defined $connection
568 0 10 if (grep(/^ALL$/u, @{$self->supported_connections;}) == 1) { }
10 0 elsif ($connection->isa('Lab::Connection::DEBUG') or $connection->isa('Lab::Connection::Mock')) { }
577 0 0 if $connection->isa("Lab::Connection::" . $conn_supp)
598 20 4 unless defined $config->{$setting_key}
602 4 6 if (defined $self->config('connection')) { }
6 0 elsif (defined $self->config('connection_type')) { }
604 4 0 if ($self->_checkconnection($self->config('connection'))) { }
621 0 6 unless ($connection_type =~ /^[A-Za-z0-9_\-\:]*$/u)
627 0 6 if ($connection_type eq "none")
628 0 0 if (grep(/^none$/u, @{$self->supported_connections;}) == 1) { }
641 0 6 if ($@)
648 6 0 if ($self->_checkconnection('Lab::Connection::' . $connection_type)) { }
656 0 6 unless $self->connection($full_connection->new($config))
677 2 22 unless (defined $self->connection->config($key))
723 0 6 if ($self->get_status->{'ERROR'})
732 0 0 if (@errors or $code == -1)
778 0 83 scalar(@_) % 2 == 0 && ref $_[1] ne 'HASH' ? :
783 22 0 ref $_[0] eq 'HASH' ? :
61 22 scalar(@_) % 2 == 0 ? :
787 0 83 unless defined $args
790 83 0 if defined $command
794 6 77 if $args->{'error_check'}
801 0 0 ref $_[0] eq 'HASH' ? :
4 0 scalar(@_) % 2 == 0 ? :
805 0 4 unless defined $args
810 0 4 if $args->{'error_check'}
825 1 17 defined $args->{'read_mode'} ? :
835 0 18 if ($read_mode eq 'request' and not defined $self->{'requestID'}) { }
0 18 elsif (defined $self->{'requestID'} and $self->{'requestID'} eq $requestID) { }
857 3 163 defined $args->{'read_mode'} ? :
858 166 0 if defined $command
860 0 166 unless (defined $args->{'command'})
865 0 166 if $args->{'error_check'}
883 0 184 scalar(@_) % 2 == 0 && ref $_[1] ne 'HASH' ? :
888 152 0 ref $_[0] eq 'HASH' ? :
32 152 scalar(@_) % 2 == 0 ? :
892 0 184 unless defined $args
907 302 177 if (scalar @_ == 0) { }
177 0 elsif (scalar @_ == 1) { }
0 0 elsif (scalar @_ > 1 and scalar(@_) % 2 == 0) { }
928 40 137 if (ref($value) =~ /HASH/u) { }
931 16 79 if exists $self->device_settings->{$ext_key}
950 204 400 if (scalar @_ == 0) { }
394 6 elsif (scalar @_ == 1) { }
6 0 elsif (scalar @_ > 1 and scalar(@_) % 2 == 0) { }
971 202 198 if (ref($value) =~ /HASH/u) { }
974 202 0 if exists $self->device_cache->{$ext_key}
998 20 22 if (scalar @_ == 0) { }
22 0 elsif (scalar @_ == 1) { }
0 0 elsif (scalar @_ > 1 and scalar(@_) % 2 == 0) { }
1017 0 22 if (ref($value) =~ /HASH/u) { }
1020 0 0 if exists $self->{'connection_settings'}{$ext_key}
1040 131 153 if (ref $arg ne 'HASH') { }
1041 113 18 if (defined @{$params;}[$i])
1055 214 262 if (exists $arguments->{$param}) { }
1067 0 1218 if (exists $arguments->{$param})
1074 609 0 if (wantarray) { }
1093 0 19 unless (defined $result[$i])
1098 19 0 if (wantarray) { }
1114 60 83 if (not defined $key) { }
10 73 elsif (ref($key) =~ /HASH/u) { }
1145 0 1232 unless my $type = ref $self
1151 1226 6 if (exists $self->{'_permitted'}{$name}) { }
6 0 elsif ($name =~ qr/^(get_|set_)(.*)$/u) { }
0 0 elsif (exists $self->{'device_settings'}{$name}) { }
1152 31 1195 if (@_) { }
1160 6 0 if (exists $self->device_settings->{$2}) { }
0 0 elsif (exists $self->device_cache->{$2}) { }
1173 0 0 if (@_) { }
1192 0 0 if $self->can("SUPER::DESTROY")
1200 0 6 if ($gs eq 'set_') { }
1202 0 0 if (not defined $value or ref $value ne "")
1208 0 0 if (@_ > 0)
1217 0 6 if (@_ > 0)