Branch Coverage

File:blib/lib/Class/Shared/Frontend.pm
Coverage:90.3%

line%coveragebranch
45100TFif (@_ and not ref $_[0] and not defined $_[0] && exists $KNOWN_OPTION{$_[0]})
50100TFif (@_ == 1 and ref $_[0] eq 'HASH') { }
100TFelsif (@_) { }
53100TFif @_ % 2
57100TFif defined $opt{'class'}
61100TFunless exists $KNOWN_OPTION{$key}
64100TFunless defined $target and length $target
69100TFif (defined $opt{'ctor'} and ref $opt{'ctor'} ne "ARRAY")
73100TFdefined $opt{'host'} || defined $opt{'port'} ? :
81100TFif $transport eq "unix" and defined $opt{'token'} || defined $opt{'token_file'}
86100TFif defined $opt{$_}
100TFif $transport eq "unix" and grep {length $opt{$_} if defined $opt{$_};} "tls_cert", "tls_key", "tls_ca", "tls_fingerprint"
91100TFif defined $opt{'token'} and defined $opt{'token_file'}
95100TFdefined $opt{'token_file'} ? :
97100TFif ($transport eq "tcp")
99100TFunless defined $opt{'host'} and defined $opt{'port'}
104100TFif (not $opt{'port'} =~ /\A[0-9]+\z/ or $opt{'port'} < 1 or $opt{'port'} > 65535)
108100TFif defined $opt{'socket'}
116100TFif grep {not defined $opt{$_} && length $opt{$_};} "tls_cert", "tls_key"
121100TFunless defined $opt{'tls_ca'} and length $opt{'tls_ca'} or defined $opt{'tls_fingerprint'} and length $opt{'tls_fingerprint'}
126100TFif defined $opt{'tls_ca'} and length $opt{'tls_ca'} and (defined $opt{'tls_fingerprint'} and length $opt{'tls_fingerprint'})
132100TFdefined $opt{'socket'} && length $opt{'socket'} ? :
100TF$transport eq 'unix' ? :
153100TFdefined $opt{'tls_fingerprint'} && length $opt{'tls_fingerprint'} ? :
100TFexists $opt{'autostart'} ? :
100TFdefined $opt{'timeout'} ? :
100TF$transport eq 'unix' ? :
100TFdefined $opt{'log'} && length $opt{'log'} ? :
177100TF$self->{'transport'} eq 'tcp' ? :
184100TFdefined $_[0]{'sock'} ? :
194100TFunless defined $method and length $method
212100TFunless $self->{'sock'}
230100TFif $self->{'sock'}
242100TFunless $self->{'sock'}
249100TFif ($self->{'transport'} eq "unix")
256100TFif $error
258100TF$response->{'ok'} ? :
269100TFif $method eq "DESTROY"
271100TFunless ref $self
284100TFunless ref $self
285100TFunless defined $method
289100TFif $local
300100TFunless $response and $response->{'ok'}
301100TFunless ref $response->{'result'} eq "ARRAY" and $response->{'result'}[0]
305100TFif @_ and ref $_[0] and &Scalar::Util::refaddr($_[0]) == &Scalar::Util::refaddr($self)
317100TFunless ref $self
320100TFunless defined $class
322100TFif $class eq "Class::Shared::Frontend" or $class eq "UNIVERSAL"
333100TFunless $response and $response->{'ok'}
335100TFref $response->{'result'} eq 'ARRAY' && $response->{'result'}[0] ? :
351100TFdefined $want ? :
100TF$want ? :
355100TFif $context eq "list"
356100TFif $context eq "void"
370100TFunless ($response->{'ok'})
372100TFunless defined $error and length $error
377100TFunless $error =~ /\n\z/
382100TFunless ref $result eq "ARRAY"
394100TFunless ($sock)
399100TFunless $self->{'autostart'} and $self->{'transport'} eq "unix"
404100TFunless $sock
419100TFif ($self->{'transport'} eq "tcp")
439100TFunless ($sock)
441100TFunless defined $why and length $why
453100TFunless -S $path
459100TFunless ($safe)
469100TFunless (socket $sock, 1, 1, 0 and connect $sock, pack_sockaddr_un($path))
482100TFunless $sock
491100TFunless (defined $response)
498100TFunless ($response->{'ok'})
518100TFunless defined $error
520100TFif ($self->{'transport'} eq "tcp" and defined $error and $error =~ /closed by peer|read failed|write failed/)
532100TFif $error =~ /timed out/
535100TFif defined $self->{'token'}
545100TFunless ($response->{'ok'})
560100TFif ($message->{'op'} || '') eq "call"
563100TFunless $self->{'sock'}
567100TFunless (defined $response)
568100TFunless defined $error and length $error
583100TFunless (defined $bytes)
588100TFunless ($ok)
594100TFif (($message->{'op'} || '') eq "hello")
596100TFif ref $refusal eq "HASH" and not $refusal->{'ok'}
604100TFunless defined $response
606100TFif (ref $response ne "HASH")
623100TFif close $fh
639100TFunless ($dir_ok)
646100TFunless (sysopen $lock, $lock_path, 66, 384)
65050TFunless (flock $lock, 2)
657100TFif (my $sock = eval {         do {         $self->_greet } })
667100TFunless ($state)
67350TFif ($state ne "running" and not $self->_fork_backend($lock))
683100TFif (my $handshake_error = $@)
688100TFif ($greeted)
696100TFif ($state eq "running")
69850TFunless $state
69950TFif ($state ne "running" and not $self->_fork_backend($lock))
709100TFif not $sock and ($state // "") eq "running"
72450TFunless (defined $pid)
729100TFif ($pid == 0)
75750TFunless (sysopen $owner, $owner_path, 66, 384)
763100TFif (flock $owner, 5)
765100TFif (-e $path and not -S $path) { }
100TFelsif (-e $path and not unlink($path)) { }
788100TFunless defined $error and $error =~ /\AClass::Shared: /
804100TFif ($lock)
80550TFunless close $lock
80850TFunless POSIX::setsid()
81250TFif not defined $pid or $pid > 0
82150TFunless $detached
823100TFif defined $_ and not ref $_
83650TFif (${^TAINT})
8370TFunless ($perl) = $perl =~ /\A([^\0]+)\z/
8380TFunless ($socket) = $socket =~ /\A([^\0]+)\z/
8390TFunless ($log) = $log =~ /\A([^\0]+)\z/
8420TFif -d $_
8430TFm[\A(/[^\0]*)\z] ? :
8440TF@safe ? :