Weixin/Model/Remote/_webwxverifyuser.pm

filter: Statementstmt 5.8% 1 / 17 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 1 Podpod n/a totaltotal 3.0% 1 / 33 CC 8 SCAR 42.8
CC
8
Cov
3%
_webwxverifyuser
72.0
CRAP 72.0
« Weixin/Plugin/Weather.pm ↑ Summary Weixin/Log.pm »
1 0 ▶sub Mojo::Weixin::_webwxverifyuser {
Subroutine _webwxverifyuser: not called CC=8 SCAR=42.8
2 0 my $self = shift;
3 0 my $id = shift;
4 0 my $content = shift;
5 0 my $opcode = shift;
6 0 my $ticket = shift;
7  
8 0 ▶ $content = "" if not defined $content;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $content 0 0 0
9 0 ▶ $opcode = 2 if not defined $opcode;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $opcode 0 0 0
10 0 ▶ $ticket = "" if not defined $ticket;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $ticket 0 0 0
11  
12 0 my $api = 'https://' . $self->domain . '/cgi-bin/mmwebwx-bin/webwxverifyuser';
13 0 my @query_string = (
14 r => $self->now(),
15 );
16 0 ▶ push @query_string,(pass_ticket=>$self->url_escape($self->pass_ticket)) if $self->pass_ticket;
Branch: 1 branch
BranchTrueFalseTotal
if $self->pass_ticket 0 0 0
17 0 ▶ my $post = {
Condition0%0/2
$content || ''
l!l
00
MC/DC0%0/1
$content || ''
$content
Truth table0%0/2
A
A= $content
Aresult
11
00
18 BaseRequest => {
19 Uin => $self->wxuin,
20 Sid => $self->wxsid,
21 Skey => $self->skey,
22 DeviceID => $self->deviceid,
23 },
24 Opcode => $opcode,
25 VerifyUserListSize => 1,
26 VerifyUserList=>[{
27 Value => $id,
28 VerifyUserTicket => $ticket,
29 }],
30 VerifyContent => $content || "",
31 SceneListCount => 1,
32 SceneList => [33],
33 skey => $self->skey,
34 };
35  
36 0 my $json = $self->http_post($self->gen_url($api,@query_string),{json=>1,Referer=>'https://' . $self->domain . '/'},json=>$post);
37 0 ▶ return if not defined $json;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $json 0 0 0
38 0 ▶ return if $json->{BaseResponse}{Ret}!=0;
Branch: 1 branch
BranchTrueFalseTotal
if $json->{"BaseResponse"}{"Ret"} != 0 0 0 0
39 0 return 1;
40 }
41  
42 1 1;
« Weixin/Plugin/Weather.pm ↑ Summary Weixin/Log.pm »