API/Client.pm

filter: Statementstmt 95.8% 23 / 24 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 80.0% 32 / 40 SCAR 14.0
CC
4
Cov
84%
new
4.3
BEGIN
1.0
BEGIN
1.0
CRAP 4.1
« API/Builder/TemplateMessage.pm ↑ Summary Message/Narrowcast.pm »
1 package LINE::Bot::API::Client;
2 47 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 46 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 46 ▶use Carp 'croak';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 46 ▶use File::Basename 'basename';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 sub new {
9 46 ▶ my(undef, %args) = @_;
Subroutine new: called CC=4 SCAR=14.7
Pod undocumented
10 46 my $backend = 'Furl';
11 46 ▶ if ($args{http_client} && $args{http_client}{backend}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($args{"http_client"} and $args{"http_client"}{"backend"}) 0 46 46
Condition33%1/3
$args{"http_client"} and $args{"http_client"}{"backend"}
!ll&&!rl&&r
4600
MC/DC0%0/2
$args{"http_client"} and $args{"http_client"}{"backend"}
$args{"http_client"} $args{"http_client"}{"backend"}
Truth table33%1/3
A and B
A= $args{"http_client"}B= $args{"http_client"}{"backend"}
ABresult
0X0
100
111
12 0 $backend = $args{http_client}{backend};
13 }
14 46 my $klass = join '::', __PACKAGE__, $backend;
15 46 ▶ eval "use $klass;"; ## no critic
Subroutine BEGIN: called CC=1 SCAR=0.0
16 46 ▶ croak $@ if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 46 46
17 46 $klass->new(%args);
18 }
19  
20 46 1;
« API/Builder/TemplateMessage.pm ↑ Summary Message/Narrowcast.pm »