| 1 | package Web::App::Config::Screen; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # $Id: Screen.pm,v 1.8 2009/03/29 10:06:46 apla Exp $ | ||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use Class::Easy; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | has 'init_calls'; | |||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | has 'process_calls'; | |||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | has 'request'; | |||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | has 'id'; | |||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | has 'params'; | |||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | has 'params_hash'; | |||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | has 'auth'; | |||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | ▶ | sub create { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | my $id = shift; | |||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | my $self = { | |||||||||||||||||||||||||||||||||||||||||
| 20 | 'id' => $id, | ||||||||||||||||||||||||||||||||||||||||||
| 21 | 'init_calls' => [], | ||||||||||||||||||||||||||||||||||||||||||
| 22 | 'process_calls' => [], | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 'presentation' => { | ||||||||||||||||||||||||||||||||||||||||||
| 24 | 'type' => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 25 | 'file' => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 26 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 'request' => { | ||||||||||||||||||||||||||||||||||||||||||
| 28 | 'max-size' => 10240, | ||||||||||||||||||||||||||||||||||||||||||
| 29 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 30 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | bless $self, $class; | |||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||
| 36 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | sub add_call { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_call: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | my @functions = @_; | |||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | $self->add_init_call (@_); | |||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | $self->add_process_call (@_); | |||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||
| 44 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | ▶ | sub add_init_call { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_init_call: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | my $params = shift; | |||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | push @{$self->{'init_calls'}}, $params; | |||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||
| 51 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | ▶ | sub add_process_call { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_process_call: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | my $params = shift; | |||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | push @{$self->{'process_calls'}}, $params; | |||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||
| 58 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | sub presentation { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
presentation: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | my $attrs = shift; | |||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | $self->{presentation} = $attrs; | |||||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||||
| 65 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | sub presentation_type { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
presentation_type: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | my $received_type = shift; | |||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | ▶ | return $self->{'presentation'}->{'type'} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 71 | unless defined $received_type; | ||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | $self->{'presentation'}->{'type'} = $received_type; | |||||||||||||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||||||||||||
| 75 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | sub presentation_file { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
presentation_file: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | my $received_filename = shift; | |||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | return $self->{'presentation'}->{'file'} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 81 | unless defined $received_filename; | ||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | $self->{'presentation'}->{'file'} = $received_filename; | |||||||||||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||||||||||||
| 85 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | ▶ | sub authenticated { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
authenticated: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | my $session = shift; | |||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | my $auth = $self->auth; | |||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | return 1 | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
not defined $auth or $auth and defined $session->id
$auth and defined $session->id
MC/DC0%0/3
not defined $auth or $auth and defined $session->id
not defined $auth
$auth
defined $session->id
Truth table0%0/4
not(A) or B and C
A= not defined $authB= $authC= defined $session->id
| |||||||||||||||||||||||||||||||||||||||||||
| 93 | if (not defined $auth or ($auth and defined $session->id)); | ||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||
| 97 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||
| 99 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||||||||||||||||||||||||||||||||||||||||||
| 100 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||||||||||||||||||||||||||||||||||||||||||
| 101 | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||
| 103 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||