Branch Coverage

blib/lib/Mojo/Weixin/Message/Handle.pm
Criterion Covered Total %
branch 0 282 0.0


line true false branch
21 0 0 if $self->is_stop
22 0 0 if ($msg->class eq 'recv') { }
0 0 elsif ($msg->class eq 'send') { }
23 0 0 if ($msg->format eq 'media') { }
24 0 0 if ($self->download_media) { }
27 0 0 if ($msg->media_size == 0 and $msg->media_type eq 'emoticon') { }
44 0 0 if ($msg->source ne 'local')
46 0 0 if ($msg->format eq 'media') { }
47 0 0 if ($self->download_media) { }
50 0 0 if ($msg->media_size == 0 and $msg->media_type eq 'emoticon') { }
56 0 0 if ref $msg->cb eq 'CODE'
62 0 0 if ref $msg->cb eq 'CODE'
67 0 0 if ref $msg->cb eq 'CODE'
73 0 0 if ($msg->ttl <= 0)
76 0 0 if (ref $msg->cb eq 'CODE')
92 0 0 if (defined $Mojo::Weixin::Message::LAST_DISPATCH_TIME)
93 0 0 $now < $Mojo::Weixin::Message::LAST_DISPATCH_TIME + $Mojo::Weixin::Message::SEND_INTERVAL ? :
99 0 0 if ($msg->format eq 'text') { }
0 0 elsif ($msg->format eq 'media') { }
114 0 0 if (defined $retcode and defined $selector)
115 0 0 if ($retcode == 0 and $selector != 0) { }
0 0 elsif ($retcode == 0 and $selector == 0) { }
0 0 elsif ($retcode == 1101 and $self->stop_with_mobile) { }
0 0 elsif (&first(sub { $retcode == $_; } , @logout_code)) { }
0 0 elsif ($self->_synccheck_error_count <= 10) { }
142 0 0 unless defined $json
144 0 0 if ($json->{'BaseResponse'}{'Ret'} == 1101) { }
0 0 elsif (&first(sub { $json->{'BaseResponse'}{'Ret'} == $_; } , @logout_code)) { }
0 0 elsif ($json->{'BaseResponse'}{'Ret'} != 0) { }
158 0 0 if $json->{'SyncKey'}{'Count'} != 0
159 0 0 if $json->{'SyncCheckKey'}{'Count'} != 0
160 0 0 if $json->{'SKey'}
164 0 0 if ($json->{'ModContactCount'} != 0)
166 0 0 if ($self->is_group_id($e->{'UserName'})) { }
171 0 0 if ($e->{'MemberCount'} != 0)
181 0 0 if (not defined $g) { }
182 0 0 unless ($self->update_group($group->{'id'}, 1))
193 0 0 if defined $$e{$Mojo::Weixin::KEY_MAP_FRIEND{$_}}
196 0 0 if (not defined $f) { }
204 0 0 if ($json->{'ModChatRoomMemberCount'} != 0)
208 0 0 if ($json->{'DelContactCount'} != 0)
210 0 0 if ($self->is_group_id($e->{'UserName'})) { }
212 0 0 if defined $g
216 0 0 if defined $f
222 0 0 if ($json->{'AddMsgCount'} != 0)
228 0 0 if ($e->{'MsgType'} == 1) { }
0 0 elsif ($e->{'MsgType'} == 3) { }
0 0 elsif ($e->{'MsgType'} == 47) { }
0 0 elsif ($e->{'MsgType'} == 62) { }
0 0 elsif ($e->{'MsgType'} == 43) { }
0 0 elsif ($e->{'MsgType'} == 34) { }
0 0 elsif ($e->{'MsgType'} == 37) { }
0 0 elsif ($e->{'MsgType'} == 10000) { }
0 0 elsif ($e->{'MsgType'} == 10002) { }
0 0 elsif ($e->{'MsgType'} == 49 and $e->{'AppMsgType'} == 6) { }
0 0 elsif ($e->{'MsgType'} == 49 and $e->{'AppMsgType'} == 5) { }
0 0 elsif ($e->{'MsgType'} == 49 and $e->{'AppMsgType'} == 2000) { }
0 0 elsif ($e->{'MsgType'} == 42) { }
0 0 elsif ($e->{'MsgType'} == 51) { }
310 0 0 if ($e->{'StatusNotifyCode'} == 4 or $e->{'StatusNotifyCode'} == 2)
315 0 0 if $_ eq $self->user->id
316 0 0 unless $self->search_group('id', $_)
0 0 if ($self->is_group_id($_)) { }
317 0 0 unless $self->search_friend('id', $_)
319 0 0 if @group_ids
320 0 0 if @friend_ids
325 0 0 if ($e->{'FromUserName'} eq $self->user->id) { }
329 0 0 if ($self->is_group_id($e->{'ToUserName'})) { }
343 0 0 if ($self->is_group_id($e->{'FromUserName'})) { }
345 0 0 if ($e->{'MsgType'} == 10000) { }
0 0 elsif ($msg->{'content'} =~ m[^(\@.+?):
(.*)$]s) { }
350 0 0 if (defined $member_id and defined $content)
361 0 0 if ($msg->{'format'} eq 'media') { }
0 0 elsif (defined $msg->{'content'}) { }
362 0 0 if $msg->{'media_type'} eq 'image'
363 0 0 if $msg->{'media_type'} eq 'voice'
364 0 0 if $msg->{'media_type'} eq 'video'
365 0 0 if $msg->{'media_type'} eq 'microvideo'
366 0 0 if $msg->{'media_type'} eq 'emoticon'
367 0 0 if $msg->{'media_type'} eq 'file'
371 0 0 if $@
373 0 0 if ($msg->{'format'} eq 'app') { }
0 0 elsif ($msg->{'format'} eq 'revoke') { }
0 0 elsif ($msg->{'format'} eq 'card') { }
0 0 elsif ($msg->{'format'} eq 'payment') { }
378 0 0 if ($dom->at('msg > appmsg > type')->content != 5)
393 0 0 if ($@)
394 0 0 if $@
403 0 0 if $dom->at('sysmsg')->attr->{'type'} ne 'revokemsg'
410 0 0 if ($msg->{'content'} eq "\344\275\240\346\222\244\345\233\236\344\272\206\344\270\200\346\235\241\346\266\210\346\201\257" and $msg->{'class'} eq 'recv')
413 0 0 if ($msg->{'type'} eq 'group_message') { }
0 0 elsif ($msg->{'type'} eq 'friend_message') { }
423 0 0 if ($@)
424 0 0 if $@
441 0 0 if $@
453 0 0 if $@
460 0 0 if ($json->{'ContinueFlag'} != 0)
471 0 0 if (ref $object ne 'Mojo::Weixin::Friend' and ref $object ne 'Mojo::Weixin::Group')
476 0 0 ref $object eq 'Mojo::Weixin::Friend' ? :
0 0 ref $object eq 'Mojo::Weixin::Group' ? :
0 0 ref $object eq 'Mojo::Weixin::Group' ? :
489 0 0 if ref $callback eq 'CODE'
500 0 0 if (ref $object ne 'Mojo::Weixin::Friend' and ref $object ne 'Mojo::Weixin::Group')
505 0 0 if (ref $media eq '') { }
0 0 elsif (ref $media eq 'HASH') { }
510 0 0 if (defined $media_info->{'media_id'})
512 0 0 if $id
513 0 0 if $code
514 0 0 if (not defined $media_info->{'media_code'} and defined $media_info->{'media_type'}) { }
0 0 elsif (not defined $media_info->{'media_code'}) { }
521 0 0 if (defined $media_info->{'media_code'} and not defined $media_info->{'media_type'})
532 0 0 $media_info->{'media_type'} eq 'file' ? :
0 0 $media_info->{'media_type'} eq 'voicce' ? :
0 0 $media_info->{'media_type'} eq 'microvideo' ? :
0 0 $media_info->{'media_type'} eq 'video' ? :
0 0 $media_info->{'media_type'} eq 'emoticon' ? :
0 0 $media_info->{'media_type'} eq 'image' ? :
550 0 0 ref $object eq 'Mojo::Weixin::Friend' ? :
0 0 ref $object eq 'Mojo::Weixin::Group' ? :
0 0 ref $object eq 'Mojo::Weixin::Group' ? :
559 0 0 if ref $callback eq 'CODE'
570 0 0 if ref $callback eq 'CODE'
588 0 0 if ($msg->class eq 'recv') { }
0 0 elsif ($msg->class eq 'send') { }
589 0 0 if ($msg->type eq 'group_message') { }
0 0 elsif ($msg->type eq 'friend_message') { }
597 0 0 if ($msg->type eq 'group_message') { }
0 0 elsif ($msg->type eq 'friend_message') { }
612 0 0 if ($msg->class eq 'recv') { }
0 0 elsif ($msg->class eq 'send') { }
613 0 0 if ($msg->type eq 'group_message') { }
0 0 elsif ($msg->type eq 'friend_message') { }
621 0 0 if ($msg->type eq 'group_message') { }
0 0 elsif ($msg->type eq 'friend_message') { }
633 0 0 if (not $_[0]) { }
0 0 elsif (ref $_[0] eq 'Mojo::Weixin::Message') { }
638 0 0 unless ($_[0]->is_success)
644 0 0 $_[0]->type eq 'group_message' ? :
645 0 0 unless (defined $msg_id and defined $receiver_id)
652 0 0 unless (defined $msg_id and defined $receiver_id)
658 0 0 if ($ret) { }