Webqq/Client/Method/get_dwz.pm

filter: Statementstmt 30.4% 7 / 23 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 2 / 4 Podpod 100% 1 / 1 totaltotal 25.6% 10 / 39 CC 5 SCAR 29.6
CC
5
Cov
22%
get_dwz
30.0
__ANON__
2.0
BEGIN
1.0
CRAP 19.2
« Webqq/Client/Plugin/SmartReply2.pm ↑ Summary Webqq/Message/Face.pm »
1 1 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use Webqq::Client::Util qw(console);
Subroutine BEGIN: called CC=1 SCAR=0.0
3 0 ▶sub Webqq::Client::get_dwz {
Subroutine get_dwz: not called CC=5 SCAR=34.0
Pod documented
4 0 my $self = shift;
5 0 my $url = shift;
6 0 my $api = 'http://dwz.cn/create.php';
7 0 my $ua = $self->{ua};
8 0 my $res;
9 my $dwz;
10 0 eval{
11 0 ▶ local $SIG{ALRM} = sub{die "timeout";};
Subroutine __ANON__: not called CC=1 SCAR=6.9
12 0 alarm 5;
13 0 $res = $ua->post($api,[url=>$url],);
14 0 alarm 0;
15 0 ▶ if($res->is_success){
Branch: 1 branch
BranchTrueFalseTotal
if ($res->is_success) 0 0 0
16 0 my $json = JSON->new->utf8->decode($res->content);
17 0 ▶ $dwz = $json->{tinyurl} if $json->{status}==0;
Branch: 1 branch
BranchTrueFalseTotal
if $json->{"status"} == 0 0 0 0
18 };
19 };
20 0 ▶ console "[Webqq::Client::get_dwz] $@\n" if $@ and $self->{debug};
Branch: 1 branch
BranchTrueFalseTotal
if $@ and $self->{"debug"} 0 0 0
Condition0%0/3
$@ and $self->{"debug"}
!ll&&!rl&&r
000
MC/DC0%0/2
$@ and $self->{"debug"}
$@ $self->{"debug"}
Truth table0%0/3
A and B
A= $@B= $self->{"debug"}
ABresult
0X0
100
111
21  
22 0 return $dwz;
23
24 };
25 1 1;
« Webqq/Client/Plugin/SmartReply2.pm ↑ Summary Webqq/Message/Face.pm »