| 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
| |||||||||||||||||||||||||||||
| 16 | 0 | my $json = JSON->new->utf8->decode($res->content); | |||||||||||||||||||||||||||
| 17 | 0 | ▶ | $dwz = $json->{tinyurl} if $json->{status}==0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | }; | ||||||||||||||||||||||||||||
| 19 | }; | ||||||||||||||||||||||||||||
| 20 | 0 | ▶ | console "[Webqq::Client::get_dwz] $@\n" if $@ and $self->{debug}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$@ and $self->{"debug"}
MC/DC0%0/2
$@ and $self->{"debug"}
$@
$self->{"debug"}
Truth table0%0/3
A and B
A= $@B= $self->{"debug"}
| |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | return $dwz; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | }; | ||||||||||||||||||||||||||||
| 25 | 1 | 1; | |||||||||||||||||||||||||||