Branch Coverage

blib/lib/Wiki/Toolkit/Store/Mediawiki.pm
Criterion Covered Total %
branch 0 548 0.0


line true false branch
77 0 0 if $$self{'_charset'} =~ /^utf-?8$/i
78 0 0 if $dbhost
107 0 0 unless $self->_lock_node($node)
109 0 0 unless ($ok)
111 0 0 unless $self->_unlock_node($node)
116 0 0 unless $self->_unlock_node($node)
117 0 0 if $saverr
136 0 0 unless $args{'wikiname'}
140 0 0 if (exists $args{'convert_spaces'}) { }
146 0 0 if $args{'default_date_format'}
149 0 0 if (exists $args{'ignore_case'})
153 0 0 unless exists $args{'charset'}
168 0 0 unless $sth->execute
181 0 0 unless $sth->execute
199 0 0 if $$self{'convert_spaces'}
200 0 0 unless $name =~ /^(?::+)?([^:]+):+([^:].*)$/
201 0 0 if $1 eq 'Media'
202 0 0 if $1 eq 'Special'
203 0 0 if $1 eq $$self{'wikiname'}
206 0 0 if $1 eq $namespaces[$_]
219 0 0 if $$self{'convert_spaces'}
220 0 0 unless $num
221 0 0 if $num == -2
222 0 0 if $num == -1
223 0 0 if $num == 4
224 0 0 unless $num > 0 and $num <= @namespaces
248 0 0 $date ? :
249 0 0 if $$self{'default_date_format'}
254 0 0 if $@
267 0 0 if (ref $_) { }
274 0 0 if wantarray
304 0 0 unless $args{'name'} or $args{'version'}
311 0 0 defined $args{'ignore_case'} ? :
314 0 0 if ($args{'version'}) { }
316 0 0 unless $args{'version'} =~ /^\d+$/
320 0 0 if (wantarray)
324 0 0 unless ($args{'nometadata'})
357 0 0 if (wantarray)
361 0 0 if ($ignore_case)
366 0 0 unless ($args{'nometadata'})
392 0 0 @results ? :
0 0 unless wantarray
395 0 0 unless @results
401 0 0 if $args{'version'}
402 0 0 if ($args{'version'} or $ignore_case) { }
411 0 0 unless $data{'restrictions'}
417 0 0 if ($data{'restrictions'} =~ /.*:.*/) { }
431 0 0 $data{'edit_type'} ? :
0 0 if defined $data{'edit_type'}
434 0 0 unless $args{'nometadata'}
465 0 0 if $args{'metadata_is'} or $args{'metadata_isnt'}
467 0 0 if $args{'metadata_is'}
469 0 0 if $args{'metadata_isnt'}
472 0 0 if $limoffsql
474 0 0 if ($args{'with_details'}) { }
490 0 0 $rc{$$page[1] . $$page[2]} ? :
501 0 0 if (wantarray) { }
514 0 0 unless wantarray
541 0 0 if $args{$option}
543 0 0 if $exclusive > 1
547 0 0 if $args{'days'}
550 0 0 if ($args{'between_days'})
553 0 0 unless @{$args{'between_days'};} == 2
561 0 0 if $args{'since'}
564 0 0 if ($args{'between_secs'})
567 0 0 unless @{$args{'between_secs'};} == 2
573 0 0 if $args{'last_n_changes'}
588 0 0 if ($is) { }
601 0 0 if ($key eq 'edit_type') { }
0 0 elsif ($key eq 'username') { }
0 0 elsif ($key eq 'patrolled') { }
0 0 elsif ($key eq 'namespace') { }
603 0 0 if ($$metadata{$key} eq 'Minor tidying') { }
0 0 elsif ($$metadata{$key} eq 'Normal edit') { }
605 0 0 if ($table_prefix eq 'rc_') { }
0 0 elsif ($table_prefix eq 'rev_') { }
616 0 0 if ($table_prefix eq 'rc_') { }
0 0 elsif ($table_prefix eq 'rev_') { }
632 0 0 $is ? :
639 0 0 if ($table_prefix eq 'rc_') { }
0 0 elsif ($$metadata{$key} and $cmp eq '!=' or not $$metadata{$key} and $cmp eq '=') { }
652 0 0 if (reftype($$metadata{$key}) and reftype($$metadata{$key}) eq 'ARRAY') { }
656 0 0 if grep {not /^\d+$/;} @{$$metadata{$key};}
662 0 0 unless $$metadata{$key} =~ /^\d+$/
683 0 0 if (exists $args{'limit'})
685 0 0 unless defined $args{'limit'} and $args{'limit'} =~ /^\d+$/
688 0 0 if (exists $args{'offset'})
690 0 0 unless defined $args{'offset'} and $args{'offset'} =~ /^\d+$/
694 0 0 unless defined $args{'limit'}
697 0 0 defined $args{'limit'} ? :
0 0 $args{'offset'} ? :
706 0 0 $table_prefix eq 'rev_' ? :
711 0 0 if ($args{'name'})
720 0 0 if $args{'moderation'} == 1
726 0 0 if ($args{'between_secs'})
730 0 0 defined $_ ? :
734 0 0 if $s
736 0 0 if $f
739 0 0 if $metadata_is
741 0 0 if $metadata_isnt
745 0 0 if $args{'hidedelete'}
788 0 0 exists $args{'ignore_case'} ? :
791 0 0 if $args{'name'}
808 0 0 unless ($metadata_is or $metadata_isnt)
810 0 0 if $metadata_was or $metadata_wasnt
829 0 0 if (wantarray) { }
837 0 0 unless $include_all_changes
844 0 0 defined $args{'limit'} ? :
0 0 defined $args{'offset'} ? :
0 0 if (defined $args{'limit'} ? $args{'limit'} : 0) + (defined $args{'offset'} ? $args{'offset'} : 0) > $rcCount
856 0 0 if ($useOld) { }
879 0 0 if wantarray
882 0 0 unless ($include_all_changes)
888 0 0 if wantarray
894 0 0 if (wantarray) { }
917 0 0 if (wantarray)
922 0 0 unless $include_all_changes
930 0 0 if $limoffsql
935 0 0 unless wantarray
945 0 0 $node{'edit_type'} ? :
979 0 0 unless defined $args{'version'} and $args{'version'} =~ /^\d+$/
984 0 0 unless $dbh->do($sql)
1002 0 0 if $args{'name'}
1007 0 0 if $args{'name'} and $args{'id'}
1009 0 0 unless $args{'set'} or $args{'remove'}
1013 0 0 if $args{'id'}
1015 0 0 if $name
1021 0 0 if $args{'set'}{'edit'} eq 'registered'
1023 0 0 if $args{'set'}{'edit'} eq 'sysop'
1026 0 0 if $args{'set'}{'move'} eq 'registered'
1028 0 0 if $args{'set'}{'move'} eq 'sysop'
1030 0 0 if $args{'set'}{'move'} eq 'default'
1034 0 0 $res_string ne '' ? :
1037 0 0 unless $dbh->do($sql)
1041 0 0 if $args{'set'}{'edit'} eq 'default' and $args{'set'}{'edit'} eq 'default'
1091 0 0 if $version and not $version =~ /^\d+$/
1117 0 0 if $version
1121 0 0 unless $dbh->do($sql)
1125 0 0 if $version
1127 0 0 unless $dbh->do($sql)
1130 0 0 if $version
1132 0 0 unless $dbh->do($sql)
1143 0 0 if ($latest)
1153 0 0 unless $dbh->do($sql)
1156 0 0 unless ($latest)
1157 0 0 unless $dbh->do('DELETE FROM pagelinks WHERE pl_from = ' . $pageId)
1159 0 0 unless $dbh->do('DELETE FROM templatelinks WHERE tl_from = ' . $pageId)
1161 0 0 unless $dbh->do('DELETE FROM externallinks WHERE el_from = ' . $pageId)
1198 0 0 if ($args{'revisions'})
1201 0 0 @revisions > 1 ? :
0 0 if @wrong
1226 0 0 unless ($pageId)
1234 0 0 unless $dbh->do($sql)
1252 0 0 if (@revisions > 0) { }
1259 0 0 unless $dbh->do($sql)
1263 0 0 unless $dbh->do($sql)
1284 0 0 unless $dbh->do($sql)
1289 0 0 if (@revisions > 0) { }
1315 0 0 if (wantarray) { }
1327 0 0 if $limoffsql and wantarray
1331 0 0 unless wantarray
1340 0 0 $node{'edit_type'} ? :
1357 0 0 unless defined $ignore_case
1363 0 0 if ($ignore_case)
1367 0 0 if $$self{'_charset'} =~ /^utf-?8$/i
1369 0 0 if $$self{'_charset'} =~ /^ISO-8859-1$/i
1400 0 0 if $args{'type'} eq 'delete'
1401 0 0 if $args{'type'} eq 'protect'
1402 0 0 if $args{'type'} eq 'move'
1405 0 0 $args{'params'} ? :
1412 0 0 unless $dbh->do($sql)
1415 0 0 $args{'param'} eq 'Minor tidying' ? :
1431 0 0 unless $dbh->do($sql)
1441 0 0 unless $version =~ /^\d+$/
1444 0 0 if @_ > 3
1462 0 0 if $direction eq '<'
1528 0 0 if (@_ == 1) { }
1547 0 0 $ver ? :
1565 0 0 if (@_ == 1) { }
1585 0 0 $ver ? :
1596 0 0 unless ref $time
1628 0 0 if ($page_id)
1629 0 0 unless $dbh->do('DELETE FROM pagelinks WHERE pl_from = ' . $page_id)
1631 0 0 unless $dbh->do('DELETE FROM externallinks WHERE el_from = ' . $page_id)
1633 0 0 unless $dbh->do('DELETE FROM templatelinks WHERE tl_from = ' . $page_id)
1642 0 0 unless $_->isa('Wiki::Toolkit::Formatter::Mediawiki::Link')
1643 0 0 if ($$_{'type'} eq 'template') { }
0 0 elsif ($$_{'type'} eq 'external') { }
0 0 elsif ($$_{'type'} eq 'page') { }
1654 0 0 unless my $st1 = $dbh->prepare($sql)
1666 0 0 unless $st1 = $dbh->prepare($sql)
1679 0 0 unless $st1 = $dbh->prepare($sql)
1703 0 0 unless $metadata and $$metadata{'edit_type'}
1707 0 0 unless $links_to_ref
1714 0 0 if ($$metadata{'username'}) { }
1721 0 0 unless my $rec = _utf8_on_array($dbh->selectrow_arrayref($sql))
1741 0 0 unless $dbh->do($sql)
1742 0 0 unless my $new_old_id = $dbh->last_insert_id(undef, undef, undef, undef)
1747 0 0 if ($old_old_id) { }
1755 0 0 unless $page_id = _utf8_on_array($dbh->selectrow_arrayref($sql)->[0])
1766 0 0 unless $dbh->do($sql)
1769 0 0 unless $page_id = $dbh->last_insert_id(undef, undef, undef, undef)
1781 0 0 unless $dbh->do($sql)
1783 0 0 unless $page_id = $dbh->last_insert_id(undef, undef, undef, undef)
1788 0 0 $$metadata{'edit_type'} eq 'Minor tidying' ? :
0 0 defined $old_old_id ? :
0 0 defined $old_old_id ? :
1810 0 0 unless $dbh->do($sql)
1812 0 0 if $$metadata{'auto_patrolled'} eq 'yes' or not $requires_moderation
1816 0 0 $$metadata{'edit_type'} eq 'Minor tidying' ? :
1829 0 0 unless $dbh->do($sql)
1837 0 0 unless grep qr/^\Q$type\E$/, ('comment', 'edit_type', 'formatter', 'username', 'remote_ip')
1843 0 0 unless $args{'plugins'}
1845 0 0 if ($plugin->can('post_write'))
1889 0 0 unless $node
1895 0 0 unless wantarray
1907 0 0 if $limoffsql
1910 0 0 unless $sth->execute
1912 0 0 unless wantarray
1943 0 0 unless $sth->execute
1974 0 0 if (wantarray) { }
1985 0 0 $tail ? :
0 0 if $limoffsql
1990 0 0 if $tail
1993 0 0 unless $sth->execute
1995 0 0 unless wantarray
2026 0 0 if $args{'name'}
2034 0 0 if $args{'id'}
2037 0 0 unless my $usergroups = _utf8_on_array($dbh->selectall_arrayref($sql))
2079 0 0 if ($args{$key})
2082 0 0 $args{'email'} ? :
0 0 $args{'id'} ? :
2090 0 0 unless $count == 1
2096 0 0 if (exists $args{$key})
2098 0 0 unless defined $args{$key}
2102 0 0 if $count > 1
2106 0 0 $args{'fields'} ? :
2109 0 0 if (defined $args{'password'}) { }
0 0 elsif (defined $args{'token'}) { }
0 0 elsif (defined $args{'email_token'}) { }
2126 0 0 unless my $userinfo = _utf8_on_array($dbh->selectall_arrayref($sql))
2130 0 0 unless @$userinfo
2131 0 0 unless @$userinfo == 1
2136 0 0 if (defined $args{'password'}) { }
0 0 elsif (defined $args{'token'}) { }
0 0 elsif (defined $args{'email_token'}) { }
2144 0 0 unless $ep eq $password
2150 0 0 unless $args{'token'} eq $token
2162 0 0 unless $args{'email_token'} eq $token and $now < $expires
2171 0 0 if defined $$userinfo[$i] and $fields[$i] =~ /_(?:touched|expires)$/
2228 0 0 if exists $args{'email_token_expires'} and not ref $args{'email_token_expires'} && $args{'email_token_expires'}->isa('Time::Piece')
2235 0 0 if $args{'create'}
2238 0 0 if (exists $args{$field})
2241 0 0 if (defined $args{$field}) { }
2243 0 0 if ref $args{$field} and $args{$field}->isa('Time::Piece::Adaptive')
2257 0 0 $args{'create'} ? :
0 0 unless $args{'password'} or @fields > ($args{'create'} ? 2 : 1)
2262 0 0 if ($args{'create'}) { }
2270 0 0 if ($args{'id'}) { }
2281 0 0 unless $uid
2290 0 0 unless $dbh->do($sql)
2292 0 0 if ($args{'create'})
2295 0 0 unless $uid = $dbh->last_insert_id(undef, undef, undef, undef)
2299 0 0 if ($args{'password'})
2307 0 0 unless $dbh->do($sql)
2317 0 0 unless $args{'name'}
2318 0 0 unless $args{'password'}
2328 0 0 unless my $userinfo = _utf8_on_array($dbh->selectall_arrayref($sql))
2332 0 0 if @$userinfo
2351 0 0 unless not $args{'name'} && $args{'id'} and $args{'name'} || $args{'id'}
2390 0 0 unless $prefix
2396 0 0 unless my $rows = _utf8_on_array($dbh->selectall_arrayref($sql))
2399 0 0 if @$rows > 1
2401 0 0 unless @$rows == 1