Branch Coverage

blib/lib/IMDB/Local.pm
Criterion Covered Total %
branch 0 482 0.0


line true false branch
77 0 0 unless defined $$self{$_}
86 0 0 if (defined $$self{'listsDir'})
138 0 0 if (defined $$self{'logfd'}) { }
151 0 0 if ($$self{'verbose'})
172 0 0 if ($file =~ /\.gz$/) { }
195 0 0 if ($file =~ /\.gz$/) { }
219 0 0 if ($dbkey =~ s/\s*\{([^\}]+)\}//o)
221 0 0 if ($s =~ s/\s*\(\#(\d+)\.(\d+)\)$//) { }
232 0 0 if (defined $$self{'seriesKeys'}{$parentKey})
242 0 0 if ($dbkey =~ s/^\"//o and $dbkey =~ s/\" \(/ (/o) { }
0 0 elsif ($dbkey =~ s/\s+\(TV\)$//o) { }
0 0 elsif ($dbkey =~ s/\s+\(V\)$//o) { }
0 0 elsif ($dbkey =~ s/\s+\(VG\)$//o) { }
243 0 0 if ($dbkey =~ s/\s+\(mini\)$//o) { }
244 0 0 if ($hash{'parentId'} == 0) { }
253 0 0 if ($hash{'parentId'} == 0) { }
285 0 0 if ($title =~ /^\"/o and $title =~ /\"\s*\(/o)
290 0 0 if ($title =~ s/\s+\((\d\d\d\d)\)$//o or $title =~ s[\s+\((\d\d\d\d)/[IVXL]+\)$][]o) { }
0 0 elsif ($title =~ s/\s+\((\?\?\?\?)\)$//o or $title =~ s[\s+\((\?\?\?\?)/[IVXL]+\)$][]o) { }
293 0 0 if (not defined $year) { }
303 0 0 if (not defined $year) { }
314 0 0 if (not defined $year) { }
324 0 0 if ($hash{'series'} != 0) { }
328 0 0 if (not defined $hash{'title'}) { }
355 0 0 if (/^MOVIES LIST/o) { }
0 0 elsif ($lineCount > 1000) { }
356 0 0 unless ($_ = <$fh> and /^===========/o)
361 0 0 unless ($_ = <$fh> and /^\s*$/o)
375 0 0 if $$self{'showProgressBar'}
380 0 0 if $$self{'showProgressBar'}
381 0 0 if $$self{'showProgressBar'}
399 0 0 if $line =~ /^\-\-\-\-\-\-\-+/o
401 0 0 if $line =~ /\{\{SUSPENDED\}\}/o
408 0 0 if ($tab != -1) { }
410 0 0 if ($ykey = /\s+(\d\d\d\d)$/) { }
0 0 elsif ($ykey = /\s+(\?\?\?\?)$/) { }
0 0 elsif ($ykey = /\s+(\d\d\d\d)\-(\?\?\?\?)$/) { }
0 0 elsif ($ykey = /\s+(\d\d\d\d)\-(\d\d\d\d)$/) { }
452 0 0 if ($$self{'showProgressBar'})
454 0 0 if ($count > $countEstimate) { }
0 0 elsif ($count > $next_update) { }
469 0 0 if $$self{'showProgressBar'}
488 0 0 if (/^8: THE GENRES LIST/o) { }
0 0 elsif ($lineCount > 1000) { }
489 0 0 unless ($_ = <$fh> and /^===========/o)
494 0 0 unless ($_ = <$fh> and /^\s*$/o)
508 0 0 if $$self{'showProgressBar'}
513 0 0 if $$self{'showProgressBar'}
514 0 0 if $$self{'showProgressBar'}
532 0 0 if $line =~ /^\-\-\-\-\-\-\-+/o
533 0 0 if $line =~ /\s*\{\{SUSPENDED\}\}/o
540 0 0 if ($tab != -1) { }
555 0 0 if ($$self{'imdbMovie2DBKey'}{$mkey})
557 0 0 unless (defined $$self{'GenreID'}{$genre})
566 0 0 if ($count % 50000 == 0)
571 0 0 if ($$self{'showProgressBar'})
573 0 0 if ($count > $countEstimate) { }
0 0 elsif ($count > $next_update) { }
588 0 0 if $$self{'showProgressBar'}
603 0 0 if ($whichCastType eq 'Actors')
604 0 0 if ($DB->table_row_count('Actors') > 0 or $DB->table_row_count('Titles2Actors') > 0 or $DB->table_row_count('Titles2Hosts') > 0 or $DB->table_row_count('Titles2Narrators') > 0)
620 0 0 if ($whichCastType eq 'Actors') { }
0 0 elsif ($whichCastType eq 'Actresses') { }
633 0 0 if $$self{'showProgressBar'}
637 0 0 if $$self{'showProgressBar'}
638 0 0 if $$self{'showProgressBar'}
643 0 0 if (/^$header/) { }
0 0 elsif ($lineCount > 1000) { }
644 0 0 unless ($_ = <$fh> and /^===========/o)
649 0 0 unless ($_ = <$fh> and /^\s*$/o)
654 0 0 unless ($_ = <$fh> and /^Name\s+Titles\s*$/o)
659 0 0 unless ($_ = <$fh> and /^[\s\-]+$/o)
682 0 0 unless (defined $cur_actorId)
694 0 0 if $line =~ /^\-\-\-\-\-\-\-+/o
696 0 0 if length $line == 0
699 0 0 if $line =~ /\s*\{\{SUSPENDED\}\}/o
705 0 0 if ($line =~ s/\s*<(\d+)>//o)
707 0 0 if $billing > 3
710 0 0 if ($line =~ s/^([^\t]+)\t+//o)
720 0 0 if ($$self{'showProgressBar'})
722 0 0 if ($castNames > $castCountEstimate) { }
0 0 elsif ($castNames > $next_update) { }
734 0 0 if ((my $start = index($line, ' [')) != -1)
738 0 0 if ($ex =~ s/Host//o)
741 0 0 if ($ex =~ s/Narrator//o)
749 0 0 if ($line =~ s/\s*\(aka ([^\)]+)\).*$//o)
754 0 0 if ($line =~ s/ (\(.*)$//o)
761 0 0 if ($line =~ s/\s+Narrator$//o)
771 0 0 if ($titleID) { }
772 0 0 if ($isHost)
775 0 0 if ($isNarrator)
778 0 0 unless ($isHost or $isNarrator)
783 0 0 if ($count % 50000 == 0)
791 0 0 if $$self{'showProgressBar'}
809 0 0 if ($DB->table_row_count('Directors') > 0 or $DB->table_row_count('Titles2Directors') > 0)
817 0 0 if $$self{'showProgressBar'}
821 0 0 if $$self{'showProgressBar'}
822 0 0 if $$self{'showProgressBar'}
826 0 0 if (/^THE DIRECTORS LIST/) { }
0 0 elsif ($lineCount > 1000) { }
827 0 0 unless ($_ = <$fh> and /^===========/o)
832 0 0 unless ($_ = <$fh> and /^\s*$/o)
837 0 0 unless ($_ = <$fh> and /^Name\s+Titles\s*$/o)
842 0 0 unless ($_ = <$fh> and /^[\s\-]+$/o)
874 0 0 if $line =~ /^\-\-\-\-\-\-\-+/o
875 0 0 if length $line == 0
878 0 0 if $line =~ /\s*\{\{SUSPENDED\}\}/o
882 0 0 if ($line =~ s/^([^\t]+)\t+//o)
886 0 0 if ($$self{'showProgressBar'})
888 0 0 if ($castNames > $castCountEstimate) { }
0 0 elsif ($castNames > $next_update) { }
909 0 0 if ($line =~ s/ (\(.*)$//o)
916 0 0 if ($$self{'imdbMovie2DBKey'}{$line}) { }
918 0 0 unless (defined $found{$cur_name})
929 0 0 if ($count % 50000 == 0)
937 0 0 if $$self{'showProgressBar'}
954 0 0 if ($DB->table_row_count('Ratings') > 0)
962 0 0 if (/^MOVIE RATINGS REPORT/o) { }
0 0 elsif ($lineCount > 1000) { }
963 0 0 unless ($_ = <$fh> and /^\s*$/o)
968 0 0 unless ($_ = <$fh> and /^New Distribution Votes Rank Title/o)
982 0 0 if $$self{'showProgressBar'}
987 0 0 if $$self{'showProgressBar'}
988 0 0 if $$self{'showProgressBar'}
1003 0 0 if $line =~ /^\s*$/o
1005 0 0 if $line =~ /^\-\-\-\-\-\-\-+/o
1011 0 0 if ($line =~ /^\s+([\.|\*|\d]+)\s+(\d+)\s+(\d+\.\d+)\s+(.+)$/o) { }
1013 0 0 if ($$self{'imdbMovie2DBKey'}{$4})
1016 0 0 if ($countImported % 50000 == 0)
1024 0 0 if ($$self{'showProgressBar'})
1026 0 0 if ($count > $countEstimate) { }
0 0 elsif ($count > $next_update) { }
1039 0 0 if $$self{'showProgressBar'}
1056 0 0 if ($DB->table_row_count('Keywords') > 0)
1065 0 0 if (/THE KEYWORDS LIST/) { }
0 0 elsif ($lineCount > 200000) { }
1066 0 0 unless ($_ = <$fh> and /^===========/o)
1071 0 0 unless ($_ = <$fh> and /^\s*$/o)
1085 0 0 if $$self{'showProgressBar'}
1090 0 0 if $$self{'showProgressBar'}
1091 0 0 if $$self{'showProgressBar'}
1106 0 0 if $line =~ /^\s*$/
1111 0 0 if (defined $title and defined $keyword) { }
1115 0 0 if ($$self{'imdbMovie2DBKey'}{$title})
1116 0 0 unless (defined $found{$keyword})
1127 0 0 if ($countImported % 50000 == 0)
1132 0 0 if ($$self{'showProgressBar'})
1134 0 0 if ($count > $countEstimate) { }
0 0 elsif ($count > $next_update) { }
1147 0 0 if $$self{'showProgressBar'}
1163 0 0 if ($DB->table_row_count('Plots') > 0)
1172 0 0 if (/PLOT SUMMARIES LIST/) { }
0 0 elsif ($lineCount > 500) { }
1173 0 0 unless ($_ = <$fh> and /^===========/o)
1178 0 0 unless ($_ = <$fh> and /^-----------/o)
1192 0 0 if $$self{'showProgressBar'}
1197 0 0 if $$self{'showProgressBar'}
1198 0 0 if $$self{'showProgressBar'}
1208 0 0 if $line =~ /^\s*$/
1209 0 0 if $line =~ /\s*\{\{SUSPENDED\}\}/o
1214 0 0 if (defined $title) { }
1225 0 0 if $l =~ /^\s*$/
1227 0 0 if ($l =~ /PL:\s(.*)$/)
1228 0 0 $plot ne '' ? :
1231 0 0 if ($l =~ /BY:\s(.*)$/ or $l =~ /^(\-\-\-\-\-\-\-\-)/o)
1235 0 0 if ($token eq '--------')
1236 0 0 if ($plot eq '')
1242 0 0 if ($$self{'imdbMovie2DBKey'}{$line}) { }
1246 0 0 if ($count % 50000 == 0)
1257 0 0 if ($token eq '--------')
1263 0 0 if (length $plot)
1267 0 0 if ($$self{'showProgressBar'})
1269 0 0 if ($count > $countEstimate) { }
0 0 elsif ($count > $next_update) { }
1279 0 0 unless ($line =~ /^(---|PL:|BY:)/)
1283 0 0 if ($count > $next_update)
1284 0 0 if ($$self{'showProgressBar'})
1291 0 0 if $$self{'showProgressBar'}
1306 0 0 unless open INFO, "< $file"
1309 0 0 if (s/^([^:]+)://o)
1322 0 0 if (ref $info ne 'HASH')
1338 0 0 if (defined $$self{'dbinfo'}{$key})
1347 0 0 unless open INFO, "> $$self{'moviedbInfo'}"
1360 0 0 unless (defined $$self{'listFiles'}->paths_isset($key))
1364 0 0 unless (-f $filePath)
1371 0 0 if ($filePath =~ /.gz$/)
1372 0 0 if (open my $fd, "gzip -l $filePath |") { }
1377 0 0 if (/^\s*\d+\s+(\d+)/)
1395 0 0 if (defined $file) { }
1396 0 0 unless (open $$self{'logfd'}, "> $file")
1419 0 0 if (-f "$$self{'imdbDir'}/stage-$type.log")
1432 0 0 if ($type eq 'movies')
1442 0 0 unless ($self->_redirect(sprintf("%s/stage-$type.log", $$self{'imdbDir'})))
1446 0 0 unless ($DB->connect)
1470 0 0 unless (grep /^$type$/, $self->listTypes)
1505 0 0 unless (-f $$self{'listFiles'}->paths_index($type))
1510 0 0 if ($type eq 'movies')
1517 0 0 if ($num < 0) { }
0 0 elsif (abs $num - $countEstimate > $countEstimate * 0.1) { }
1518 0 0 if ($num == -2)
1528 0 0 unless open OUT, "> $$self{'imdbDir'}/titles.tsv"
1543 0 0 unless (defined $$self{'imdbMovie2DBKey'})
1547 0 0 unless open IN, "< $$self{'imdbDir'}/titles.tsv"
1550 0 0 if (/^(\d+)\t(.+)/o)
1559 0 0 if ($type eq 'directors')
1566 0 0 if ($num < 0) { }
0 0 elsif (abs $num - $countEstimate > $countEstimate * 0.1) { }
1567 0 0 if ($num == -2)
1584 0 0 if ($type eq 'actors')
1592 0 0 if ($num < 0) { }
0 0 elsif (abs $num - $countEstimate > $countEstimate * 0.1) { }
1593 0 0 if ($num == -2)
1606 0 0 if ($type eq 'actresses')
1610 0 0 if ($num < 0) { }
0 0 elsif (abs $num - $countEstimate > $countEstimate * 0.1) { }
1611 0 0 if ($num == -2)
1628 0 0 if ($type eq 'genres')
1634 0 0 if ($num < 0) { }
0 0 elsif (abs $num - $countEstimate > $countEstimate * 0.1) { }
1635 0 0 if ($num == -2)
1652 0 0 if ($type eq 'ratings')
1658 0 0 if ($num < 0) { }
0 0 elsif (abs $num - $countEstimate > $countEstimate * 0.1) { }
1659 0 0 if ($num == -2)
1676 0 0 if ($type eq 'keywords')
1683 0 0 if ($num < 0) { }
0 0 elsif (abs $num - $countEstimate > $countEstimate * 0.05) { }
1684 0 0 if ($num == -2)
1702 0 0 if ($type eq 'plot')
1707 0 0 if ($num < 0) { }
0 0 elsif (abs $num - $countEstimate > $countEstimate * 0.05) { }
1708 0 0 if ($num == -2)
1746 0 0 if ($self->importListFile($DB, $type) != 0)
1771 0 0 if ($self->importList($type) != 0)
1790 0 0 unless ($DB->connect)
1805 0 0 if ($self->dbinfoSave)
1814 0 0 if (-e "$$self{'moviedbOffline'}")
1818 0 0 if (my $errline = $imdb->sanityCheckDatabase)
1819 0 0 unless open OFF, "> $$self{'moviedbOffline'}"
1825 0 0 if (ref $info eq 'HASH') { }
1836 0 0 unless open OFF, "< $$self{'moviedbOffline'}"