Condition Coverage

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


and 3 conditions

line !l l&&!r l&&r condition
287 0 0 0 $param{'client_id'} && $param{'secret'}
301 0 0 0 $param{'client_id'} and $param{'secret'}
371 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'}
455 0 0 0 ref $json eq "HASH" and $json->{'json'}
496 0 0 0 ref $result eq "HASH" and exists $result->{'errors'}
506 0 0 0 defined $callback and ref $callback eq "CODE"
828 0 0 0 $param{'include_children'} and $cmt->{'permalink'}
1338 0 0 0 $action and $id
1375 0 0 0 $length != 72 and $length != 168
0 0 0 $length != 72 and $length != 168 and $length != 672
1455 0 0 0 $type ne "t1" and $type ne "t3"
1474 0 0 0 $type ne "t1" and $type ne "t3"
1672 0 0 0 $textcol ne "light" and $textcol ne "dark"
1811 0 0 0 $textcol ne "light" and $textcol ne "dark"
1819 0 0 0 $bg and substr($bg, 0, 1) ne "#"
1905 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'}
2119 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"
2128 0 0 0 $model->{'weighting_scheme'} ne "classic" and $model->{'weighting_scheme'} ne "fresh"

or 2 conditions

line l !l condition
279 0 0 $param{'print_request_errors'} || $param{'request_errors'} || 0
280 0 0 $param{'print_response'} || $param{'print_response_conent'} || 0
281 0 0 $param{'print_request'} || 0
282 0 0 $param{'debug'} || 0
283 0 0 $param{'print_request_on_error'} || 0
284 0 0 $param{'subdomain'} || 'www'
381 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.])
382 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.])
428 0 0 $param{'code'} || die("'code' is required.\n")
429 0 0 $param{'redirect_uri'} || die("'redirect_uri' is required.\n")
430 0 0 ref $self eq 'HASH' && ($self->{'client_id'} ? $self->{'client_id'} : undef) || $param{'client_id'} || die("'client_id' is required.\n")
431 0 0 ref $self eq 'HASH' && ($self->{'secret'} ? $self->{'secret'} : undef) || $param{'secret'} || die(q['secret' is required.])
432 0 0 ref $self eq 'HASH' && ($self->{'user_agent'} ? $self->{'user_agent'} : undef) || $param{'user_agent'} || die(q['user_agent' is required.])
446 0 0 $post_data ||= {}
473 0 0 $param{'args'} || []
538 0 0 $param{'view'} || ''
592 0 0 $param{'limit'} || 25
593 0 0 $param{'mode'} || 'inbox'
594 0 0 $param{'view'} || 'inbox'
603 0 0 $param{'limit'} || 500
725 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")
1070 0 0 $param{'sub'} || $param{'subreddit'} || die("subreddit is required\n")
1073 0 0 $param{'username'} || die("username is required\n")
1193 0 0 $param{'sub'} || $param{'subreddit'} || 'mod'
1194 0 0 $param{'mode'} || 'modqueue'
1243 0 0 $param{'sort'} || 'unread'
1244 0 0 $param{'state'} || 'all'
1308 0 0 fullname($id, 't3') || die("sticky_post: arg 1 (id) is required.\n")
1372 0 0 $length ||= 72
1417 0 0 $param{'view'} || 'overview'
1489 0 0 $param{'subreddit'} || $param{'sub'} || ''
1516 0 0 $param{'subreddit'} || $param{'sub'} || die("expected 'subreddit'\n")
1517 0 0 $param{'title'} || die("Expected 'title'\n")
1518 0 0 $param{'source_id'} || die("Expected 'source_id'\n")
1541 0 0 $param{'subreddit'} || $param{'sub'} || die("expected 'subreddit'\n")
1543 0 0 $param{'text'} || ''
1579 0 0 $param{'link_id'} || $param{'post_id'} || die("flair_post: need 'link_id'\n")
1581 0 0 $param{'sub'} || $param{'subreddit'} || die("flair_post: need 'subreddit'\n")
1606 0 0 $param{'username'} || die("flair_user: need 'link_id'\n")
1609 0 0 $param{'sub'} || $param{'subreddit'} || die("flair_user: need 'subreddit'\n")
1657 0 0 $param{'sub'} || $param{'subreddit'} || die($errmsg)
1658 0 0 $param{'flair_template_id'} || $param{'flair_id'} || die($errmsg)
1689 0 0 $param{'text'} || ''
1706 0 0 $param{'subreddit'} || die($errmsg)
1707 0 0 $param{'username'} || die($errmsg)
1708 0 0 $param{'flair_template_id'} || $param{'flair_id'} || die($errmsg)
1728 0 0 $param{'sub'} || $param{'subreddit'} || die("get_flair_options: 'subreddit' (or alias 'sub') is required.\n")
1760 0 0 shift() || die("get_link_flair_options: Need arg 1 (subreddit)\n")
1770 0 0 shift() || die("get_link_flair_options: Need arg 1 (subreddit)\n")
1780 0 0 shift() || die("get_link_flair_options: Need arg 1 (subreddit)\n")
1790 0 0 shift() || die("get_link_flair_options: Need arg 1 (subreddit)\n")
1801 0 0 $param{'sub'} || $param{'subreddit'} || die("flairtemplate: 'subreddit' (or alias 'sub') is required.\n")
1803 0 0 $param{'flair_template_id'} || $param{'flair_id'} || $param{'id'} || undef
1829 0 0 $param{'flair_type'} || 'LINK_FLAIR'
1852 0 0 $param{'sub'} || $param{'subreddit'} || die("need subreddit\n")
1941 0 0 fullname($param{'link_id'}, 't3') || die("load_more_comments: 'link_id' is required.\n")
1942 0 0 $param{'children'} || die("get_collapsed_comments: 'children' is required.\n")
2094 0 0 $param{'username'} || $self->{'username'} || die(q['username' is required.])
2155 0 0 $param{'user'} || $param{'username'} || $self->{'username'} || die("'username' is required.\n")
2199 0 0 shift() || (return)
2200 0 0 shift() || die(q[fullname: 'type' is required])
2261 0 0 $param{'limit'} || 100

or 3 conditions

line l !l&&r !l&&!r condition
336 0 0 0 not $self->{'last_token'} or $self->{'last_token'} <= time - 3600 + 55
370 0 0 0 $param{'username'} or $param{'password'}
414 0 0 0 !$self->{'last_token'} || $self->{'last_token'} <= time - 3595
482 0 0 0 $API[$api] || croak("Unknown API: $api")
487 0 0 0 $method eq "GET" or $method eq "DELETE"
543 0 0 0 $type eq 'moderator' || $type eq 'contributor' || $type eq 'subscriber'
644 0 0 0 shift() || croak('Argument 1 (subreddit name) is required.')
682 0 0 0 $param{'subreddit'} || $param{'sub'} || croak(q['subreddit' or 'sub' is required.])
685 0 0 0 $param{'q'} || croak(q['q' (search string) is required.])
724 0 0 0 $param{'q'} || croak(q[expected 'q'])
744 0 0 0 $param{'subreddit'} || $param{'sub'}
0 0 0 $param{'subreddit'} or $param{'sub'}
878 0 0 0 shift() || croak("spam: arg 1 (fullname) is required.\n")
910 0 0 0 ispost($fullname) or iscomment($fullname)
1102 0 0 0 iscomment($fullname) or ispost($fullname)
1141 0 0 0 iscomment($fullname) or ispost($fullname)
1174 0 0 0 $param{'sub'} || $param{'subreddit'}
0 0 0 $param{'sub'} or $param{'subreddit'}
1175 0 0 0 $param{'id'} || $param{'fullname'} || croak('fullname (alias id) is required')
1248 0 0 0 $param{'entity'} || $param{'subreddits'} || $param{'subs'}
1275 0 0 0 $param{'body'} || croak('new_modmail_conversation: body is required.')
1281 0 0 0 $param{'subreddit'} || $param{'sub'} || $param{'srName'} || croak(q[new_modmail_conversation: subreddit is required (also accepts aliases 'sub' and 'srName')])
1282 0 0 0 $param{'subject'} || croak('new_modmail_conversation: subject is required')
1290 0 0 0 $param{'to'} || croak('new_modmail_conversation: fullname is required.')
1375 0 0 0 $length == 3 or $length == 7
0 0 0 $length == 3 or $length == 7 or $length == 28
1407 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"
1410 0 0 0 $param{'user'} || $param{'username'} || croak(q[expected 'user'])
1490 0 0 0 $param{'title'} || croak('Expected "title"')
1491 0 0 0 $param{'url'} || croak('Expected "url"')
1542 0 0 0 $param{'title'} || croak('Expected "title"')
1659 0 0 0 $param{'link_id'} || $param{'post_id'}
1662 0 0 0 $post_id || $param{'username'}
1729 0 0 0 $param{'link_id'} || $param{'post_id'}
1730 0 0 0 $param{'user'} || $param{'name'} || $param{'username'}
1851 0 0 0 $param{'page'} || croak(q[Need 'page'])
1874 0 0 0 $param{'page'} || croak(q[Need 'page'])
1878 0 0 0 $param{'sub'} || $param{'subreddit'} || croak(q[Need 'sub' or 'subreddit'])
1903 0 0 0 $param{'sub'} || $param{'subreddit'}
1984 0 0 0 $param{'parent'} || $param{'parent_id'} || croak('Expected "parent"')
1985 0 0 0 $param{'text'} || croak('Expected "text"')
1989 0 0 0 ispost($parent_id) or iscomment($parent_id)
2012 0 0 0 $param{'to'} || croak('Expected "to"')
2013 0 0 0 $param{'subject'} || croak('Expected "subject"')
2014 0 0 0 $param{'text'} || croak('Expected "text"')
2039 0 0 0 ispost($name) or iscomment($name)
2051 0 0 0 shift() || croak('Expected $fullname')
2052 0 0 0 ispost($name) or iscomment($name)
2059 0 0 0 shift() || croak('Expected $fullname')
2060 0 0 0 ispost($name) or iscomment($name)
2067 0 0 0 shift() || croak('Expected $fullname')
2075 0 0 0 shift() || croak('Expected $fullname')
2096 0 0 0 $param{'name'} || croak(q[Expected 'name'.])
2131 0 0 0 $param{'subreddits'} or $param{'subs'}
2132 0 0 0 $param{'subs'} || $param{'subreddits'}
2154 0 0 0 $param{'name'} || croak(q[expected 'name'])
2171 0 0 0 shift() || croak('expected arg 1 (name)')
2257 0 0 0 $param{'show'} or $param{'show_all'}