Condition Coverage

blib/lib/Reddit/Client.pm
Criterion Covered Total %
condition 0 391 0.0


and 3 conditions

line !l l&&!r l&&r condition
318 0 0 0 $param{'client_id'} && $param{'secret'}
332 0 0 0 $param{'client_id'} and $param{'secret'}
402 0 0 0 $param{'username'} and $param{'password'}
0 0 0 $param{'username'} and $param{'password'} and $param{'client_id'}
0 0 0 $param{'username'} and $param{'password'} and $param{'client_id'} and $param{'secret'}
486 0 0 0 ref $json eq 'HASH' and $json->{'json'}
527 0 0 0 ref $result eq 'HASH' and exists $result->{'errors'}
537 0 0 0 defined $callback and ref $callback eq 'CODE'
831 0 0 0 $param{'include_children'} and $cmt->{'permalink'}
1329 0 0 0 $action and $id
1366 0 0 0 $length != 72 and $length != 168
0 0 0 $length != 72 and $length != 168 and $length != 672
1446 0 0 0 $type ne 't1' and $type ne 't3'
1465 0 0 0 $type ne 't1' and $type ne 't3'
1663 0 0 0 $textcol ne 'light' and $textcol ne 'dark'
1802 0 0 0 $textcol ne 'light' and $textcol ne 'dark'
1810 0 0 0 $bg and substr($bg, 0, 1) ne '#'
1896 0 0 0 $sub and $param{'comment_id'}
0 0 0 $sub and $param{'comment_id'} and $param{'link_id'}
0 0 0 $sub and $param{'id'}
2110 0 0 0 $model->{'visibility'} ne 'private' and $model->{'visibility'} ne 'public'
0 0 0 $model->{'visibility'} ne 'private' and $model->{'visibility'} ne 'public' and $model->{'visibility'} ne 'hidden'
2119 0 0 0 $model->{'weighting_scheme'} ne 'classic' and $model->{'weighting_scheme'} ne 'fresh'

or 2 conditions

line l !l condition
310 0 0 $param{'print_request_errors'} || $param{'request_errors'} || 0
311 0 0 $param{'print_response'} || $param{'print_response_conent'} || 0
312 0 0 $param{'print_request'} || 0
313 0 0 $param{'debug'} || 0
314 0 0 $param{'print_request_on_error'} || 0
315 0 0 $param{'subdomain'} || 'www'
412 0 0 $param{'client_id'} || $self->{'client_id'} || die(q[get_token: 'client_id' must be set, either as a parameter to get_token or when instantiating the Reddit::Client object.])
413 0 0 $param{'secret'} || $self->{'secret'} || die(q[get_token: 'secret' must be set, either as a parameter to get_token or when instantiating the Reddit::Client object.])
459 0 0 $param{'code'} || die("'code' is required.\n")
460 0 0 $param{'redirect_uri'} || die("'redirect_uri' is required.\n")
461 0 0 ref $self eq 'HASH' && ($self->{'client_id'} ? $self->{'client_id'} : undef) || $param{'client_id'} || die("'client_id' is required.\n")
462 0 0 ref $self eq 'HASH' && ($self->{'secret'} ? $self->{'secret'} : undef) || $param{'secret'} || die(q['secret' is required.])
463 0 0 ref $self eq 'HASH' && ($self->{'user_agent'} ? $self->{'user_agent'} : undef) || $param{'user_agent'} || die(q['user_agent' is required.])
477 0 0 $post_data ||= {}
504 0 0 $param{'args'} || []
569 0 0 $param{'view'} || ''
623 0 0 $param{'limit'} || 25
624 0 0 $param{'mode'} || 'inbox'
625 0 0 $param{'view'} || 'inbox'
634 0 0 $param{'limit'} || 500
756 0 0 $param{'sort'} || 'relevance'
769 0 0 $param{'sub'} || $param{'subreddit'} || ''
770 0 0 $param{'view'} || ''
840 0 0 $param{'sub'} || $param{'subreddit'} || ''
841 0 0 $param{'view'} || ''
846 0 0 $param{'limit'} || 500
870 0 0 shift() || die("remove: arg 1 (fullname) is required.\n")
891 0 0 shift() || die("approve: arg 1 (fullname) is required.\n")
901 0 0 shift() || die("ignore_reports: arg 1 (fullname) is required.\n")
963 0 0 $param{'sub'} || $param{'subreddit'} || die("subreddit is required\n")
966 0 0 $param{'user'} || $param{'username'} || die("username is required\n")
1039 0 0 $user || die("approve_user: arg 1 (username) is required.\n")
1040 0 0 $sub || die("approve_user: arg 2 (sub) is required.\n")
1063 0 0 $param{'sub'} || $param{'subreddit'} || die("subreddit is required\n")
1066 0 0 $param{'username'} || die("username is required\n")
1184 0 0 $param{'sub'} || $param{'subreddit'} || 'mod'
1185 0 0 $param{'mode'} || 'modqueue'
1234 0 0 $param{'sort'} || 'unread'
1235 0 0 $param{'state'} || 'all'
1299 0 0 fullname($id, 't3') || die("sticky_post: arg 1 (id) is required.\n")
1363 0 0 $length ||= 72
1408 0 0 $param{'view'} || 'overview'
1480 0 0 $param{'subreddit'} || $param{'sub'} || ''
1507 0 0 $param{'subreddit'} || $param{'sub'} || die("expected 'subreddit'\n")
1508 0 0 $param{'title'} || die("Expected 'title'\n")
1509 0 0 $param{'source_id'} || die("Expected 'source_id'\n")
1532 0 0 $param{'subreddit'} || $param{'sub'} || die("expected 'subreddit'\n")
1534 0 0 $param{'text'} || ''
1570 0 0 $param{'link_id'} || $param{'post_id'} || die("flair_post: need 'link_id'\n")
1572 0 0 $param{'sub'} || $param{'subreddit'} || die("flair_post: need 'subreddit'\n")
1597 0 0 $param{'username'} || die("flair_user: need 'link_id'\n")
1600 0 0 $param{'sub'} || $param{'subreddit'} || die("flair_user: need 'subreddit'\n")
1648 0 0 $param{'sub'} || $param{'subreddit'} || die($errmsg)
1649 0 0 $param{'flair_template_id'} || $param{'flair_id'} || die($errmsg)
1680 0 0 $param{'text'} || ''
1697 0 0 $param{'subreddit'} || die($errmsg)
1698 0 0 $param{'username'} || die($errmsg)
1699 0 0 $param{'flair_template_id'} || $param{'flair_id'} || die($errmsg)
1719 0 0 $param{'sub'} || $param{'subreddit'} || die("get_flair_options: 'subreddit' (or alias 'sub') is required.\n")
1751 0 0 shift() || die("get_link_flair_options: Need arg 1 (subreddit)\n")
1761 0 0 shift() || die("get_link_flair_options: Need arg 1 (subreddit)\n")
1771 0 0 shift() || die("get_link_flair_options: Need arg 1 (subreddit)\n")
1781 0 0 shift() || die("get_link_flair_options: Need arg 1 (subreddit)\n")
1792 0 0 $param{'sub'} || $param{'subreddit'} || die("flairtemplate: 'subreddit' (or alias 'sub') is required.\n")
1794 0 0 $param{'flair_template_id'} || $param{'flair_id'} || $param{'id'} || undef
1820 0 0 $param{'flair_type'} || 'LINK_FLAIR'
1843 0 0 $param{'sub'} || $param{'subreddit'} || die("need subreddit\n")
1932 0 0 fullname($param{'link_id'}, 't3') || die("load_more_comments: 'link_id' is required.\n")
1933 0 0 $param{'children'} || die("get_collapsed_comments: 'children' is required.\n")
2085 0 0 $param{'username'} || $self->{'username'} || die(q['username' is required.])
2146 0 0 $param{'user'} || $param{'username'} || $self->{'username'} || die("'username' is required.\n")
2190 0 0 shift() || (return)
2191 0 0 shift() || die(q[fullname: 'type' is required])
2252 0 0 $param{'limit'} || 100

or 3 conditions

line l !l&&r !l&&!r condition
367 0 0 0 not $self->{'last_token'} or $self->{'last_token'} <= time - 3600 + 55
401 0 0 0 $param{'username'} or $param{'password'}
445 0 0 0 !$self->{'last_token'} || $self->{'last_token'} <= time - 3595
513 0 0 0 $API[$api] || croak("Unknown API: $api")
518 0 0 0 $method eq 'GET' or $method eq 'DELETE'
574 0 0 0 $type eq 'moderator' || $type eq 'contributor' || $type eq 'subscriber'
675 0 0 0 shift() || croak('Argument 1 (subreddit name) is required.')
713 0 0 0 $param{'subreddit'} || $param{'sub'} || croak(q['subreddit' or 'sub' is required.])
716 0 0 0 $param{'q'} || croak(q['q' (search string) is required.])
755 0 0 0 $param{'q'} || croak(q[expected 'q'])
881 0 0 0 shift() || croak("spam: arg 1 (fullname) is required.\n")
913 0 0 0 ispost($fullname) or iscomment($fullname)
1093 0 0 0 iscomment($fullname) or ispost($fullname)
1132 0 0 0 iscomment($fullname) or ispost($fullname)
1165 0 0 0 $param{'sub'} || $param{'subreddit'}
0 0 0 $param{'sub'} or $param{'subreddit'}
1166 0 0 0 $param{'id'} || $param{'fullname'} || croak('fullname (alias id) is required')
1239 0 0 0 $param{'entity'} || $param{'subreddits'} || $param{'subs'}
1266 0 0 0 $param{'body'} || croak('new_modmail_conversation: body is required.')
1272 0 0 0 $param{'subreddit'} || $param{'sub'} || $param{'srName'} || croak(q[new_modmail_conversation: subreddit is required (also accepts aliases 'sub' and 'srName')])
1273 0 0 0 $param{'subject'} || croak('new_modmail_conversation: subject is required')
1281 0 0 0 $param{'to'} || croak('new_modmail_conversation: fullname is required.')
1366 0 0 0 $length == 3 or $length == 7
0 0 0 $length == 3 or $length == 7 or $length == 28
1398 0 0 0 not $odd or $_[0] eq 'user'
0 0 0 not $odd or $_[0] eq 'user' or $_[0] eq 'username'
0 0 0 not $odd or $_[0] eq 'user' or $_[0] eq 'username' or $_[0] eq 'view'
1401 0 0 0 $param{'user'} || $param{'username'} || croak(q[expected 'user'])
1481 0 0 0 $param{'title'} || croak('Expected "title"')
1482 0 0 0 $param{'url'} || croak('Expected "url"')
1533 0 0 0 $param{'title'} || croak('Expected "title"')
1650 0 0 0 $param{'link_id'} || $param{'post_id'}
1653 0 0 0 $post_id || $param{'username'}
1720 0 0 0 $param{'link_id'} || $param{'post_id'}
1721 0 0 0 $param{'user'} || $param{'name'} || $param{'username'}
1842 0 0 0 $param{'page'} || croak(q[Need 'page'])
1865 0 0 0 $param{'page'} || croak(q[Need 'page'])
1869 0 0 0 $param{'sub'} || $param{'subreddit'} || croak(q[Need 'sub' or 'subreddit'])
1894 0 0 0 $param{'sub'} || $param{'subreddit'}
1975 0 0 0 $param{'parent'} || $param{'parent_id'} || croak('Expected "parent"')
1976 0 0 0 $param{'text'} || croak('Expected "text"')
1980 0 0 0 ispost($parent_id) or iscomment($parent_id)
2003 0 0 0 $param{'to'} || croak('Expected "to"')
2004 0 0 0 $param{'subject'} || croak('Expected "subject"')
2005 0 0 0 $param{'text'} || croak('Expected "text"')
2030 0 0 0 ispost($name) or iscomment($name)
2042 0 0 0 shift() || croak('Expected $fullname')
2043 0 0 0 ispost($name) or iscomment($name)
2050 0 0 0 shift() || croak('Expected $fullname')
2051 0 0 0 ispost($name) or iscomment($name)
2058 0 0 0 shift() || croak('Expected $fullname')
2066 0 0 0 shift() || croak('Expected $fullname')
2087 0 0 0 $param{'name'} || croak(q[Expected 'name'.])
2122 0 0 0 $param{'subreddits'} or $param{'subs'}
2123 0 0 0 $param{'subs'} || $param{'subreddits'}
2145 0 0 0 $param{'name'} || croak(q[expected 'name'])
2162 0 0 0 shift() || croak('expected arg 1 (name)')
2248 0 0 0 $param{'show'} or $param{'show_all'}