Webqq/Model/Remote/get_qq_from_id.pm

filter: Statementstmt 7.1% 1 / 14 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 1 Podpod 0.0% 0 / 1 totaltotal 4.5% 1 / 22 CC 4 SCAR 30.0
CC
4
Cov
5%
get_qq_from_id
20.0
CRAP 20.0
« Webqq/Plugin/ZiYue.pm ↑ Summary Webqq/Model/Remote/_get_group_list_info.pm »
1 0 ▶sub Mojo::Webqq::Model::get_qq_from_id{
Subroutine get_qq_from_id: not called CC=4 SCAR=30.0
Pod undocumented
2 0 my $self = shift;
3 0 return ;
4 0 my $uin = shift;
5 0 my $cache_data = $self->id_to_qq_cache->retrieve($uin);
6 0 ▶ return $cache_data if defined $cache_data;
Branch: 1 branch
BranchTrueFalseTotal
if defined $cache_data 0 0 0
7 0 my $api_url = 'https://s.web2.qq.com/api/get_friend_uin2';
8 0 my $headers = {Referer=>'https://s.web2.qq.com/proxy.html?v=20130916001&callback=1&id=1',json=>1};
9 0 my @query_string = (
10 tuin => $uin,
11 type => 1,
12 vfwebqq => $self->vfwebqq,
13 t => time,
14 );
15
16 0 my $json = $self->http_get($self->gen_url($api_url,@query_string),$headers);
17 0 ▶ return undef unless defined $json;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $json 0 0 0
18 0 ▶ return undef if $json->{retcode} !=0;
Branch: 1 branch
BranchTrueFalseTotal
if $json->{"retcode"} != 0 0 0 0
19 0 $self->id_to_qq_cache->store($uin,$json->{result}{account});
20 0 return $json->{result}{account};
21 }
22 1 1;
« Webqq/Plugin/ZiYue.pm ↑ Summary Webqq/Model/Remote/_get_group_list_info.pm »