Condition Coverage

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


and 3 conditions

line !l l&&!r l&&r condition
315 0 0 0 $param{'client_id'} && $param{'secret'}
329 0 0 0 $param{'client_id'} and $param{'secret'}
399 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'}
483 0 0 0 ref $json eq 'HASH' and $json->{'json'}
524 0 0 0 ref $result eq 'HASH' and exists $result->{'errors'}
534 0 0 0 defined $callback and ref $callback eq 'CODE'
828 0 0 0 $param{'include_children'} and $cmt->{'permalink'}
1326 0 0 0 $action and $id
1363 0 0 0 $length != 72 and $length != 168
0 0 0 $length != 72 and $length != 168 and $length != 672
1443 0 0 0 $type ne 't1' and $type ne 't3'
1462 0 0 0 $type ne 't1' and $type ne 't3'
1660 0 0 0 $textcol ne 'light' and $textcol ne 'dark'
1799 0 0 0 $textcol ne 'light' and $textcol ne 'dark'
1807 0 0 0 $bg and substr($bg, 0, 1) ne '#'
1893 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'}
2107 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'
2116 0 0 0 $model->{'weighting_scheme'} ne 'classic' and $model->{'weighting_scheme'} ne 'fresh'

or 2 conditions

line l !l condition
307 0 0 $param{'print_request_errors'} || $param{'request_errors'} || 0
308 0 0 $param{'print_response'} || $param{'print_response_conent'} || 0
309 0 0 $param{'print_request'} || 0
310 0 0 $param{'debug'} || 0
311 0 0 $param{'print_request_on_error'} || 0
312 0 0 $param{'subdomain'} || 'www'
409 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.])
410 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.])
456 0 0 $param{'code'} || die("'code' is required.\n")
457 0 0 $param{'redirect_uri'} || die("'redirect_uri' is required.\n")
458 0 0 ref $self eq 'HASH' && ($self->{'client_id'} ? $self->{'client_id'} : undef) || $param{'client_id'} || die("'client_id' is required.\n")
459 0 0 ref $self eq 'HASH' && ($self->{'secret'} ? $self->{'secret'} : undef) || $param{'secret'} || die(q['secret' is required.])
460 0 0 ref $self eq 'HASH' && ($self->{'user_agent'} ? $self->{'user_agent'} : undef) || $param{'user_agent'} || die(q['user_agent' is required.])
474 0 0 $post_data ||= {}
501 0 0 $param{'args'} || []
566 0 0 $param{'view'} || ''
620 0 0 $param{'limit'} || 25
621 0 0 $param{'mode'} || 'inbox'
622 0 0 $param{'view'} || 'inbox'
631 0 0 $param{'limit'} || 500
753 0 0 $param{'sort'} || 'relevance'
766 0 0 $param{'sub'} || $param{'subreddit'} || ''
767 0 0 $param{'view'} || ''
837 0 0 $param{'sub'} || $param{'subreddit'} || ''
838 0 0 $param{'view'} || ''
843 0 0 $param{'limit'} || 500
867 0 0 shift() || die("remove: arg 1 (fullname) is required.\n")
888 0 0 shift() || die("approve: arg 1 (fullname) is required.\n")
898 0 0 shift() || die("ignore_reports: arg 1 (fullname) is required.\n")
960 0 0 $param{'sub'} || $param{'subreddit'} || die("subreddit is required\n")
963 0 0 $param{'user'} || $param{'username'} || die("username is required\n")
1036 0 0 $user || die("approve_user: arg 1 (username) is required.\n")
1037 0 0 $sub || die("approve_user: arg 2 (sub) is required.\n")
1060 0 0 $param{'sub'} || $param{'subreddit'} || die("subreddit is required\n")
1063 0 0 $param{'username'} || die("username is required\n")
1181 0 0 $param{'sub'} || $param{'subreddit'} || 'mod'
1182 0 0 $param{'mode'} || 'modqueue'
1231 0 0 $param{'sort'} || 'unread'
1232 0 0 $param{'state'} || 'all'
1296 0 0 fullname($id, 't3') || die("sticky_post: arg 1 (id) is required.\n")
1360 0 0 $length ||= 72
1405 0 0 $param{'view'} || 'overview'
1477 0 0 $param{'subreddit'} || $param{'sub'} || ''
1504 0 0 $param{'subreddit'} || $param{'sub'} || die("expected 'subreddit'\n")
1505 0 0 $param{'title'} || die("Expected 'title'\n")
1506 0 0 $param{'source_id'} || die("Expected 'source_id'\n")
1529 0 0 $param{'subreddit'} || $param{'sub'} || die("expected 'subreddit'\n")
1531 0 0 $param{'text'} || ''
1567 0 0 $param{'link_id'} || $param{'post_id'} || die("flair_post: need 'link_id'\n")
1569 0 0 $param{'sub'} || $param{'subreddit'} || die("flair_post: need 'subreddit'\n")
1594 0 0 $param{'username'} || die("flair_user: need 'link_id'\n")
1597 0 0 $param{'sub'} || $param{'subreddit'} || die("flair_user: need 'subreddit'\n")
1645 0 0 $param{'sub'} || $param{'subreddit'} || die($errmsg)
1646 0 0 $param{'flair_template_id'} || $param{'flair_id'} || die($errmsg)
1677 0 0 $param{'text'} || ''
1694 0 0 $param{'subreddit'} || die($errmsg)
1695 0 0 $param{'username'} || die($errmsg)
1696 0 0 $param{'flair_template_id'} || $param{'flair_id'} || die($errmsg)
1716 0 0 $param{'sub'} || $param{'subreddit'} || die("get_flair_options: 'subreddit' (or alias 'sub') is required.\n")
1748 0 0 shift() || die("get_link_flair_options: Need arg 1 (subreddit)\n")
1758 0 0 shift() || die("get_link_flair_options: Need arg 1 (subreddit)\n")
1768 0 0 shift() || die("get_link_flair_options: Need arg 1 (subreddit)\n")
1778 0 0 shift() || die("get_link_flair_options: Need arg 1 (subreddit)\n")
1789 0 0 $param{'sub'} || $param{'subreddit'} || die("flairtemplate: 'subreddit' (or alias 'sub') is required.\n")
1791 0 0 $param{'flair_template_id'} || $param{'flair_id'} || $param{'id'} || undef
1817 0 0 $param{'flair_type'} || 'LINK_FLAIR'
1840 0 0 $param{'sub'} || $param{'subreddit'} || die("need subreddit\n")
1929 0 0 fullname($param{'link_id'}, 't3') || die("load_more_comments: 'link_id' is required.\n")
1930 0 0 $param{'children'} || die("get_collapsed_comments: 'children' is required.\n")
2082 0 0 $param{'username'} || $self->{'username'} || die(q['username' is required.])
2143 0 0 $param{'user'} || $param{'username'} || $self->{'username'} || die("'username' is required.\n")
2187 0 0 shift() || (return)
2188 0 0 shift() || die(q[fullname: 'type' is required])
2249 0 0 $param{'limit'} || 100

or 3 conditions

line l !l&&r !l&&!r condition
364 0 0 0 not $self->{'last_token'} or $self->{'last_token'} <= time - 3600 + 55
398 0 0 0 $param{'username'} or $param{'password'}
442 0 0 0 !$self->{'last_token'} || $self->{'last_token'} <= time - 3595
510 0 0 0 $API[$api] || croak("Unknown API: $api")
515 0 0 0 $method eq 'GET' or $method eq 'DELETE'
571 0 0 0 $type eq 'moderator' || $type eq 'contributor' || $type eq 'subscriber'
672 0 0 0 shift() || croak('Argument 1 (subreddit name) is required.')
710 0 0 0 $param{'subreddit'} || $param{'sub'} || croak(q['subreddit' or 'sub' is required.])
713 0 0 0 $param{'q'} || croak(q['q' (search string) is required.])
752 0 0 0 $param{'q'} || croak(q[expected 'q'])
878 0 0 0 shift() || croak("spam: arg 1 (fullname) is required.\n")
910 0 0 0 ispost($fullname) or iscomment($fullname)
1090 0 0 0 iscomment($fullname) or ispost($fullname)
1129 0 0 0 iscomment($fullname) or ispost($fullname)
1162 0 0 0 $param{'sub'} || $param{'subreddit'}
0 0 0 $param{'sub'} or $param{'subreddit'}
1163 0 0 0 $param{'id'} || $param{'fullname'} || croak('fullname (alias id) is required')
1236 0 0 0 $param{'entity'} || $param{'subreddits'} || $param{'subs'}
1263 0 0 0 $param{'body'} || croak('new_modmail_conversation: body is required.')
1269 0 0 0 $param{'subreddit'} || $param{'sub'} || $param{'srName'} || croak(q[new_modmail_conversation: subreddit is required (also accepts aliases 'sub' and 'srName')])
1270 0 0 0 $param{'subject'} || croak('new_modmail_conversation: subject is required')
1278 0 0 0 $param{'to'} || croak('new_modmail_conversation: fullname is required.')
1363 0 0 0 $length == 3 or $length == 7
0 0 0 $length == 3 or $length == 7 or $length == 28
1395 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'
1398 0 0 0 $param{'user'} || $param{'username'} || croak(q[expected 'user'])
1478 0 0 0 $param{'title'} || croak('Expected "title"')
1479 0 0 0 $param{'url'} || croak('Expected "url"')
1530 0 0 0 $param{'title'} || croak('Expected "title"')
1647 0 0 0 $param{'link_id'} || $param{'post_id'}
1650 0 0 0 $post_id || $param{'username'}
1717 0 0 0 $param{'link_id'} || $param{'post_id'}
1839 0 0 0 $param{'page'} || croak(q[Need 'page'])
1862 0 0 0 $param{'page'} || croak(q[Need 'page'])
1866 0 0 0 $param{'sub'} || $param{'subreddit'} || croak(q[Need 'sub' or 'subreddit'])
1891 0 0 0 $param{'sub'} || $param{'subreddit'}
1972 0 0 0 $param{'parent'} || $param{'parent_id'} || croak('Expected "parent"')
1973 0 0 0 $param{'text'} || croak('Expected "text"')
1977 0 0 0 ispost($parent_id) or iscomment($parent_id)
2000 0 0 0 $param{'to'} || croak('Expected "to"')
2001 0 0 0 $param{'subject'} || croak('Expected "subject"')
2002 0 0 0 $param{'text'} || croak('Expected "text"')
2027 0 0 0 ispost($name) or iscomment($name)
2039 0 0 0 shift() || croak('Expected $fullname')
2040 0 0 0 ispost($name) or iscomment($name)
2047 0 0 0 shift() || croak('Expected $fullname')
2048 0 0 0 ispost($name) or iscomment($name)
2055 0 0 0 shift() || croak('Expected $fullname')
2063 0 0 0 shift() || croak('Expected $fullname')
2084 0 0 0 $param{'name'} || croak(q[Expected 'name'.])
2119 0 0 0 $param{'subreddits'} or $param{'subs'}
2120 0 0 0 $param{'subs'} || $param{'subreddits'}
2142 0 0 0 $param{'name'} || croak(q[expected 'name'])
2159 0 0 0 shift() || croak('expected arg 1 (name)')
2245 0 0 0 $param{'show'} or $param{'show_all'}