Condition Coverage

blib/lib/MediaWiki/Bot.pm
Criterion Covered Total %
condition 65 172 37.7


and 3 conditions

line !l l&&!r l&&r condition
66 44 0 3 not $agent and $operator
144 47 0 0 $host =~ m[^(http|https)(://)?] and not $protocol
152 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
218 0 0 0 $$self{'debug'} > 1 and not $sul_success
273 0 0 0 defined $$res{'login'}{'lgusername'} && defined $$res{'login'}{'result'} && $$res{'login'}{'lgusername'} eq $$self{'username'} && $$res{'login'}{'result'} eq 'Success'
317 0 0 0 $debug > 1 and not $success
392 8 0 0 defined $captcha_id and not defined $captcha_solution
8 0 0 defined $captcha_solution and not defined $captcha_id
427 0 6 1 $$res{'edit'}{'result'} and $$res{'edit'}{'result'} eq 'Failure'
587 4 0 0 length $revisions < 150 and $revisions =~ /\#REDIRECT\s\[\[([^\[\]]+)\]\]/
612 0 2 0 defined $v and $v =~ /\#REDIRECT\s\[\[([^\[\]]+)\]\]/
812 0 0 2 defined $filter and $filter =~ /(all|redirects|nonredirects)/
849 0 0 2 defined $filter and $filter =~ /(all|redirects|nonredirects)/
965 1 0 1 defined $options and $$options{'max'} == '0'
1079 2 0 1 defined $filter and $filter =~ /(all|redirects|nonredirects)/
1122 1 2 0 $cont and $$self{'debug'} > 1
1261 0 3 1 exists $$options{'max'} and $$options{'max'} == 0
1443 0 2 0 exists $$opts{'max'} and $$opts{'max'} == 0
1546 1 0 0 defined $filter and $filter =~ /(all|redirects|nonredirects)/
1550 0 0 1 not defined $ns and $prefix =~ /:/
1804 0 0 0 $$self{'error'}{'details'} and $$self{'error'}{'details'} =~ /^(?:permissiondenied|badtoken)/
1913 0 0 0 not defined $data and defined $$args{'file'}
2033 0 0 1 defined $error && ref $error eq 'HASH' && exists $$error{'code'} && exists $$error{'details'}
2100 0 0 0 $has_bot and not $is_sysop

or 2 conditions

line l !l condition
85 0 47 $debug || 0
138 0 46 $$self{'protocol'} || 'http'
139 0 1 $$self{'host'} || 'en.wikipedia.org'
140 0 46 $$self{'path'} || 'w'
186 0 1 $_[0]{'do_sul'} || 0
471 5 0 shift() || 'max'
700 2 1 $user || ''
721 1 0 shift() || 'max'
779 2 1 shift() || 0
780 2 1 shift() || 50
1251 2 2 shift() || 'max'
1340 1 0 shift() || 'max'
1432 2 0 shift() || 'max'
1464 3 3 $$self{'sitematrix'}{$w} || undef
1471 0 0 $$self{'sitematrix'}{$wiki} || undef
1488 3 3 $$self{'sitematrix'}{$w} || undef
1494 0 0 $$self{'sitematrix'}{$wiki} || undef
1583 0 2 shift() || 0
1928 0 0 $$self{'api'}->edit({'action', 'upload', 'filename', $filename, 'comment', $$args{'summary'}, 'file', [undef, $filename, 'Content', $data]}) || (return $self->_handle_api_error)
1953 0 0 $$self{'api'}->edit({'action', 'upload', 'filename', $filename, 'comment', $$args{'summary'}, 'url', $url, 'ignorewarnings', 1}) || (return $self->_handle_api_error)
2003 9 0 shift() || 'Main Page'
2004 0 9 shift() || 'csrf'
2044 1 0 $self->_whoami || (return $self->_handle_api_error)

or 3 conditions

line l !l&&r !l&&!r condition
66 44 3 0 $agent || $operator
152 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
246 1 0 0 -w $cookies or -w '.'
262 1 0 0 -w $cookies or -w '.'
392 0 0 8 defined $captcha_id and not defined $captcha_solution or defined $captcha_solution and not defined $captcha_id
607 2 0 0 $$expand{$pieces[0]} || $pieces[0]
643 0 0 0 @{$$pageref{'imageinfo'};}[0]->{'thumburl'} || @{$$pageref{'imageinfo'};}[0]->{'url'}
656 1 0 0 shift() || "Reverting to old revision $revid"
672 1 0 0 shift() || croak('No revid given')
673 0 0 1 shift() || "Reverting revision #$revid"
1804 0 0 0 not $res or $$self{'error'}{'details'} and $$self{'error'}{'details'} =~ /^(?:permissiondenied|badtoken)/
1921 0 0 0 defined $$args{'file'} or defined $$args{'title'}
1927 0 0 0 $$args{'title'} || do { require File::Basename; File::Basename::basename($$args{'file'}) }
1949 0 0 0 $$args{'title'} || do { require File::Basename; File::Basename::basename($url) }
2123 30 6 51 exists $$special{'private'} or exists $$special{'fishbowl'}