Weixin/Model/Remote/_webwxbatchgetcontact_group_member.pm

filter: Statementstmt 24.1% 7 / 29 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 2 / 3 Podpod n/a totaltotal 18.0% 9 / 50 CC 11 SCAR 47.2
CC
11
Cov
16%
_webwxbatchgetcontact_group_member
132.0
BEGIN
1.0
BEGIN
1.0
CRAP 111.8
« Weixin/Message/Remote/_send_media_message.pm ↑ Summary Weixin/Plugin/Riddle.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use Mojo::Weixin::Const qw(%KEY_MAP_GROUP_MEMBER);
Subroutine BEGIN: called CC=1 SCAR=0.0
3 0 ▶sub Mojo::Weixin::_webwxbatchgetcontact_group_member{
Subroutine _webwxbatchgetcontact_group_member: not called CC=11 SCAR=48.8
4 0 my $self = shift;
5 0 ▶ my $eid = shift // '';
Condition0%0/2
shift() // ""
l!l
00
MC/DC0%0/1
shift() // ""
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
6 0 my @ids = @_;
7 0 my @return;
8 0 my $api = "https://".$self->domain . "/cgi-bin/mmwebwx-bin/webwxbatchgetcontact";
9  
10 0 ▶ while( my @id = splice(@ids,0,50) ){
Branch: 1 branch
BranchTrueFalseTotal
if (my(@id) = splice(@ids, 0, 50)) 0 0 0
11 0 my @query_string = (
12 type => "ex",
13 r => $self->now(),
14 );
15 0 ▶ push @query_string,(pass_ticket => $self->pass_ticket) if $self->pass_ticket;
Branch: 1 branch
BranchTrueFalseTotal
if $self->pass_ticket 0 0 0
16 my $post = {
17 BaseRequest => {
18 Uin => $self->wxuin,
19 DeviceID => $self->deviceid,
20 Sid => $self->wxsid,
21 Skey => $self->skey,
22 },
23 Count => @id+0,
24 0 List => [ map { {UserName=>$_,EncryChatRoomId=>$eid} } @id ],
25 };
26 0 my $json = $self->http_post($self->gen_url2($api,@query_string),{Referer=>'https://'.$self->domain . '/',json=>1},json=>$post);
27 0 ▶ next unless defined $json;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $json 0 0 0
28 0 ▶ next if $json->{BaseResponse}{Ret}!=0;
Branch: 1 branch
BranchTrueFalseTotal
if $json->{"BaseResponse"}{"Ret"} != 0 0 0 0
29 0 for my $e (@{$json->{ContactList}}){
30 0 my $member = {};
31 0 for(keys %KEY_MAP_GROUP_MEMBER){
32 0 ▶ $member->{$_} = $e->{$KEY_MAP_GROUP_MEMBER{$_}} // "";
Condition0%0/2
$$e{$Mojo::Weixin::Model::KEY_MAP_GROUP_MEMBER{$_}} // ""
l!l
00
MC/DC0%0/1
$$e{$Mojo::Weixin::Model::KEY_MAP_GROUP_MEMBER{$_}} // ""
$$e{$Mojo::Weixin::Model::KEY_MAP_GROUP_MEMBER{$_}}
Truth table0%0/2
A
A= $$e{$Mojo::Weixin::Model::KEY_MAP_GROUP_MEMBER{$_}}
Aresult
11
00
33 }
34 0 $member->{sex} = $self->code2sex($member->{sex});
35 0 push @return,$member;
36 }
37  
38 }
39 0 ▶ return if @return ==0;
Branch: 1 branch
BranchTrueFalseTotal
if @return == 0 0 0 0
40 0 ▶ return wantarray?@return:$return[0];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
41 }
42  
43 1 1;
« Weixin/Message/Remote/_send_media_message.pm ↑ Summary Weixin/Plugin/Riddle.pm »