blib/lib/Lemonldap/NG/Portal/UserDB/WebID.pm

filter: Statementstmt 36.3% 12 / 33 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 42.8% 3 / 7 Podpod 0.0% 0 / 4 totaltotal 25.4% 15 / 59 CC 7 SCAR 34.3
CC
7
Cov
26%
setSessionInfo
56.0
init
2.0
getUser
2.0
CRAP 30.8
« blib/lib/Lemonldap/NG/Portal/Main/Run.pm ↑ Summary blib/lib/Lemonldap/NG/Portal/Lib/Radius.pm »
1 package Lemonldap::NG::Portal::UserDB::WebID;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 use Lemonldap::NG::Portal::Main::Constants qw(
6 PE_OK
7 PE_ERROR
8 PE_MISSINGREQATTR
9 1 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 extends 'Lemonldap::NG::Portal::Main::UserDB';
12  
13 1 our $VERSION = '2.19.0';
14  
15 # INITIALIZATION
16  
17 sub init {
18 0 ▶ return 1;
Subroutine init: not called CC=1 SCAR=6.9
Pod undocumented
19 }
20  
21 # RUNNING METHODS
22  
23 sub getUser {
24 0 ▶ return PE_OK;
Subroutine getUser: not called CC=1 SCAR=6.9
Pod undocumented
25 }
26  
27 sub findUser {
28 0 ▶ return PE_OK;
Subroutine findUser: not called CC=1 SCAR=6.9
Pod undocumented
29 }
30  
31 sub setSessionInfo {
32 0 ▶ my ( $self, $req ) = @_;
Subroutine setSessionInfo: not called CC=7 SCAR=40.3
Pod undocumented
33 0 ▶ unless ( $req->data->{_webid} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($req->data->{"_webid"}) 0 0 0
34 0 $self->logger->error('No webid object found');
35 0 return PE_ERROR;
36 }
37  
38 my %vars = (
39 0 %{ $self->conf->{exportedVars} },
40 0 %{ $self->conf->{webIDExportedVars} }
41 );
42 0 ▶ while ( my ( $k, $v ) = each %vars ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %vars) 0 0 0
43 0 my $attr = $k;
44 0 my $req;
45 0 ▶ $attr =~ s/^!// and $req = 1;
Branch: 1 branch
BranchTrueFalseTotal
$attr =~ s/^!// and $req = 1 0 0 0
46 0 eval { $req->{sessionInfo}->{$attr} = $req->data->{_webid}->get($v) };
47 0 ▶ $self->logger->error("Unable to get $v from FOAF document: $@")
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 0 0
48 if ($@);
49 0 ▶ if ( $req and not $req->{sessionInfo}->{$attr} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($req and not $req->{"sessionInfo"}{$attr}) 0 0 0
Condition0%0/3
$req and not $req->{"sessionInfo"}{$attr}
!ll&&!rl&&r
000
MC/DC0%0/2
$req and not $req->{"sessionInfo"}{$attr}
$req not $req->{"sessionInfo"}{$attr}
Truth table0%0/3
A and not(B)
A= $reqB= not $req->{"sessionInfo"}{$attr}
ABresult
0X0
100
111
50 0 $self->userLogger->warn(
51 "Required attribute $v is missing (user: $req->{user})");
52 0 return PE_MISSINGREQATTR;
53 }
54 }
55  
56 0 return PE_OK;
57 }
58  
59 1 1;
« blib/lib/Lemonldap/NG/Portal/Main/Run.pm ↑ Summary blib/lib/Lemonldap/NG/Portal/Lib/Radius.pm »