blib/lib/Lemonldap/NG/Portal/Main/Auth.pm

filter: Statementstmt 95.0% 19 / 20 Branchbran 70.0% 7 / 10 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 2 totaltotal 80.4% 33 / 41 CC 7 SCAR 17.2
CC
7
Cov
85%
initDisplay
7.6
BEGIN
1.0
BEGIN
1.0
CRAP 5.6
« blib/lib/Lemonldap/NG/Portal/Main/Plugin.pm ↑ Summary blib/lib/Lemonldap/NG/Portal/Password/Combination.pm »
1 package Lemonldap::NG::Portal::Main::Auth;
2  
3 342 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 342 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 342 our $VERSION = '2.0.15';
7  
8 342 extends 'Lemonldap::NG::Portal::Main::Plugin';
9  
10 # PROPERTIES
11  
12 342 has authnLevel => ( is => 'rw' );
13  
14 1 ▶sub stop { return 0 }
Subroutine stop: called CC=1 SCAR=0.0
Pod undocumented
15  
16 # initDisplay is called by the Choice module to prepare the request object.
17 # Before 2.20, AjaxInitScript and InitCmd were called separately.
18 29 ▶sub initDisplay {
Subroutine initDisplay: called CC=7 SCAR=20.2
Pod undocumented
19 29 my ( $self, $req ) = @_;
20  
21 29 ▶ if ( $self->{AjaxInitScript} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"AjaxInitScript"}) 4 25 29
22 $self->logger->debug( 'Append ' . $self->{Name} . ' init/script' )
23 4 ▶ if $self->{Name};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"Name"} 4 0 4
24 4 $req->data->{customScript} .= $self->AjaxInitScript;
25 }
26 29 ▶ if ( $self->can('InitCmd') and my $cmd = $self->InitCmd ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->can("InitCmd") and my $cmd = $self->InitCmd) 4 25 29
Condition66%2/3
$self->can("InitCmd") and my $cmd = $self->InitCmd
!ll&&!rl&&r
2504
MC/DC50%1/2
$self->can("InitCmd") and my $cmd = $self->InitCmd
$self->can("InitCmd") my $cmd = $self->InitCmd
Truth table66%2/3
A and B
A= $self->can("InitCmd")B= my $cmd = $self->InitCmd
ABresult
0X0
100
111
27 $self->logger->debug( 'Launch ' . $self->{Name} . ' init command' )
28 4 ▶ if $self->{Name};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"Name"} 4 0 4
29 4 my $res = eval( $self->{InitCmd} );
30 4 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 4 4
31 0 die "Error running InitCmd: $@";
32 }
33  
34 }
35 }
36  
37 342 1;
« blib/lib/Lemonldap/NG/Portal/Main/Plugin.pm ↑ Summary blib/lib/Lemonldap/NG/Portal/Password/Combination.pm »