Condition Coverage

blib/lib/MediaWiki/Bot.pm
Criterion Covered Total %
condition 56 160 35.0


and 3 conditions

line !l l&&!r l&&r condition
132 47 0 0 $host =~ m[^(http|https)(://)?] and not $protocol
140 47 0 0 defined $$self{'host'} and $$self{'host'} ne $host
47 0 0 defined $$self{'path'} and $$self{'path'} ne $path
47 0 0 defined $$self{'protocol'} and $$self{'protocol'} ne $protocol
206 0 0 0 $$self{'debug'} > 1 and not $sul_success
261 0 0 0 defined $$res{'login'}{'lgusername'} && defined $$res{'login'}{'result'} && $$res{'login'}{'lgusername'} eq $$self{'username'} && $$res{'login'}{'result'} eq 'Success'
305 0 0 0 $debug > 1 and not $success
404 0 7 0 $$res{'edit'}{'result'} and $$res{'edit'}{'result'} eq 'Failure'
590 4 0 0 length $revisions < 150 and $revisions =~ /\#REDIRECT\s\[\[([^\[\]]+)\]\]/
615 0 2 0 defined $v and $v =~ /\#REDIRECT\s\[\[([^\[\]]+)\]\]/
814 0 0 2 defined $filter and $filter =~ /(all|redirects|nonredirects)/
851 0 0 2 defined $filter and $filter =~ /(all|redirects|nonredirects)/
971 1 0 1 defined $options and $$options{'max'} == '0'
1094 2 0 1 defined $filter and $filter =~ /(all|redirects|nonredirects)/
1142 1 2 0 $cont and $$self{'debug'} > 1
1281 0 3 1 exists $$options{'max'} and $$options{'max'} == 0
1467 0 2 0 exists $$opts{'max'} and $$opts{'max'} == 0
1574 1 0 0 defined $filter and $filter =~ /(all|redirects|nonredirects)/
1578 0 0 1 not defined $ns and $prefix =~ /:/
1843 0 0 0 exists $$token_res{'warnings'} and $$token_res{'warnings'}{'recentchanges'}{'*'} eq q[Action 'patrol' is not allowed for the current user]
1861 0 0 0 $$self{'error'}{'details'} and $$self{'error'}{'details'} =~ /^(?:permissiondenied|badtoken)/
1972 0 0 0 not defined $data and defined $$args{'file'}
2087 0 0 0 defined $error && ref $error eq 'HASH' && exists $$error{'code'} && exists $$error{'details'}
2154 0 0 0 $has_bot and not $is_sysop

or 2 conditions

line l !l condition
73 0 47 $debug || 0
126 0 46 $$self{'protocol'} || 'http'
127 0 1 $$self{'host'} || 'en.wikipedia.org'
128 0 46 $$self{'path'} || 'w'
174 0 1 $_[0]{'do_sul'} || 0
466 5 0 shift() || 'max'
703 2 1 $user || ''
724 1 0 shift() || 'max'
781 2 1 shift() || 0
782 2 1 shift() || 50
1271 2 2 shift() || 'max'
1360 1 0 shift() || 'max'
1456 2 0 shift() || 'max'
1492 3 3 $$self{'sitematrix'}{$w} || undef
1499 0 0 $$self{'sitematrix'}{$wiki} || undef
1516 3 3 $$self{'sitematrix'}{$w} || undef
1522 0 0 $$self{'sitematrix'}{$wiki} || undef
1615 0 2 shift() || 0
1987 0 0 $$self{'api'}->edit({'action', 'upload', 'filename', $filename, 'comment', $$args{'summary'}, 'file', [undef, $filename, 'Content', $data]}) || (return $self->_handle_api_error)
2012 0 0 $$self{'api'}->edit({'action', 'upload', 'filename', $filename, 'comment', $$args{'summary'}, 'url', $url, 'ignorewarnings', 1}) || (return $self->_handle_api_error)
2062 9 0 shift() || 'Main Page'
2063 0 9 shift() || 'edit'
2098 1 0 $self->_whoami || (return $self->_handle_api_error)

or 3 conditions

line l !l&&r !l&&!r condition
140 0 0 47 defined $$self{'host'} and $$self{'host'} ne $host or defined $$self{'path'} and $$self{'path'} ne $path
0 0 47 defined $$self{'host'} and $$self{'host'} ne $host or defined $$self{'path'} and $$self{'path'} ne $path or defined $$self{'protocol'} and $$self{'protocol'} ne $protocol
234 1 0 0 -w $cookies or -w '.'
250 1 0 0 -w $cookies or -w '.'
610 2 0 0 $$expand{$pieces[0]} || $pieces[0]
646 0 0 0 @{$$pageref{'imageinfo'};}[0]->{'thumburl'} || @{$$pageref{'imageinfo'};}[0]->{'url'}
659 1 0 0 shift() || "Reverting to old revision $revid"
675 1 0 0 shift() || croak('No revid given')
676 0 0 1 shift() || "Reverting revision #$revid"
1861 0 0 0 not $res or $$self{'error'}{'details'} and $$self{'error'}{'details'} =~ /^(?:permissiondenied|badtoken)/
1980 0 0 0 defined $$args{'file'} or defined $$args{'title'}
1986 0 0 0 $$args{'title'} || do { require File::Basename; File::Basename::basename($$args{'file'}) }
2008 0 0 0 $$args{'title'} || do { require File::Basename; File::Basename::basename($url) }
2177 30 5 51 exists $$special{'private'} or exists $$special{'fishbowl'}