Webqq/Client/Method/logout.pm

filter: Statementstmt 16.6% 4 / 24 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod 100% 1 / 1 totaltotal 17.1% 6 / 35 CC 5 SCAR 32.3
CC
5
Cov
12%
logout
30.0
BEGIN
1.0
CRAP 25.2
« Webqq/Client/Plugin/SendMsgFromMsg.pm ↑ Summary Webqq/Client/Method/_get_group_list_info.pm »
1 1 ▶use Webqq::Client::Util qw(console);
Subroutine BEGIN: called CC=1 SCAR=0.0
2 0 ▶sub Webqq::Client::logout {
Subroutine logout: not called CC=5 SCAR=34.0
Pod documented
3 0 my $self = shift;
4 0 console "正在注销...\n";
5 0 ▶ if($self->{type} eq 'smartqq'){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"type"} eq "smartqq") 0 0 0
6 0 $self->{cookie_jar}->set_cookie(0,"ptwebqq",undef,"/","qq.com",undef,undef,undef,-1);
7 0 $self->{cookie_jar}->set_cookie(0,"skey",undef,"/","qq.com",undef,undef,undef,-1);
8 0 console "注销完毕\n";
9 0 return 1;
10 }
11 0 my $ua = $self->{ua};
12 0 my $api_url = 'http://d.web2.qq.com/channel/logout2';
13 my @query_string = (
14 ids => undef,
15 clientid => $self->{qq_param}{clientid},
16 psessionid => $self->{qq_param}{psessionid},
17 0 t => time,
18 );
19 0 my @headers = (Referer => 'http://d.web2.qq.com/proxy.html?v=20110331002&callback=1&id=3');
20 0 my @query_string_pairs;
21 0 ▶ push @query_string_pairs , shift(@query_string) . "=" . shift(@query_string) while(@query_string);
Branch: 1 branch
BranchTrueFalseTotal
@query_string and do { push @query_string_pairs, shift(@query_string) . '=' . shift(@query_string) } 0 0 0
22 0 my $response = $ua->get($api_url.'?'.join("&",@query_string_pairs),@headers);
23 0 ▶ if($response->is_success){
Branch: 1 branch
BranchTrueFalseTotal
if ($response->is_success) { } 0 0 0
24 0 my $content = $response->content();
25 0 ▶ print $content,"\n" if $self->{debug};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"debug"} 0 0 0
26 0 console "注销完毕\n";
27 0 return 1;
28 }
29 0 else{return 0}
30 }
31 1 1;
« Webqq/Client/Plugin/SendMsgFromMsg.pm ↑ Summary Webqq/Client/Method/_get_group_list_info.pm »