blib/lib/Lemonldap/NG/Common/UserAgent.pm

filter: Statementstmt 100% 20 / 20 Branchbran 50.0% 1 / 2 Conditioncond 80.0% 4 / 5 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 85.7% 30 / 35 CC 4 SCAR 10.1
CC
4
Cov
93%
new
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« blib/lib/Lemonldap/NG/Common/EmailAddress.pm ↑ Summary blib/lib/Lemonldap/NG/Common/Apache/Session/Generate/SHA256.pm »
1 package Lemonldap::NG::Common::UserAgent;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use LWP::UserAgent;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use Lemonldap::NG::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '2.18.0';
8  
9 17 ▶sub new {
Subroutine new: called CC=4 SCAR=13.9
Pod undocumented
10 17 my ( $class, $conf ) = @_;
11 17 ▶ my $opts = $conf->{lwpOpts} || {};
Condition100%2/2
$conf->{'lwpOpts'} || {}
l!l
116
MC/DC100%1/1
$conf->{'lwpOpts'} || {}
$conf->{'lwpOpts'}
Truth table100%2/2
A
A= $conf->{'lwpOpts'}
Aresult
11
00
12 17 my $agent = "LemonLDAP-NG/" . $Lemonldap::NG::Common::VERSION . " ";
13 17 ▶ $opts->{agent} ||= $agent;
Condition66%2/3
$opts->{"agent"} ||= $agent
l!l&&r!l&&!r
1160
MC/DC0%0/2
$opts->{"agent"} ||= $agent
$opts->{"agent"} $agent
Truth table66%2/3
A ||= B
A= $opts->{"agent"}B= $agent
ABresult
1X1
011
000
14 17 ▶ $opts->{ssl_opts} = $conf->{lwpSslOpts} if ( $conf->{lwpSslOpts} );
Branch: 1 branch
BranchTrueFalseTotal
if $conf->{"lwpSslOpts"} 0 17 17
15 17 my $ua = LWP::UserAgent->new(%$opts);
16 17 push @{ $ua->requests_redirectable }, 'POST';
17 17 return $ua;
18 }
19  
20 3 1;
« blib/lib/Lemonldap/NG/Common/EmailAddress.pm ↑ Summary blib/lib/Lemonldap/NG/Common/Apache/Session/Generate/SHA256.pm »