Webqq/Client/Method/_get_group_list_info.pm

filter: Statementstmt 23.5% 4 / 17 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod n/a totaltotal 18.5% 5 / 27 CC 5 SCAR 32.3
CC
5
Cov
16%
_get_group_list_info
30.0
BEGIN
1.0
CRAP 25.2
« Webqq/Client/Method/logout.pm ↑ Summary Webqq/Client/Util.pm »
1 1 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 0 ▶sub Webqq::Client::_get_group_list_info{
Subroutine _get_group_list_info: not called CC=5 SCAR=34.0
3 0 my $self = shift;
4 0 my $ua = $self->{ua};
5 0 my $api_url = 'http://s.web2.qq.com/api/get_group_name_list_mask2';
6 0 ▶ my @headers = $self->{type} eq 'webqq'? (Referer => 'http://s.web2.qq.com/proxy.html?v=20110412001&callback=1&id=3')
Branch: 1 branch
BranchTrueFalseTotal
$self->{'type'} eq 'webqq' ? : 0 0 0
7 : (Referer => 'http://s.web2.qq.com/proxy.html?v=20130916001&callback=1&id=1')
8 ;
9 my %r = (
10 hash => hash($self->{qq_param}{ptwebqq},$self->{qq_param}{qq}),
11 vfwebqq => $self->{qq_param}{vfwebqq},
12 0 );
13  
14 0 my $post_content = [
15 r => JSON->new->encode(\%r),
16 ];
17  
18 #if($self->{debug}){
19 # require URI;
20 # my $uri = URI->new('http:');
21 # $uri->query_form($post_content);
22 # print $api_url,"\n";
23 # print $uri->query(),"\n";
24 #}
25  
26 0 my $response = $ua->post(
27 $api_url,
28 $post_content,
29 @headers,
30 );
31 0 ▶ if($response->is_success){
Branch: 1 branch
BranchTrueFalseTotal
if ($response->is_success) { } 0 0 0
32 0 ▶ print $response->content(),"\n" if $self->{debug};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"debug"} 0 0 0
33 0 my $json = JSON->new->utf8->decode( $response->content() );
34 0 ▶ return undef unless exists $json->{result}{gnamelist};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $json->{"result"}{"gnamelist"} 0 0 0
35 0 return $json->{result};
36 }
37 0 else{return undef}
38 }
39 1 1;
« Webqq/Client/Method/logout.pm ↑ Summary Webqq/Client/Util.pm »