Branch Coverage

blib/lib/POE/Component/EasyDBI.pm
Criterion Covered Total %
branch 88 204 43.1


line true false branch
50 0 13 $method =~ s/^_// ? :
52 0 13 unless $method =~ /[^A-Z]/
56 0 13 unless exists $COMMANDS{$method}
59 1 12 $method eq 'shutdown' ? :
60 0 13 if ($call) { }
92 0 2 if (@_ & 1 and _HASH($_[0])) { }
96 0 2 if (@_ & 1)
130 0 2 unless (exists $opt{'dsn'})
136 0 2 unless (exists $opt{'username'})
142 0 2 unless (exists $opt{'password'})
148 0 2 if (exists $opt{'reconnect_wait'} and $opt{'reconnect_wait'} < 1) { }
2 0 elsif (not $opt{'reconnect_wait'}) { }
156 0 2 unless (exists $opt{'alias'})
165 2 0 if (exists $opt{'connect_error'})
166 2 0 if (_ARRAY($opt{'connect_error'})) { }
167 0 2 unless ($#{$opt{'connect_error'};} > 0)
180 2 0 if (exists $opt{'connected'})
181 2 0 if (_ARRAY($opt{'connected'})) { }
182 0 2 unless ($#{$opt{'connected'};} > 0)
194 0 2 if (exists $opt{'options'})
195 0 0 unless (_HASH($opt{'options'}))
201 2 0 if ($opt{'stopwatch'})
203 0 2 if ($@)
212 0 2 if (keys %opt)
237 0 2 unless my $session = 'POE::Session'->create('object_states', [$self, {'_start', 'start', '_stop', 'stop', 'setup_wheel', 'setup_wheel', 'sig_child', 'sig_child', 'child_error', 'child_error', 'child_closed', 'child_closed', 'child_STDOUT', 'child_STDOUT', 'child_STDERR', 'child_STDERR', map({$_, 'db_handler', uc $_, 'db_handler';} keys %COMMANDS), 'combo', 'combo_query', 'COMBO', 'combo_query', 'shutdown', 'shutdown_poco', 'SHUTDOWN', 'shutdown_poco', 'send_query', 'send_query', 'check_queue', 'check_queue', 'print_queue', 'print_queue'}], 'heap', {'queue', [], 'idcounter', 0, 'wheel', undef, 'retries', 0, 'shutdown', 0, 'opts', $keep, 'alias', $$keep{'alias'}, 'max_retries', $$keep{'max_retries'} || 5, 'no_connect_failures', $$keep{'no_connect_failures'} || 0, 'action_params', {'commit', [], 'rollback', [], 'begin_work', [], 'func', ['args'], 'method', ['function', 'args'], 'single', ['separator'], 'insert', ['insert', 'hash', 'table', 'last_insert_id'], 'array', ['chunked', 'separator'], 'arrayarray', ['chunked'], 'keyvalhash', ['primary_key', 'chunked'], 'hashhash', ['primary_key', 'chunked'], 'hasharray', ['primary_key', 'chunked'], 'arrayhash', ['chunked']}})
303 1 1 wantarray ? :
311 0 2 if ($$heap{'shutdown'})
313 0 0 if ($$heap{'shutdown'} == 1 and not defined $_[10]) { }
0 0 elsif ($$heap{'shutdown'} == 2) { }
325 0 2 if (defined $_[10] and uc $_[10] eq 'NOW') { }
329 0 0 if ($$heap{'wheel'})
341 0 0 if ($$queue{'action'} eq 'EXIT')
373 0 2 unless (_HASH $args)
379 2 0 unless (defined $$args{'session'})
386 0 2 if (not exists $$args{'event'}) { }
393 0 0 unless (not ref $a or $a =~ /postback/i or $a =~ /callback/i)
405 2 2 if delete $res[-1]{'__last'}
413 4 12 if defined $$arg{$key} or $key eq 'queries'
431 27 0 if (_HASH($_[10])) { }
440 0 27 if ($$args{'seperator'})
446 23 4 unless (defined $$args{'session'})
453 0 27 if (not exists $$args{'event'}) { }
460 0 0 unless (not ref $a or $a =~ /postback/i or $a =~ /callback/i)
469 6 21 if (not defined $$args{'sql'}) { }
470 0 6 unless ($$args{'action'} =~ /^(insert|func|method|commit|rollback|begin_work)$/i)
477 0 21 if (ref $$args{'sql'})
479 0 0 if (reftype($$args{'event'}) and reftype($$args{'event'}) eq 'CODE') { }
491 23 4 if (not defined $$args{'placeholders'}) { }
495 0 4 unless (_ARRAY($$args{'placeholders'}))
497 0 0 if (reftype($$args{'event'}) and reftype($$args{'event'}) eq 'CODE') { }
509 0 27 if ($$args{'action'} eq 'HASHHASH' or $$args{'action'} eq 'HASHARRAY')
510 0 0 if (not defined $$args{'primary_key'}) { }
513 0 0 if (reftype($$args{'event'}) and reftype($$args{'event'}) eq 'CODE') { }
522 0 0 if (ref $$args{'sql'})
524 0 0 if (reftype($$args{'event'}) and reftype($$args{'event'}) eq 'CODE') { }
536 0 27 if ($$heap{'shutdown'})
540 0 0 if (reftype($$args{'event'}) and reftype($$args{'event'}) eq 'CODE') { }
552 4 23 if ($$args{'session'} ne $_[5]->ID)
568 0 29 unless (defined $args and _HASH $args)
589 2 56 if $$heap{'active'}
592 27 29 unless scalar @{$$heap{'queue'};} > 0
595 0 29 unless $$heap{'shutdown'} != 2
597 29 0 if ($$heap{'opts'}{'stopwatch'})
607 144 122 unless defined $$heap{'queue'}[0]{$_}
631 2 0 if $$heap{'alias'} ne ''
644 0 2 if ($$heap{'shutdown'})
654 0 2 if ($$heap{'retries'} == $$heap{'max_retries'})
664 0 2 if ($$heap{'opts'}{'alt_fork'} and $^O ne 'MSWin32')
665 0 0 $$heap{'opts'}{'alt_fork'} ne '1' ? :
676 0 2 $^O eq 'MSWin32' ? :
706 2 0 if ($kernel->can('sig_child')) { }
713 0 2 if (not defined $$heap{'wheel'}) { }
722 0 2 if ($$heap{'opts'}{'alt_fork'})
744 0 0 unless (defined $id)
751 0 0 if (defined $$heap{'queue'}[0])
752 0 0 if ($$heap{'queue'}[0]{'id'} eq $id) { }
758 0 0 if ($$heap{'queue'}[$count]{'id'} eq $id)
778 0 0 if ($$heap{'shutdown'})
807 2 0 if ($$heap{'shutdown'})
808 2 0 if ($$heap{'wheel'})
821 0 29 unless (_HASH $data)
833 0 29 if ($$data{'id'} eq 'DBI')
836 0 0 if ($$heap{'no_connect_failures'})
838 0 0 if (defined $$heap{'queue'}[0])
842 0 0 if (_ARRAY($$heap{'opts'}{'connect_error'})) { }
0 0 elsif ($$qc{'session'} and $$qc{'event'}) { }
846 0 0 if (reftype($$qc{'event'}) and reftype($$qc{'event'}) eq 'CODE') { }
867 2 27 if ($$data{'id'} eq 'DBI-CONNECTED')
868 2 0 if (_ARRAY($$heap{'opts'}{'connected'}))
870 0 2 if (defined $$heap{'queue'}[0])
881 0 27 if (exists $$data{'chunked'}) { }
883 0 0 if (exists $$data{'last_chunk'}) { }
892 0 27 if ($$data{'id'} ne $$heap{'queue'}[0]{'id'})
916 0 27 if $$self{'query_logger'}
928 7 20 if (reftype($$query_copy{'event'}) and reftype($$query_copy{'event'}) eq 'CODE') { }
938 27 0 if ($refcount_decrement)
942 4 23 if (defined $$query_copy{'sendersession'} and $$query_copy{'sendersession'} ne $$query_copy{'session'})
958 0 0 if ($input eq '')
960 0 0 if $_[3]{'opts'}{'no_warnings'} and 1
971 2 0 if ($$heap{'shutdown'})
973 2 0 if $$heap{'alias'} ne ''
990 1 0 if (ref $self and $self->ID) { }