Branch Coverage

blib/lib/CPAN/SQLite/Populate.pm
Criterion Covered Total %
branch 59 188 31.3


line true false branch
37 0 4 unless $obj and ref $obj eq "CPAN::SQLite::Index::$table"
41 0 1 unless ($setup)
42 0 0 unless $state and ref $state eq "CPAN::SQLite::State"
60 1 0 if ($setup)
61 0 1 unless ($self->{'cdbi'}->create_tables("setup", $setup))
66 0 1 unless ($self->create_objs)
70 0 1 unless ($self->populate_tables)
85 4 0 if ($index and ref $index eq "CPAN::SQLite::Index::$table") { }
87 3 1 if ($table ne "info")
88 0 3 unless has_hash_data($info)
102 4 12 if ref $obj eq $tbl2obj{$_}
108 0 1 unless ($setup)
124 1 0 $setup ? :
128 0 1 unless ($info_obj->delete)
137 0 3 unless ($obj->$method)
138 0 0 if (my $error = $obj->{'error_msg'}) { }
150 0 1 unless ($info_obj->insert)
165 0 1 unless has_hash_data($info)
167 0 1 unless $cdbi and ref $cdbi eq "CPAN::SQLite::DBI::Index::auths"
185 0 1 unless ($CPAN::SQLite::Populate::dbh)
191 1 0 $setup ? :
192 0 1 unless (has_hash_data($data))
198 0 1 unless (my $sth = $cdbi->sth_insert(\@fields))
204 0 4 unless $values and $cpanid
207 0 4 unless ($sth->execute($cpanid, $values->{'email'}, $values->{'fullname'}))
212 0 4 unless ($auth_ids->{$cpanid} = $CPAN::SQLite::Populate::dbh->func("last_insert_rowid"))
220 0 1 unless ($CPAN::SQLite::Populate::dbh->commit)
230 0 0 unless ($CPAN::SQLite::Populate::dbh)
236 0 0 unless (has_hash_data($data))
245 0 0 unless $data->{$cpanid}
248 0 0 unless $cpanid and $values
250 0 0 unless ($sth->execute($cpanid, $values->{'email'}, $values->{'fullname'}))
258 0 0 unless ($CPAN::SQLite::Populate::dbh->commit)
279 0 1 unless has_hash_data($info)
281 0 1 unless $cdbi and ref $cdbi eq "CPAN::SQLite::DBI::Index::dists"
299 0 1 unless ($CPAN::SQLite::Populate::dbh)
303 0 1 unless my $auth_obj = $self->{'obj'}{'auths'}
307 1 0 $setup ? :
308 0 1 unless (has_hash_data($data))
312 0 1 unless ($dists and $auth_ids)
319 0 1 unless (my $sth = $cdbi->sth_insert(\@fields))
326 0 92 unless $values and $cpanid and $auth_ids->{$cpanid}
329 0 92 unless ($sth->execute($$auth_ids{$values->{'cpanid'}}, $distname, $values->{'dist_file'}, $values->{'dist_vers'}, $values->{'dist_abs'}))
334 0 92 unless ($dist_ids->{$distname} = $CPAN::SQLite::Populate::dbh->func("last_insert_rowid"))
342 0 1 unless ($CPAN::SQLite::Populate::dbh->commit)
352 0 0 unless ($CPAN::SQLite::Populate::dbh)
358 0 0 unless (has_hash_data($data))
362 0 0 unless my $auth_obj = $self->{'obj'}{'auths'}
365 0 0 unless ($dists and $auth_ids)
372 0 0 unless $data->{$distname}
376 0 0 unless $values and $cpanid and $auth_ids->{$cpanid}
379 0 0 unless ($sth->execute($$auth_ids{$values->{'cpanid'}}, $distname, $values->{'dist_file'}, $values->{'dist_vers'}, $values->{'dist_abs'}))
387 0 0 unless ($CPAN::SQLite::Populate::dbh->commit)
397 0 0 unless ($CPAN::SQLite::Populate::dbh)
403 0 0 unless (has_hash_data($data))
411 0 0 unless ($sth->execute($data->{$distname}))
419 0 0 unless ($CPAN::SQLite::Populate::dbh->commit)
434 0 1 unless has_hash_data($info)
436 0 1 unless $cdbi and ref $cdbi eq "CPAN::SQLite::DBI::Index::mods"
454 0 1 unless ($CPAN::SQLite::Populate::dbh)
458 0 1 unless my $dist_obj = $self->{'obj'}{'dists'}
462 1 0 $setup ? :
463 0 1 unless (has_hash_data($data))
467 0 1 unless ($mods and $dist_ids)
476 0 1 unless (my $sth = $cdbi->sth_insert(\@fields))
482 0 544 unless $values and $$dist_ids{$values->{'dist_name'}}
484 0 544 unless ($sth->execute($$dist_ids{$values->{'dist_name'}}, $modname, $values->{'mod_abs'}, $values->{'mod_vers'}))
489 0 544 unless ($mod_ids->{$modname} = $CPAN::SQLite::Populate::dbh->func("last_insert_rowid"))
497 0 1 unless ($CPAN::SQLite::Populate::dbh->commit)
507 0 0 unless ($CPAN::SQLite::Populate::dbh)
513 0 0 unless (has_hash_data($data))
517 0 0 unless my $dist_obj = $self->{'obj'}{'dists'}
520 0 0 unless ($dist_ids and $mods)
529 0 0 unless $data->{$modname}
533 0 0 unless $values and $$dist_ids{$values->{'dist_name'}}
535 0 0 unless ($sth->execute($$dist_ids{$values->{'dist_name'}}, $modname, $values->{'mod_abs'}, $values->{'mod_vers'}))
543 0 0 unless ($CPAN::SQLite::Populate::dbh->commit)
553 0 0 unless ($CPAN::SQLite::Populate::dbh)
557 0 0 unless my $dist_obj = $self->{'obj'}{'dists'}
560 0 0 if (has_hash_data($data))
563 0 0 unless ($sth->execute($data->{$distname}))
574 0 0 if (has_hash_data($data))
577 0 0 unless ($sth->execute($data->{$modname}))
587 0 0 unless ($CPAN::SQLite::Populate::dbh->commit)
602 0 1 unless $cdbi and ref $cdbi eq "CPAN::SQLite::DBI::Index::info"
615 0 1 unless ($CPAN::SQLite::Populate::dbh)
621 0 1 unless (my $sth = $cdbi->sth_insert(["status"]))
626 0 1 unless ($sth->execute(1))
633 0 1 unless ($CPAN::SQLite::Populate::dbh->commit)
649 0 1 unless ($CPAN::SQLite::Populate::dbh)
656 0 1 unless ($sth->execute(1))
663 0 1 unless ($CPAN::SQLite::Populate::dbh->commit)
675 0 0 unless $dbh
676 0 0 if ($sth)