| 1 | package CGI::Ex::App; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | ###---------------------### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # Copyright - Paul Seamons | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # Distributed under the Perl Artistic License without warranty | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use 5.006; #our | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | BEGIN { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | ▶ | eval { use Time::HiRes qw(time) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 2 | ▶ | eval { use Scalar::Util }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 2 | our $VERSION = '2.54'; # VERSION | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 21 | ▶ | sub croak { die sprintf "%s at %3\$s line %4\$s\n", $_[0], caller 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
croak: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 196 | ▶ | my $class = shift || croak "Missing class name"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=13.9
Pod
documented
Condition66%2/3
shift() || croak('Missing class name')
MC/DC0%0/2
shift() || croak('Missing class name')
shift()
croak('Missing class name')
Truth table33%1/3
A || B
A= shift()B= croak('Missing class name')
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 194 | ▶ | my $self = bless ref($_[0]) ? shift() : (@_ % 2) ? {} : {@_}, $class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 194 | $self->init; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 194 | $self->init_from_conf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 192 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | ▶ | sub init {} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | sub init_from_conf { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 194 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init_from_conf: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 194 | ▶ | @$self{keys %$_} = values %$_ if $self->load_conf and $_ = $self->conf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->load_conf and $_ = $self->conf
MC/DC50%1/2
$self->load_conf and $_ = $self->conf
$self->load_conf
$_ = $self->conf
Truth table66%2/3
A and B
A= $self->load_confB= $_ = $self->conf
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | sub import { # only ever called with explicit use CGI::Ex::App qw() - not with use base | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 3 | ▶ | my $class = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
import: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 3 | ▶ | return if not @_ = grep { /^:?App($|__)/ } @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 3 | require CGI::Ex::App::Constants; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 3 | unshift @_, 'CGI::Ex::App::Constants'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 3 | goto &CGI::Ex::App::Constants::import; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | ###---------------------### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | sub navigate { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 78 | ▶ | my ($self, $args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
navigate: called CC=14 SCAR=26.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 78 | ▶ | $self = $self->new($args) if ! ref $self; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 78 | $self->{'_time'} = time; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 78 | eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 78 | ▶ | return $self if ! $self->{'_no_pre_navigate'} && $self->pre_navigate; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not $self->{"_no_pre_navigate"} and $self->pre_navigate
MC/DC100%2/2
not $self->{"_no_pre_navigate"} and $self->pre_navigate
not $self->{"_no_pre_navigate"}
$self->pre_navigate
Truth table100%3/3
not(A) and B
A= not $self->{"_no_pre_navigate"}B= $self->pre_navigate
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 77 | ▶ | local $self->{'_morph_lineage_start_index'} = $#{$self->{'_morph_lineage'} || []}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 77 | $self->nav_loop; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 78 | my $err = $@; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 78 | ▶ | if ($err && (ref($err) || $err ne "Long Jump\n")) { # catch any errors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$err and ref $err || $err ne "Long Jump\n"
ref $err or $err ne "Long Jump\n"
MC/DC66%2/3
$err and ref $err || $err ne "Long Jump\n"
$err
ref $err
$err ne "Long Jump\n"
Truth table75%3/4
A and B or C
A= $errB= ref $errC= $err ne "Long Jump\n"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 8 | ▶ | die $err if ! $self->can('handle_error'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 8 | ▶ | if (! eval { $self->handle_error($err); 1 }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 2 | die "$err\nAdditionally, the following happened while calling handle_error: $@"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 76 | ▶ | $self->handle_error($@) if ! $self->{'_no_post_navigate'} && ! eval { $self->post_navigate; 1 } && $@ && $@ ne "Long Jump\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition44%4/9
not $self->{"_no_post_navigate"} || eval {
do {
$self->post_navigate;
1
}
} and $@ and $@ ne "Long Jump\n"
not $self->{"_no_post_navigate"} || eval {
do {
$self->post_navigate;
1
}
} and $@
$self->{'_no_post_navigate'} || eval {
do {
$self->post_navigate;
1
}
}
MC/DC0%0/4
not $self->{"_no_post_navigate"} || eval {
do {
$self->post_navigate;
1
}
} and $@ and $@ ne "Long Jump\n"
$self->{'_no_post_navigate'}
eval {
do {
$self->post_navigate;
1
}
}
$@
$@ ne "Long Jump\n"
Truth table40%2/5
not(A || B) and C and D
A= $self->{'_no_post_navigate'}B= eval {
do {
$self->post_navigate;
1
}
}C= $@D= $@ ne "Long Jump\n"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 76 | $self->destroy; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 76 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | sub nav_loop { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 153 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
nav_loop: called CC=15 SCAR=27.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 153 | ▶ | local $self->{'_recurse'} = $self->{'_recurse'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{'_recurse'} || 0
MC/DC100%1/1
$self->{'_recurse'} || 0
$self->{'_recurse'}
Truth table100%2/2
A
A= $self->{'_recurse'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 153 | ▶ | if ($self->{'_recurse'}++ >= $self->recurse_limit) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 2 | my $err = "recurse_limit (".$self->recurse_limit.") reached"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 2 | ▶ | croak(($self->{'jumps'} || 0) <= 1 ? $err : "$err number of jumps (".$self->{'jumps'}.")"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$self->{'jumps'} || 0
MC/DC0%0/1
$self->{'jumps'} || 0
$self->{'jumps'}
Truth table50%1/2
A
A= $self->{'jumps'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 151 | my $path = $self->path; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 149 | ▶ | return if $self->pre_loop($path); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 148 | ▶ | foreach ($self->{'path_i'} ||= 0; $self->{'path_i'} <= $#$path; $self->{'path_i'}++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$self->{"path_i"} ||= 0
MC/DC100%1/1
$self->{"path_i"} ||= 0
$self->{"path_i"}
Truth table100%2/2
A
A= $self->{"path_i"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 127 | my $step = $path->[$self->{'path_i'}]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 127 | ▶ | if ($step !~ /^([^\W0-9]\w*)$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 1 | $self->stash->{'forbidden_step'} = $step; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 1 | $self->goto_step($self->forbidden_step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 126 | $step = $1; # untaint | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 126 | ▶ | if (! $self->is_authed) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 125 | my $req = $self->run_hook('require_auth', $step, 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 125 | ▶ | return if (ref($req) ? $req->{$step} : $req) && ! $self->run_hook('get_valid_auth', $step); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%2/3
ref $req ? $req->{$step} : $req and not $self->run_hook("get_valid_auth", $step)
MC/DC0%0/2
ref $req ? $req->{$step} : $req and not $self->run_hook("get_valid_auth", $step)
ref $req ? $req->{$step} : $req
not $self->run_hook("get_valid_auth", $step)
Truth table66%2/3
A and not(B)
A= ref $req ? $req->{$step} : $reqB= not $self->run_hook("get_valid_auth", $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 119 | $self->run_hook('morph', $step); # let steps be in external modules | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 117 | $self->parse_path_info('path_info_map', $self->run_hook('path_info_map', $step)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 115 | ▶ | if ($self->run_hook('run_step', $step)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 68 | $self->run_hook('unmorph', $step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 68 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 36 | $self->run_hook('refine_path', $step, $self->{'path_i'} >= $#$path); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 36 | $self->run_hook('unmorph', $step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 57 | ▶ | return if $self->post_loop($path); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 56 | $self->insert_path($self->default_step); # run the default step as a last resort | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 56 | $self->nav_loop; # go recursive | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 22 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | sub path { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 329 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
path: called CC=8 SCAR=20.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 329 | ▶ | return $self->{'path'} ||= do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$self->{"path"} ||= do {
my @path;
$self->parse_path_info("path_info_map_base", $self->path_info_map_base);
my $step = $self->form->{$self->step_key};
if (defined $step) {
$step =~ s[^/+][];
$step =~ s[/][__]g;
if ($step =~ /^_/) {
$self->stash->{"forbidden_step"} = $step;
push @path, $self->forbidden_step;
}
elsif ($self->valid_steps and not $self->valid_steps->{$step} and $step ne $self->default_step and $step ne $self->js_step) {
$self->stash->{"forbidden_step"} = $step;
push @path, $self->forbidden_step;
}
else {
push @path, $step;
};
};
\@path
}
MC/DC0%0/2
$self->{"path"} ||= do {
my @path;
$self->parse_path_info("path_info_map_base", $self->path_info_map_base);
my $step = $self->form->{$self->step_key};
if (defined $step) {
$step =~ s[^/+][];
$step =~ s[/][__]g;
if ($step =~ /^_/) {
$self->stash->{"forbidden_step"} = $step;
push @path, $self->forbidden_step;
}
elsif ($self->valid_steps and not $self->valid_steps->{$step} and $step ne $self->default_step and $step ne $self->js_step) {
$self->stash->{"forbidden_step"} = $step;
push @path, $self->forbidden_step;
}
else {
push @path, $step;
};
};
\@path
}
$self->{"path"}
do {
my @path;
$self->parse_path_info("path_info_map_base", $self->path_info_map_base);
my $step = $self->form->{$self->step_key};
if (defined $step) {
$step =~ s[^/+][];
$step =~ s[/][__]g;
if ($step =~ /^_/) {
$self->stash->{"forbidden_step"} = $step;
push @path, $self->forbidden_step;
}
elsif ($self->valid_steps and not $self->valid_steps->{$step} and $step ne $self->default_step and $step ne $self->js_step) {
$self->stash->{"forbidden_step"} = $step;
push @path, $self->forbidden_step;
}
else {
push @path, $step;
};
};
\@path
}
Truth table66%2/3
A ||= B
A= $self->{"path"}B= do {
my @path;
$self->parse_path_info("path_info_map_base", $self->path_info_map_base);
my $step = $self->form->{$self->step_key};
if (defined $step) {
$step =~ s[^/+][];
$step =~ s[/][__]g;
if ($step =~ /^_/) {
$self->stash->{"forbidden_step"} = $step;
push @path, $self->forbidden_step;
}
elsif ($self->valid_steps and not $self->valid_steps->{$step} and $step ne $self->default_step and $step ne $self->js_step) {
$self->stash->{"forbidden_step"} = $step;
push @path, $self->forbidden_step;
}
else {
push @path, $step;
};
};
\@path
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 80 | my @path; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 80 | $self->parse_path_info('path_info_map_base', $self->path_info_map_base); # add initial items to the form hash from path_info | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 76 | my $step = $self->form->{$self->step_key}; # make sure the step is valid | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 76 | ▶ | if (defined $step) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 41 | $step =~ s|^/+||; $step =~ s|/|__|g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 41 | ▶ | if ($step =~ /^_/) { # can't begin with _ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 1 | $self->stash->{'forbidden_step'} = $step; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 1 | push @path, $self->forbidden_step; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | ▶ | } elsif ($self->valid_steps # must be in valid_steps if defined | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%9/9
$self->valid_steps and not $self->valid_steps->{$step} and $step ne $self->default_step and $step ne $self->js_step
$self->valid_steps and not $self->valid_steps->{$step} and $step ne $self->default_step
$self->valid_steps and not $self->valid_steps->{$step}
MC/DC100%4/4
$self->valid_steps and not $self->valid_steps->{$step} and $step ne $self->default_step and $step ne $self->js_step
$self->valid_steps
not $self->valid_steps->{$step}
$step ne $self->default_step
$step ne $self->js_step
Truth table100%5/5
A and not(B) and C and D
A= $self->valid_stepsB= not $self->valid_steps->{$step}C= $step ne $self->default_stepD= $step ne $self->js_step
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | && ! $self->valid_steps->{$step} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | && $step ne $self->default_step | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | && $step ne $self->js_step) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 1 | $self->stash->{'forbidden_step'} = $step; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 1 | push @path, $self->forbidden_step; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 39 | push @path, $step; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 76 | \@path; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | sub parse_path_info { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 197 | ▶ | my ($self, $type, $maps, $info, $form) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_path_info: called CC=11 SCAR=24.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 197 | ▶ | return if !$maps; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 88 | ▶ | $info ||= $self->path_info || return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition80%4/5
$info ||= $self->path_info || (return)
$self->path_info || (return)
MC/DC50%1/2
$info ||= $self->path_info || (return)
$info
$self->path_info
Truth table66%2/3
A ||= B
A= $infoB= $self->path_info
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 18 | ▶ | croak "Usage: sub $type { [] }" if ! UNIVERSAL::isa($maps, 'ARRAY'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 15 | foreach my $map (@$maps) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 12 | ▶ | croak "Usage: sub $type { [[qr{/path_info/(\\w+)}, 'keyname']] }" if ! UNIVERSAL::isa($map, 'ARRAY'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 9 | ▶ | my @match = $info =~ $map->[0] or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 6 | ▶ | $form ||= $self->form; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$form ||= $self->form
MC/DC0%0/2
$form ||= $self->form
$form
$self->form
Truth table33%1/3
A ||= B
A= $formB= $self->form
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 6 | ▶ | if (UNIVERSAL::isa($map->[1], 'CODE')) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 1 | $map->[1]->($form, @match); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 5 | $form->{$map->[$_]} = $match[$_ - 1] foreach grep {! defined $form->{$map->[$_]}} 1 .. $#$map; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 6 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | sub run_hook { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 2545 | ▶ | my ($self, $hook, $step, @args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run_hook: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 2545 | ▶ | my ($code, $found) = (ref $hook eq 'CODE') ? ($_[1], $hook = 'coderef') : ($self->find_hook($hook, $step)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 2545 | ▶ | croak "Could not find a method named ${step}_${hook} or ${hook}" if ! $code; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 2544 | ▶ | return scalar $self->$code($step, @args) if !$self->{'no_history'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 31 | push @{ $self->history }, my $hist = {step => $step, meth => $hook, found => $found, time => time, level => $self->{'_level'}, elapsed => 0}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 31 | ▶ | local $self->{'_level'} = 1 + ($self->{'_level'} || 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{'_level'} || 0
MC/DC100%1/1
$self->{'_level'} || 0
$self->{'_level'}
Truth table100%2/2
A
A= $self->{'_level'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 31 | $hist->{'elapsed'} = time - $hist->{'time'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 31 | return $hist->{'response'} = $self->$code($step, @args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | sub find_hook { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 2545 | ▶ | my ($self, $hook, $step) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
find_hook: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 2545 | ▶ | croak "Missing hook name" if ! $hook; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 2544 | ▶ | if ($step and my $code = $self->can("${step}_${hook}")) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
$step and my $code = $self->can("${step}_$hook")
MC/DC100%2/2
$step and my $code = $self->can("${step}_$hook")
$step
my $code = $self->can("${step}_$hook")
Truth table100%3/3
A and B
A= $stepB= my $code = $self->can("${step}_$hook")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 311 | return ($code, "${step}_${hook}"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | } elsif ($code = $self->can($hook)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 2232 | return ($code, $hook); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | sub run_hook_as { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 3 | ▶ | my ($self, $hook, $step, $pkg, @args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run_hook_as: called CC=4 SCAR=14.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 3 | ▶ | croak "Missing hook" if ! $hook; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 3 | ▶ | croak "Missing step" if ! $step; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 3 | ▶ | croak "Missing package" if ! $pkg; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 3 | $self->morph($step, 2, $pkg); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 3 | my $resp = $self->run_hook($hook, $step, @args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 3 | $self->unmorph; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 3 | return $resp; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | sub run_step { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 111 | ▶ | my ($self, $step) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run_step: called CC=7 SCAR=19.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 111 | ▶ | return 1 if $self->run_hook('pre_step', $step); # if true exit the nav_loop | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 109 | ▶ | return 0 if $self->run_hook('skip', $step); # if true skip this step | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | # check for complete valid information for this step | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 101 | ▶ | if ( ! $self->run_hook('prepare', $step) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
$self->run_hook("prepare", $step) and $self->run_hook("info_complete", $step) and $self->run_hook("finalize", $step)
$self->run_hook("prepare", $step) and $self->run_hook("info_complete", $step)
MC/DC100%3/3
$self->run_hook("prepare", $step) and $self->run_hook("info_complete", $step) and $self->run_hook("finalize", $step)
$self->run_hook("prepare", $step)
$self->run_hook("info_complete", $step)
$self->run_hook("finalize", $step)
Truth table100%4/4
A and B and C
A= $self->run_hook("prepare", $step)B= $self->run_hook("info_complete", $step)C= $self->run_hook("finalize", $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | || ! $self->run_hook('info_complete', $step) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | || ! $self->run_hook('finalize', $step)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 73 | $self->run_hook('prepared_print', $step); # show the page requesting the information | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 72 | $self->run_hook('post_print', $step); # a hook after the printing process | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 72 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 28 | ▶ | return 1 if $self->run_hook('post_step', $step); # if true exit the nav_loop | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 27 | return 0; # let the nav_loop continue searching the path | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | sub prepared_print { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 73 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prepared_print: called CC=9 SCAR=22.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 73 | my $step = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 73 | ▶ | my $hash_form = $self->run_hook('hash_form', $step) || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->run_hook('hash_form', $step) || {}
MC/DC100%1/1
$self->run_hook('hash_form', $step) || {}
$self->run_hook('hash_form', $step)
Truth table100%2/2
A
A= $self->run_hook('hash_form', $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 73 | ▶ | my $hash_base = $self->run_hook('hash_base', $step) || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->run_hook('hash_base', $step) || {}
MC/DC100%1/1
$self->run_hook('hash_base', $step) || {}
$self->run_hook('hash_base', $step)
Truth table100%2/2
A
A= $self->run_hook('hash_base', $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 73 | ▶ | my $hash_comm = $self->run_hook('hash_common', $step) || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->run_hook('hash_common', $step) || {}
MC/DC100%1/1
$self->run_hook('hash_common', $step) || {}
$self->run_hook('hash_common', $step)
Truth table100%2/2
A
A= $self->run_hook('hash_common', $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 73 | ▶ | my $hash_swap = $self->run_hook('hash_swap', $step) || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->run_hook('hash_swap', $step) || {}
MC/DC100%1/1
$self->run_hook('hash_swap', $step) || {}
$self->run_hook('hash_swap', $step)
Truth table100%2/2
A
A= $self->run_hook('hash_swap', $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 72 | ▶ | my $hash_fill = $self->run_hook('hash_fill', $step) || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->run_hook('hash_fill', $step) || {}
MC/DC100%1/1
$self->run_hook('hash_fill', $step) || {}
$self->run_hook('hash_fill', $step)
Truth table100%2/2
A
A= $self->run_hook('hash_fill', $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 72 | ▶ | my $hash_errs = $self->run_hook('hash_errors', $step) || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->run_hook('hash_errors', $step) || {}
MC/DC100%1/1
$self->run_hook('hash_errors', $step) || {}
$self->run_hook('hash_errors', $step)
Truth table100%2/2
A
A= $self->run_hook('hash_errors', $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 72 | $hash_errs->{$_} = $self->format_error($hash_errs->{$_}) foreach keys %$hash_errs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 72 | ▶ | $hash_errs->{'has_errors'} = 1 if scalar keys %$hash_errs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 72 | my $swap = {%$hash_form, %$hash_base, %$hash_comm, %$hash_swap, %$hash_errs}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 72 | my $fill = {%$hash_form, %$hash_base, %$hash_comm, %$hash_fill}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 72 | $self->run_hook('print', $step, $swap, $fill); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | sub print { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 72 | ▶ | my ($self, $step, $swap, $fill) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
print: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 72 | my $file = $self->run_hook('file_print', $step); # get a filename relative to template_path | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 72 | my $out = $self->run_hook('swap_template', $step, $file, $swap); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 72 | $self->run_hook('fill_template', $step, \$out, $fill); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 72 | $self->run_hook('print_out', $step, \$out); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | sub handle_error { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 8 | ▶ | my ($self, $err) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handle_error: called CC=5 SCAR=17.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 8 | ▶ | die $err if $self->{'_handling_error'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 8 | local @$self{'_handling_error', '_recurse' } = (1, 0); # allow for this next step - even if we hit a recurse error | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 8 | $self->stash->{'error_step'} = $self->current_step; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 6 | $self->stash->{'error'} = $err; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 6 | eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 6 | my $step = $self->error_step; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 6 | $self->morph($step); # let steps be in external modules | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 6 | ▶ | $self->run_hook('run_step', $step) && $self->unmorph($step); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 6 | ▶ | die $@ if $@ && $@ ne "Long Jump\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$@ and $@ ne "Long Jump\n"
MC/DC0%0/2
$@ and $@ ne "Long Jump\n"
$@
$@ ne "Long Jump\n"
Truth table33%1/3
A and B
A= $@B= $@ ne "Long Jump\n"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | ###---------------------### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | # read only accessors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 117 | ▶ | sub allow_morph { $_[0]->{'allow_morph'} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
allow_morph: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 2 | ▶ | sub auth_args { $_[0]->{'auth_args'} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
auth_args: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 11 | ▶ | sub auth_obj { shift->{'auth_obj'} || do { require CGI::Ex::Auth; CGI::Ex::Auth->new(@_) } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
auth_obj: called CC=2 SCAR=7.1
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 5 | ▶ | sub charset { $_[0]->{'charset'} || '' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
charset: called CC=2 SCAR=6.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 5 | ▶ | sub conf_args { $_[0]->{'conf_args'} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
conf_args: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 2 | ▶ | sub conf_die_on_fail { $_[0]->{'conf_die_on_fail'} || ! defined $_[0]->{'conf_die_on_fail'} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
conf_die_on_fail: called CC=2 SCAR=6.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 3 | ▶ | sub conf_path { $_[0]->{'conf_path'} || $_[0]->base_dir_abs } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
conf_path: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 4 | ▶ | sub conf_validation { $_[0]->{'conf_validation'} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
conf_validation: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 60 | ▶ | sub default_step { $_[0]->{'default_step'} || 'main' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
default_step: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 8 | ▶ | sub error_step { $_[0]->{'error_step'} || '__error' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
error_step: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 71 | ▶ | sub fill_args { $_[0]->{'fill_args'} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fill_args: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 5 | ▶ | sub forbidden_step { $_[0]->{'forbidden_step'} || '__forbidden' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
forbidden_step: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 79 | ▶ | sub form_name { $_[0]->{'form_name'} || 'theform' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
form_name: called CC=2 SCAR=7.6
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 519 | ▶ | sub history { $_[0]->{'history'} ||= [] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
history: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
$_[0]{"history"} ||= []
MC/DC100%1/1
$_[0]{"history"} ||= []
$_[0]{"history"}
Truth table100%2/2
A
A= $_[0]{"history"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 18 | ▶ | sub js_step { $_[0]->{'js_step'} || 'js' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
js_step: called CC=2 SCAR=6.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 9 | ▶ | sub login_step { $_[0]->{'login_step'} || '__login' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
login_step: called CC=2 SCAR=6.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 5 | ▶ | sub mimetype { $_[0]->{'mimetype'} || 'text/html' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mimetype: called CC=2 SCAR=6.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 173 | ▶ | sub path_info { $_[0]->{'path_info'} || $ENV{'PATH_INFO'} || '' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
path_info: called CC=3 SCAR=11.0
Pod
undocumented
Branch: 1 branch
Condition100%3/3
$_[0]{"path_info"} or $ENV{"PATH_INFO"}
MC/DC100%2/2
$_[0]{"path_info"} or $ENV{"PATH_INFO"}
$_[0]{"path_info"}
$ENV{"PATH_INFO"}
Truth table100%3/3
A or B
A= $_[0]{"path_info"}B= $ENV{"PATH_INFO"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 80 | ▶ | sub path_info_map_base { $_[0]->{'path_info_map_base'} ||[[qr{/(\w+)}, $_[0]->step_key]] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
path_info_map_base: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 155 | ▶ | sub recurse_limit { $_[0]->{'recurse_limit'} || 15 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
recurse_limit: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 116 | ▶ | sub script_name { $_[0]->{'script_name'} || $ENV{'SCRIPT_NAME'} || $0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
script_name: called CC=3 SCAR=11.0
Pod
undocumented
Branch: 1 branch
Condition100%3/3
$_[0]{"script_name"} or $ENV{"SCRIPT_NAME"}
MC/DC100%2/2
$_[0]{"script_name"} or $ENV{"SCRIPT_NAME"}
$_[0]{"script_name"}
$ENV{"SCRIPT_NAME"}
Truth table100%3/3
A or B
A= $_[0]{"script_name"}B= $ENV{"SCRIPT_NAME"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 24 | ▶ | sub stash { $_[0]->{'stash'} ||= {} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
stash: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
$_[0]{"stash"} ||= {}
MC/DC100%1/1
$_[0]{"stash"} ||= {}
$_[0]{"stash"}
Truth table100%2/2
A
A= $_[0]{"stash"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 224 | ▶ | sub step_key { $_[0]->{'step_key'} || 'step' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
step_key: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 74 | ▶ | sub template_args { $_[0]->{'template_args'} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
template_args: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 73 | ▶ | sub template_obj { shift->{'template_obj'} || do { require Template::Alloy; Template::Alloy->new(@_) } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
template_obj: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | 78 | ▶ | sub template_path { $_[0]->{'template_path'} || $_[0]->base_dir_abs } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
template_path: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 16 | ▶ | sub val_args { $_[0]->{'val_args'} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
val_args: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 10 | ▶ | sub val_path { $_[0]->{'val_path'} || $_[0]->template_path } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
val_path: called CC=2 SCAR=6.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | sub conf_obj { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 4 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
conf_obj: called CC=5 SCAR=16.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 4 | ▶ | return $self->{'conf_obj'} || do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$self->{'conf_obj'} || do {
my $args = $self->conf_args || {};
$args->{'paths'} ||= $self->conf_path;
$args->{'directive'} ||= 'MERGE';
require CGI::Ex::Conf;
'CGI::Ex::Conf'->new($args)
}
MC/DC0%0/2
$self->{'conf_obj'} || do {
my $args = $self->conf_args || {};
$args->{'paths'} ||= $self->conf_path;
$args->{'directive'} ||= 'MERGE';
require CGI::Ex::Conf;
'CGI::Ex::Conf'->new($args)
}
$self->{'conf_obj'}
do {
my $args = $self->conf_args || {};
$args->{'paths'} ||= $self->conf_path;
$args->{'directive'} ||= 'MERGE';
require CGI::Ex::Conf;
'CGI::Ex::Conf'->new($args)
}
Truth table66%2/3
A || B
A= $self->{'conf_obj'}B= do {
my $args = $self->conf_args || {};
$args->{'paths'} ||= $self->conf_path;
$args->{'directive'} ||= 'MERGE';
require CGI::Ex::Conf;
'CGI::Ex::Conf'->new($args)
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 3 | ▶ | my $args = $self->conf_args || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->conf_args || {}
MC/DC100%1/1
$self->conf_args || {}
$self->conf_args
Truth table100%2/2
A
A= $self->conf_args
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 3 | ▶ | $args->{'paths'} ||= $self->conf_path; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$args->{"paths"} ||= $self->conf_path
MC/DC0%0/2
$args->{"paths"} ||= $self->conf_path
$args->{"paths"}
$self->conf_path
Truth table66%2/3
A ||= B
A= $args->{"paths"}B= $self->conf_path
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 3 | ▶ | $args->{'directive'} ||= 'MERGE'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$args->{"directive"} ||= "MERGE"
MC/DC100%1/1
$args->{"directive"} ||= "MERGE"
$args->{"directive"}
Truth table100%2/2
A
A= $args->{"directive"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 3 | require CGI::Ex::Conf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 3 | CGI::Ex::Conf->new($args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | sub val_obj { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 15 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
val_obj: called CC=4 SCAR=14.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 15 | ▶ | return $self->{'val_obj'} || do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$self->{'val_obj'} || do {
my $args = $self->val_args || {};
$args->{'cgix'} ||= $self->cgix;
require CGI::Ex::Validate;
'CGI::Ex::Validate'->new($args)
}
MC/DC0%0/2
$self->{'val_obj'} || do {
my $args = $self->val_args || {};
$args->{'cgix'} ||= $self->cgix;
require CGI::Ex::Validate;
'CGI::Ex::Validate'->new($args)
}
$self->{'val_obj'}
do {
my $args = $self->val_args || {};
$args->{'cgix'} ||= $self->cgix;
require CGI::Ex::Validate;
'CGI::Ex::Validate'->new($args)
}
Truth table66%2/3
A || B
A= $self->{'val_obj'}B= do {
my $args = $self->val_args || {};
$args->{'cgix'} ||= $self->cgix;
require CGI::Ex::Validate;
'CGI::Ex::Validate'->new($args)
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 14 | ▶ | my $args = $self->val_args || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->val_args || {}
MC/DC100%1/1
$self->val_args || {}
$self->val_args
Truth table100%2/2
A
A= $self->val_args
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 14 | ▶ | $args->{'cgix'} ||= $self->cgix; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$args->{"cgix"} ||= $self->cgix
MC/DC0%0/2
$args->{"cgix"} ||= $self->cgix
$args->{"cgix"}
$self->cgix
Truth table66%2/3
A ||= B
A= $args->{"cgix"}B= $self->cgix
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 14 | require CGI::Ex::Validate; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 14 | CGI::Ex::Validate->new($args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | ###---------------------### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | # read/write accessors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 143 | ▶ | sub auth_data { (@_ == 2) ? $_[0]->{'auth_data'} = pop : $_[0]->{'auth_data'} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
auth_data: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 82 | ▶ | sub base_dir_abs { (@_ == 2) ? $_[0]->{'base_dir_abs'} = pop : $_[0]->{'base_dir_abs'} || ['.'] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
base_dir_abs: called CC=3 SCAR=11.0
Pod
documented
Branch: 1 branch
Condition100%2/2
$_[0]{"base_dir_abs"} or ["."]
MC/DC100%1/1
$_[0]{"base_dir_abs"} or ["."]
$_[0]{"base_dir_abs"}
Truth table100%2/2
A
A= $_[0]{"base_dir_abs"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 19 | ▶ | sub base_dir_rel { (@_ == 2) ? $_[0]->{'base_dir_rel'} = pop : $_[0]->{'base_dir_rel'} || '' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
base_dir_rel: called CC=3 SCAR=11.0
Pod
documented
Branch: 1 branch
Condition100%2/2
$_[0]{"base_dir_rel"} or ""
MC/DC100%1/1
$_[0]{"base_dir_rel"} or ""
$_[0]{"base_dir_rel"}
Truth table100%2/2
A
A= $_[0]{"base_dir_rel"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 14 | ▶ | sub cgix { (@_ == 2) ? $_[0]->{'cgix'} = pop : $_[0]->{'cgix'} ||= do { require CGI::Ex; CGI::Ex->new } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cgix: called CC=3 SCAR=11.0
Pod
undocumented
Branch: 1 branch
Condition66%2/3
@_ == 2 ? $_[0]{"cgix"} = pop() : $_[0]{"cgix"} ||= do {
require CGI::Ex;
"CGI::Ex"->new
}
MC/DC0%0/2
@_ == 2 ? $_[0]{"cgix"} = pop() : $_[0]{"cgix"} ||= do {
require CGI::Ex;
"CGI::Ex"->new
}
@_ == 2 ? $_[0]{"cgix"} = pop() : $_[0]{"cgix"}
do {
require CGI::Ex;
"CGI::Ex"->new
}
Truth table66%2/3
A ||= B
A= @_ == 2 ? $_[0]{"cgix"} = pop() : $_[0]{"cgix"}B= do {
require CGI::Ex;
"CGI::Ex"->new
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 3 | ▶ | sub cookies { (@_ == 2) ? $_[0]->{'cookies'} = pop : $_[0]->{'cookies'} ||= $_[0]->cgix->get_cookies } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cookies: called CC=3 SCAR=12.0
Pod
documented
Branch: 1 branch
Condition33%1/3
@_ == 2 ? $_[0]{"cookies"} = pop() : $_[0]{"cookies"} ||= $_[0]->cgix->get_cookies
MC/DC0%0/2
@_ == 2 ? $_[0]{"cookies"} = pop() : $_[0]{"cookies"} ||= $_[0]->cgix->get_cookies
@_ == 2 ? $_[0]{"cookies"} = pop() : $_[0]{"cookies"}
$_[0]->cgix->get_cookies
Truth table33%1/3
A ||= B
A= @_ == 2 ? $_[0]{"cookies"} = pop() : $_[0]{"cookies"}B= $_[0]->cgix->get_cookies
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 6 | ▶ | sub ext_conf { (@_ == 2) ? $_[0]->{'ext_conf'} = pop : $_[0]->{'ext_conf'} || 'pl' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
ext_conf: called CC=3 SCAR=11.0
Pod
documented
Branch: 1 branch
Condition100%2/2
$_[0]{"ext_conf"} or "pl"
MC/DC100%1/1
$_[0]{"ext_conf"} or "pl"
$_[0]{"ext_conf"}
Truth table100%2/2
A
A= $_[0]{"ext_conf"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 7 | ▶ | sub ext_print { (@_ == 2) ? $_[0]->{'ext_print'} = pop : $_[0]->{'ext_print'} || 'html' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
ext_print: called CC=3 SCAR=11.0
Pod
documented
Branch: 1 branch
Condition100%2/2
$_[0]{"ext_print"} or "html"
MC/DC100%1/1
$_[0]{"ext_print"} or "html"
$_[0]{"ext_print"}
Truth table100%2/2
A
A= $_[0]{"ext_print"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 11 | ▶ | sub ext_val { (@_ == 2) ? $_[0]->{'ext_val'} = pop : $_[0]->{'ext_val'} || 'val' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
ext_val: called CC=3 SCAR=11.0
Pod
documented
Branch: 1 branch
Condition100%2/2
$_[0]{"ext_val"} or "val"
MC/DC100%1/1
$_[0]{"ext_val"} or "val"
$_[0]{"ext_val"}
Truth table100%2/2
A
A= $_[0]{"ext_val"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 11 | ▶ | sub form { (@_ == 2) ? $_[0]->{'form'} = pop : $_[0]->{'form'} ||= $_[0]->cgix->get_form } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
form: called CC=3 SCAR=11.1
Pod
documented
Branch: 1 branch
Condition66%2/3
@_ == 2 ? $_[0]{"form"} = pop() : $_[0]{"form"} ||= $_[0]->cgix->get_form
MC/DC0%0/2
@_ == 2 ? $_[0]{"form"} = pop() : $_[0]{"form"} ||= $_[0]->cgix->get_form
@_ == 2 ? $_[0]{"form"} = pop() : $_[0]{"form"}
$_[0]->cgix->get_form
Truth table66%2/3
A ||= B
A= @_ == 2 ? $_[0]{"form"} = pop() : $_[0]{"form"}B= $_[0]->cgix->get_form
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 195 | ▶ | sub load_conf { (@_ == 2) ? $_[0]->{'load_conf'} = pop : $_[0]->{'load_conf'} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
load_conf: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | sub conf { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 8 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
conf: called CC=9 SCAR=22.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 8 | ▶ | $self->{'conf'} = pop if @_ == 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 8 | ▶ | return $self->{'conf'} ||= do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$self->{"conf"} ||= do {
my $conf = $self->conf_file;
$conf = $self->conf_obj->read($conf, {"no_warn_on_fail", 1}) || ($self->conf_die_on_fail ? croak($@) : {}) unless ref $conf;
my $hash = $self->conf_validation;
if ($hash and scalar keys %$hash) {
my $err_obj = $self->val_obj->validate($conf, $hash);
croak("$err_obj") if $err_obj;
};
$conf
}
MC/DC0%0/2
$self->{"conf"} ||= do {
my $conf = $self->conf_file;
$conf = $self->conf_obj->read($conf, {"no_warn_on_fail", 1}) || ($self->conf_die_on_fail ? croak($@) : {}) unless ref $conf;
my $hash = $self->conf_validation;
if ($hash and scalar keys %$hash) {
my $err_obj = $self->val_obj->validate($conf, $hash);
croak("$err_obj") if $err_obj;
};
$conf
}
$self->{"conf"}
do {
my $conf = $self->conf_file;
$conf = $self->conf_obj->read($conf, {"no_warn_on_fail", 1}) || ($self->conf_die_on_fail ? croak($@) : {}) unless ref $conf;
my $hash = $self->conf_validation;
if ($hash and scalar keys %$hash) {
my $err_obj = $self->val_obj->validate($conf, $hash);
croak("$err_obj") if $err_obj;
};
$conf
}
Truth table66%2/3
A ||= B
A= $self->{"conf"}B= do {
my $conf = $self->conf_file;
$conf = $self->conf_obj->read($conf, {"no_warn_on_fail", 1}) || ($self->conf_die_on_fail ? croak($@) : {}) unless ref $conf;
my $hash = $self->conf_validation;
if ($hash and scalar keys %$hash) {
my $err_obj = $self->val_obj->validate($conf, $hash);
croak("$err_obj") if $err_obj;
};
$conf
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 4 | my $conf = $self->conf_file; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 4 | ▶ | $conf = $self->conf_obj->read($conf, {no_warn_on_fail => 1}) || ($self->conf_die_on_fail ? croak $@ : {}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
$self->conf_obj->read($conf, {'no_warn_on_fail', 1}) || ($self->conf_die_on_fail ? croak($@) : {})
MC/DC0%0/2
$self->conf_obj->read($conf, {'no_warn_on_fail', 1}) || ($self->conf_die_on_fail ? croak($@) : {})
$self->conf_obj->read($conf, {'no_warn_on_fail', 1})
($self->conf_die_on_fail ? croak($@) : {})
Truth table33%1/3
A || B
A= $self->conf_obj->read($conf, {'no_warn_on_fail', 1})B= ($self->conf_die_on_fail ? croak($@) : {})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | if ! ref $conf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 3 | my $hash = $self->conf_validation; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | 3 | ▶ | if ($hash && scalar keys %$hash) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$hash and scalar keys %$hash
MC/DC100%1/1
$hash and scalar keys %$hash
$hash
Truth table100%2/2
A
A= $hash
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 2 | my $err_obj = $self->val_obj->validate($conf, $hash); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | 2 | ▶ | croak "$err_obj" if $err_obj; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 2 | $conf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | sub conf_file { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 10 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
conf_file: called CC=4 SCAR=14.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | 10 | ▶ | $self->{'conf_file'} = pop if @_ == 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 10 | ▶ | return $self->{'conf_file'} ||= do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$self->{"conf_file"} ||= do {
my $module = $self->name_module || croak("Missing name_module during conf_file call");
$module . '.' . $self->ext_conf
}
MC/DC0%0/2
$self->{"conf_file"} ||= do {
my $module = $self->name_module || croak("Missing name_module during conf_file call");
$module . '.' . $self->ext_conf
}
$self->{"conf_file"}
do {
my $module = $self->name_module || croak("Missing name_module during conf_file call");
$module . '.' . $self->ext_conf
}
Truth table66%2/3
A ||= B
A= $self->{"conf_file"}B= do {
my $module = $self->name_module || croak("Missing name_module during conf_file call");
$module . '.' . $self->ext_conf
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | 4 | ▶ | my $module = $self->name_module || croak 'Missing name_module during conf_file call'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$self->name_module || croak('Missing name_module during conf_file call')
MC/DC0%0/2
$self->name_module || croak('Missing name_module during conf_file call')
$self->name_module
croak('Missing name_module during conf_file call')
Truth table33%1/3
A || B
A= $self->name_moduleB= croak('Missing name_module during conf_file call')
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 3 | $module .'.'. $self->ext_conf; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | ###---------------------### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | # general methods | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | 2 | ▶ | sub add_to_base { my $self = shift; $self->add_to_hash($self->hash_base, @_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_to_base: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | 2 | ▶ | sub add_to_common { my $self = shift; $self->add_to_hash($self->hash_common, @_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_to_common: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 3 | ▶ | sub add_to_errors { shift->add_errors(@_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_to_errors: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | 2 | ▶ | sub add_to_fill { my $self = shift; $self->add_to_hash($self->hash_fill, @_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_to_fill: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 2 | ▶ | sub add_to_form { my $self = shift; $self->add_to_hash($self->hash_form, @_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_to_form: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 1 | ▶ | sub add_to_path { shift->append_path(@_) } # legacy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_to_path: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | 2 | ▶ | sub add_to_swap { my $self = shift; $self->add_to_hash($self->hash_swap, @_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_to_swap: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 7 | ▶ | sub append_path { my $self = shift; push @{ $self->path }, @_ } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
append_path: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 3 | ▶ | sub cleanup_user { my ($self, $user) = @_; $user } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cleanup_user: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | 10 | ▶ | sub current_step { $_[0]->step_by_path_index($_[0]->{'path_i'} || 0) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
current_step: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
$_[0]{'path_i'} || 0
MC/DC100%1/1
$_[0]{'path_i'} || 0
$_[0]{'path_i'}
Truth table100%2/2
A
A= $_[0]{'path_i'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | ▶ | sub destroy {} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
destroy: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 2 | ▶ | sub first_step { $_[0]->step_by_path_index(0) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
first_step: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | ▶ | sub fixup_after_morph {} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fixup_after_morph: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | ▶ | sub fixup_before_unmorph {} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fixup_before_unmorph: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 8 | ▶ | sub format_error { my ($self, $error) = @_; $error } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
format_error: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 1 | ▶ | sub get_pass_by_user { croak "get_pass_by_user is a virtual method and needs to be overridden for authentication to work" } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_pass_by_user: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 1 | ▶ | sub has_errors { scalar keys %{ $_[0]->hash_errors } } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_errors: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 2 | ▶ | sub last_step { $_[0]->step_by_path_index($#{ $_[0]->path }) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
last_step: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | ▶ | sub path_info_map {} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
path_info_map: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 56 | ▶ | sub post_loop { 0 } # true value means to abort the nav_loop - don't recurse | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
post_loop: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | ▶ | sub post_navigate {} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
post_navigate: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | 148 | ▶ | sub pre_loop { 0 } # true value means to abort the nav_loop routine | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pre_loop: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | 73 | ▶ | sub pre_navigate { 0 } # true means to not enter nav_loop | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pre_navigate: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 3 | ▶ | sub previous_step { $_[0]->step_by_path_index(($_[0]->{'path_i'} || 0) - 1) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
previous_step: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
$_[0]{'path_i'} || 0
MC/DC100%1/1
$_[0]{'path_i'} || 0
$_[0]{'path_i'}
Truth table100%2/2
A
A= $_[0]{'path_i'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | ▶ | sub valid_steps {} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
valid_steps: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | 3 | ▶ | sub verify_user { 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
verify_user: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | sub add_errors { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 7 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_errors: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 7 | my $hash = $self->hash_errors; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | 7 | ▶ | my $args = ref($_[0]) ? shift : {@_}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 7 | foreach my $key (keys %$args) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 7 | ▶ | my $_key = ($key =~ /error$/) ? $key : "${key}_error"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 7 | ▶ | if ($hash->{$_key}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 1 | $hash->{$_key} .= '<br>' . $args->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | 6 | $hash->{$_key} = $args->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | 7 | $hash->{'has_errors'} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | sub add_to_hash { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 10 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_to_hash: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | 10 | my $old = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 10 | ▶ | my $new = ref($_[0]) ? shift : {@_}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | 10 | @$old{keys %$new} = values %$new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | sub clear_app { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | 1 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
clear_app: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | 1 | delete @$self{qw(cgix cookies form hash_common hash_errors hash_fill hash_swap history | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | _morph_lineage _morph_lineage_start_index path path_i stash val_obj)}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | 1 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | sub dump_history { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | 3 | ▶ | my ($self, $all) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
dump_history: called CC=14 SCAR=26.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | 3 | my $hist = $self->history; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | 3 | my $dump = [sprintf "Elapsed: %.5f", time - $self->{'_time'}]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | 3 | foreach my $row (@$hist) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | 33 | ▶ | if (! ref($row) || ref($row) ne 'HASH' || ! exists $row->{'elapsed'}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
not ref $row or ref $row ne "HASH" or not exists $row->{"elapsed"}
not ref $row or ref $row ne "HASH"
MC/DC100%3/3
not ref $row or ref $row ne "HASH" or not exists $row->{"elapsed"}
not ref $row
ref $row ne "HASH"
not exists $row->{"elapsed"}
Truth table100%4/4
not(A) or B or not(C)
A= not ref $rowB= ref $row ne "HASH"C= not exists $row->{"elapsed"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | 9 | push @$dump, $row; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | 9 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | my $note = (' ' x ($row->{'level'} || 0)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 24 | ▶ | . join(' - ', $row->{'step'}, $row->{'meth'}, $row->{'found'}, sprintf '%.5f', $row->{'elapsed'}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$row->{'level'} || 0
MC/DC0%0/1
$row->{'level'} || 0
$row->{'level'}
Truth table50%1/2
A
A= $row->{'level'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 24 | my $resp = $row->{'response'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 24 | ▶ | if ($all) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | 16 | $note = [$note, $resp]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | 8 | ▶ | $note .= ' - ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition100%6/6
ref $resp eq "ARRAY" and not @$resp
ref $resp eq "HASH" and not scalar keys %$resp
MC/DC100%2/2
ref $resp eq "ARRAY" and not @$resp
ref $resp eq "ARRAY"
not @$resp
MC/DC100%2/2
ref $resp eq "HASH" and not scalar keys %$resp
ref $resp eq "HASH"
not scalar keys %$resp
Truth table100%3/3
A and not(B)
A= ref $resp eq "ARRAY"B= not @$resp
Truth table100%3/3
A and not(B)
A= ref $resp eq "HASH"B= not scalar keys %$resp
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | .(! defined $resp ? 'undef' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | : ref($resp) eq 'ARRAY' && !@$resp ? '[]' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | : ref($resp) eq 'HASH' && !scalar keys %$resp ? '{}' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | : $resp =~ /^(.{30}|.{0,30}(?=\n))(?s:.)/ ? "$1..." : $resp); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | 8 | ▶ | $note .= ' - '.$row->{'info'} if defined $row->{'info'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | 24 | push @$dump, $note; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | 3 | return $dump; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | sub exit_nav_loop { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | 14 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
exit_nav_loop: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | 14 | ▶ | if (my $ref = $self->{'_morph_lineage'}) { # undo morphs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | 2 | my $index = $self->{'_morph_lineage_start_index'}; # allow for early "morphers" to only get rolled back so far | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | 2 | ▶ | $index = -1 if ! defined $index; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | 2 | ▶ | $self->unmorph while $#$ref != $index; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | 14 | die "Long Jump\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | sub insert_path { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | 57 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
insert_path: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | 57 | my $ref = $self->path; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | 57 | ▶ | my $i = $self->{'path_i'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{'path_i'} || 0
MC/DC100%1/1
$self->{'path_i'} || 0
$self->{'path_i'}
Truth table100%2/2
A
A= $self->{'path_i'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | 57 | ▶ | if ($i + 1 > $#$ref) { push @$ref, @_ } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | 1 | else { splice(@$ref, $i + 1, 0, @_) } # insert a path at the current location | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | 9 | ▶ | sub jump { shift->goto_step(@_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
jump: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | sub goto_step { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | 20 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
goto_step: called CC=18 SCAR=28.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | 20 | ▶ | my $i = @_ == 1 ? shift : 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | 20 | my $path = $self->path; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | 20 | ▶ | my $path_i = $self->{'path_i'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{'path_i'} || 0
MC/DC100%1/1
$self->{'path_i'} || 0
$self->{'path_i'}
Truth table100%2/2
A
A= $self->{'path_i'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | 20 | ▶ | if ( $i eq 'FIRST' ) { $i = - $path_i - 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | 1 | elsif ($i eq 'LAST' ) { $i = $#$path - $path_i } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | 1 | elsif ($i eq 'NEXT' ) { $i = 1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | 1 | elsif ($i eq 'CURRENT' ) { $i = 0 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | 1 | elsif ($i eq 'PREVIOUS') { $i = -1 } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | elsif ($i !~ /^-?\d+/) { # look for a step by that name in the current remaining path | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | 11 | my $found; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | 11 | ▶ | for (my $j = $path_i; $j < @$path; $j++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | 16 | ▶ | if ($path->[$j] eq $i) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | 1 | $i = $j - $path_i; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | 1 | $found = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | 1 | last; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | 11 | ▶ | if (! $found) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | 10 | $self->replace_path($i); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | 10 | $i = $#$path; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | 20 | ▶ | croak "Invalid jump index ($i)" if $i !~ /^-?\d+$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 20 | my $cut_i = $path_i + $i; # manipulate the path to contain the new jump location | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | 20 | ▶ | my @replace = ($cut_i > $#$path) ? $self->default_step | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | : ($cut_i < 0) ? @$path | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | : @$path[$cut_i .. $#$path]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | 20 | $self->replace_path(@replace); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | 20 | ▶ | $self->{'jumps'} = ($self->{'jumps'} || 0) + 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{'jumps'} || 0
MC/DC100%1/1
$self->{'jumps'} || 0
$self->{'jumps'}
Truth table100%2/2
A
A= $self->{'jumps'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | 20 | $self->{'path_i'}++; # move along now that the path is updated | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | 20 | ▶ | my $lin = $self->{'_morph_lineage'} || []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{'_morph_lineage'} || []
MC/DC100%1/1
$self->{'_morph_lineage'} || []
$self->{'_morph_lineage'}
Truth table100%2/2
A
A= $self->{'_morph_lineage'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | 20 | ▶ | $self->unmorph if @$lin; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | 20 | $self->nav_loop; # recurse on the path | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | 12 | $self->exit_nav_loop; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | sub js_uri_path { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | 13 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
js_uri_path: called CC=3 SCAR=12.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | 13 | my $script = $self->script_name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | 13 | my $js_step = $self->js_step; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | 13 | ▶ | return ($self->can('path') == \&CGI::Ex::App::path | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->can("path") == \&CGI::Ex::App::path and $self->can("path_info_map_base") == \&CGI::Ex::App::path_info_map_base
MC/DC0%0/2
$self->can("path") == \&CGI::Ex::App::path and $self->can("path_info_map_base") == \&CGI::Ex::App::path_info_map_base
$self->can("path") == \&CGI::Ex::App::path
$self->can("path_info_map_base") == \&CGI::Ex::App::path_info_map_base
Truth table33%1/3
A and B
A= $self->can("path") == \&CGI::Ex::App::pathB= $self->can("path_info_map_base") == \&CGI::Ex::App::path_info_map_base
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | && $self->can('path_info_map_base') == \&CGI::Ex::App::path_info_map_base) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | ? $script .'/'. $js_step # try to use a cache friendly URI (if path is our own) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | : $script .'?'. $self->step_key .'='. $js_step .'&js='; # use one that works with more paths | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | sub morph { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | 133 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
morph: called CC=20 SCAR=30.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | 133 | my $ref = $self->history->[-1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | 133 | ▶ | if (! $ref || ! $ref->{'meth'} || $ref->{'meth'} ne 'morph') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
not $ref && $ref->{"meth"} or $ref->{"meth"} ne "morph"
$ref && $ref->{'meth'}
MC/DC66%2/3
not $ref && $ref->{"meth"} or $ref->{"meth"} ne "morph"
$ref
$ref->{'meth'}
$ref->{"meth"} ne "morph"
Truth table75%3/4
not(A && B) or C
A= $refB= $ref->{'meth'}C= $ref->{"meth"} ne "morph"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | 115 | push @{ $self->history }, ($ref = {meth => 'morph', found => 'morph', elapsed => 0, step => 'unknown', level => $self->{'_level'}}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | 133 | ▶ | my $step = shift || return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
shift() || (return)
MC/DC100%1/1
shift() || (return)
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | 132 | ▶ | my $allow = shift || $self->run_hook('allow_morph', $step) || return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%5/5
shift() || $self->run_hook('allow_morph', $step) || (return)
shift() or $self->run_hook("allow_morph", $step)
MC/DC100%2/2
shift() || $self->run_hook('allow_morph', $step) || (return)
shift()
$self->run_hook("allow_morph", $step)
Truth table100%3/3
A or B
A= shift()B= $self->run_hook("allow_morph", $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | 21 | my $new = shift; # optionally allow passing in the package to morph to | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | 21 | ▶ | my $lin = $self->{'_morph_lineage'} ||= []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{"_morph_lineage"} ||= []
MC/DC100%1/1
$self->{"_morph_lineage"} ||= []
$self->{"_morph_lineage"}
Truth table100%2/2
A
A= $self->{"_morph_lineage"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | 21 | my $ok = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | 21 | my $cur = ref $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | 21 | push @$lin, $cur; # store so subsequent unmorph calls can do the right thing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | # hash - but no step - record for unbless | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | 21 | ▶ | if (ref($allow) && ! ($allow = $allow->{$step})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition100%3/3
ref $allow and not $allow = $allow->{$step}
MC/DC100%2/2
ref $allow and not $allow = $allow->{$step}
ref $allow
not $allow = $allow->{$step}
Truth table100%3/3
A and not(B)
A= ref $allowB= not $allow = $allow->{$step}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | 1 | $ref->{'info'} = "not allowed to morph to that step"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | ▶ | } elsif (! ($new ||= $self->run_hook('morph_package', $step))) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$new ||= $self->run_hook("morph_package", $step)
MC/DC0%0/2
$new ||= $self->run_hook("morph_package", $step)
$new
$self->run_hook("morph_package", $step)
Truth table66%2/3
A ||= B
A= $newB= $self->run_hook("morph_package", $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | 0 | $ref->{'info'} = "Missing morph_package for step $step"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | } elsif ($cur eq $new) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | 2 | $ref->{'info'} = "already isa $new"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | 2 | $ok = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | ### if we are not already that package - bless us there | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | 18 | (my $file = "$new.pm") =~ s|::|/|g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | 18 | ▶ | if (UNIVERSAL::can($new, 'fixup_after_morph') # check if the package space exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition66%4/6
UNIVERSAL::can($new, "fixup_after_morph") or eval {
do {
require $file
}
} and UNIVERSAL::can($new, "fixup_after_morph")
eval {
do {
require $file
}
} and UNIVERSAL::can($new, "fixup_after_morph")
MC/DC33%1/3
UNIVERSAL::can($new, "fixup_after_morph") or eval {
do {
require $file
}
} and UNIVERSAL::can($new, "fixup_after_morph")
UNIVERSAL::can($new, "fixup_after_morph")
eval {
do {
require $file
}
}
UNIVERSAL::can($new, "fixup_after_morph")
Truth table75%3/4
A or B and C
A= UNIVERSAL::can($new, "fixup_after_morph")B= eval {
do {
require $file
}
}C= UNIVERSAL::can($new, "fixup_after_morph")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | 6 | || (eval { require $file } # check for a file that holds this package | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | && UNIVERSAL::can($new, 'fixup_after_morph'))) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | 12 | bless $self, $new; # become that package | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | 12 | $self->fixup_after_morph($step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | 12 | $ref->{'info'} = "changed $cur to $new"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | } elsif ($@) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | 5 | ▶ | if ($allow eq '1' && $@ =~ /^\s*(Can\'t locate \S+ in \@INC)/) { # let us know what happened | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$allow eq 1 and $@ =~ /^\s*(Can\'t locate \S+ in \@INC)/
MC/DC50%1/2
$allow eq 1 and $@ =~ /^\s*(Can\'t locate \S+ in \@INC)/
$allow eq 1
$@ =~ /^\s*(Can\'t locate \S+ in \@INC)/
Truth table66%2/3
A and B
A= $allow eq 1B= $@ =~ /^\s*(Can\'t locate \S+ in \@INC)/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | 4 | $ref->{'info'} = "failed from $cur to $new: $1"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | 1 | $ref->{'info'} = "failed from $cur to $new: $@"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | 1 | die "Trouble while morphing from $cur to $new: $@"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | } elsif ($allow ne '1') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | 1 | $ref->{'info'} = "package $new doesn't support CGI::Ex::App API"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | 1 | die "Found package $new, but $new does not support CGI::Ex::App API"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | 16 | $ok = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | 19 | return $ok; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | sub replace_path { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | 31 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
replace_path: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | 31 | my $ref = $self->path; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | 31 | ▶ | my $i = $self->{'path_i'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{'path_i'} || 0
MC/DC100%1/1
$self->{'path_i'} || 0
$self->{'path_i'}
Truth table100%2/2
A
A= $self->{'path_i'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | 31 | ▶ | if ($i + 1 > $#$ref) { push @$ref, @_; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | 18 | else { splice(@$ref, $i + 1, $#$ref - $i, @_); } # replace remaining entries | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | sub set_path { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | 3 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_path: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | 3 | ▶ | my $path = $self->{'path'} ||= []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{"path"} ||= []
MC/DC100%1/1
$self->{"path"} ||= []
$self->{"path"}
Truth table100%2/2
A
A= $self->{"path"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | 3 | ▶ | croak "Cannot call set_path after the navigation loop has begun" if $self->{'path_i'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | 2 | splice @$path, 0, $#$path + 1, @_; # change entries in the ref (which updates other copies of the ref) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | sub step_by_path_index { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | 45 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
step_by_path_index: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | 45 | ▶ | my $i = shift || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
shift() || 0
MC/DC100%1/1
shift() || 0
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | 45 | my $ref = $self->path; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | 43 | ▶ | return '' if $i < 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | 42 | return $ref->[$i]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | sub unmorph { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | 116 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
unmorph: called CC=10 SCAR=23.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | 116 | ▶ | my $step = shift || '_no_step'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
shift() || '_no_step'
MC/DC100%1/1
shift() || '_no_step'
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | 116 | ▶ | my $ref = $self->history->[-1] || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->history->[-1] || {}
MC/DC0%0/1
$self->history->[-1] || {}
$self->history->[-1]
Truth table50%1/2
A
A= $self->history->[-1]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | 116 | ▶ | if (! $ref || ! $ref->{'meth'} || $ref->{'meth'} ne 'unmorph') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
not $ref && $ref->{"meth"} or $ref->{"meth"} ne "unmorph"
$ref && $ref->{'meth'}
MC/DC33%1/3
not $ref && $ref->{"meth"} or $ref->{"meth"} ne "unmorph"
$ref
$ref->{'meth'}
$ref->{"meth"} ne "unmorph"
Truth table50%2/4
not(A && B) or C
A= $refB= $ref->{'meth'}C= $ref->{"meth"} ne "unmorph"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | 114 | push @{ $self->history }, ($ref = {meth => 'unmorph', found => 'unmorph', elapsed => 0, step => $step, level => $self->{'_level'}}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | 116 | ▶ | my $lin = $self->{'_morph_lineage'} || return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{'_morph_lineage'} || (return)
MC/DC100%1/1
$self->{'_morph_lineage'} || (return)
$self->{'_morph_lineage'}
Truth table100%2/2
A
A= $self->{'_morph_lineage'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | 19 | my $cur = ref $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | 19 | ▶ | my $prev = pop(@$lin) || croak "unmorph called more times than morph (current: $cur)"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
pop @$lin || croak("unmorph called more times than morph (current: $cur)")
MC/DC0%0/2
pop @$lin || croak("unmorph called more times than morph (current: $cur)")
pop @$lin
croak("unmorph called more times than morph (current: $cur)")
Truth table33%1/3
A || B
A= pop @$linB= croak("unmorph called more times than morph (current: $cur)")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | 19 | ▶ | delete $self->{'_morph_lineage'} if ! @$lin; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | 19 | ▶ | if ($cur ne $prev) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | 10 | $self->fixup_before_unmorph($step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | 10 | bless $self, $prev; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | 10 | $ref->{'info'} = "changed from $cur to $prev"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | 9 | $ref->{'info'} = "already isa $cur"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | 19 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | ###---------------------### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | # hooks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | sub file_print { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | 7 | ▶ | my ($self, $step) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
file_print: called CC=6 SCAR=18.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | 7 | my $base_dir = $self->base_dir_rel; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 598 | 7 | my $module = $self->run_hook('name_module', $step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | 7 | ▶ | my $_step = $self->run_hook('name_step', $step) || croak "Missing name_step"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$self->run_hook('name_step', $step) || croak('Missing name_step')
MC/DC0%0/2
$self->run_hook('name_step', $step) || croak('Missing name_step')
$self->run_hook('name_step', $step)
croak('Missing name_step')
Truth table33%1/3
A || B
A= $self->run_hook('name_step', $step)B= croak('Missing name_step')
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 600 | 6 | $_step =~ s|\B__+|/|g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 601 | 6 | ▶ | $_step .= '.'. $self->ext_print if $_step !~ /\.\w+$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 602 | 6 | ▶ | foreach ($base_dir, $module) { $_ .= '/' if length($_) && ! m|/$| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
length $_ and not m[/$]
MC/DC50%1/2
length $_ and not m[/$]
length $_
not m[/$]
Truth table66%2/3
A and not(B)
A= length $_B= not m[/$]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 603 | 6 | return $base_dir . $module . $_step; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 604 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | sub file_val { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 607 | 10 | ▶ | my ($self, $step) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
file_val: called CC=12 SCAR=24.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 608 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 609 | 10 | ▶ | my $abs = $self->val_path || []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->val_path || []
MC/DC100%1/1
$self->val_path || []
$self->val_path
Truth table100%2/2
A
A= $self->val_path
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 610 | 10 | ▶ | $abs = $abs->() if UNIVERSAL::isa($abs, 'CODE'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 611 | 10 | ▶ | $abs = [$abs] if ! UNIVERSAL::isa($abs, 'ARRAY'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 612 | 10 | ▶ | return {} if @$abs == 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 613 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 614 | 9 | my $base_dir = $self->base_dir_rel; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 615 | 9 | my $module = $self->run_hook('name_module', $step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 616 | 9 | ▶ | my $_step = $self->run_hook('name_step', $step) || croak "Missing name_step"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$self->run_hook('name_step', $step) || croak('Missing name_step')
MC/DC0%0/2
$self->run_hook('name_step', $step) || croak('Missing name_step')
$self->run_hook('name_step', $step)
croak('Missing name_step')
Truth table33%1/3
A || B
A= $self->run_hook('name_step', $step)B= croak('Missing name_step')
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 617 | 8 | $_step =~ s|\B__+|/|g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 618 | 8 | $_step =~ s/\.\w+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 619 | 8 | $_step .= '.'. $self->ext_val; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 620 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 621 | 8 | ▶ | foreach (@$abs, $base_dir, $module) { $_ .= '/' if length($_) && ! m|/$| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
length $_ and not m[/$]
MC/DC100%2/2
length $_ and not m[/$]
length $_
not m[/$]
Truth table100%3/3
A and not(B)
A= length $_B= not m[/$]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 622 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 623 | 8 | ▶ | if (@$abs > 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 624 | 1 | foreach my $_abs (@$abs) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 625 | 2 | my $path = "$_abs/$base_dir/$module/$_step"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 626 | 2 | ▶ | return $path if -e $path; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 627 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 628 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 629 | 8 | return $abs->[0] . $base_dir . $module . $_step; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 630 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 631 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 632 | sub fill_template { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 633 | 72 | ▶ | my ($self, $step, $outref, $fill) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fill_template: called CC=4 SCAR=14.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 634 | 72 | ▶ | return if ! $fill || ! scalar keys %$fill; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$fill and scalar keys %$fill
MC/DC50%1/2
$fill and scalar keys %$fill
$fill
scalar keys %$fill
Truth table66%2/3
A and B
A= $fillB= scalar keys %$fill
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 635 | 71 | ▶ | my $args = $self->run_hook('fill_args', $step) || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->run_hook('fill_args', $step) || {}
MC/DC0%0/1
$self->run_hook('fill_args', $step) || {}
$self->run_hook('fill_args', $step)
Truth table50%1/2
A
A= $self->run_hook('fill_args', $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 636 | 71 | local @$args{'text', 'form'} = ($outref, $fill); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 637 | 71 | require CGI::Ex::Fill; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 638 | 71 | CGI::Ex::Fill::fill($args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 639 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 640 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 641 | 25 | ▶ | sub finalize { 1 } # false means show step | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
finalize: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 642 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 643 | sub hash_base { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 644 | 78 | ▶ | my ($self, $step) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
hash_base: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 645 | 78 | ▶ | my $hash = $self->{'hash_base'} ||= { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{"hash_base"} ||= {"script_name", $self->script_name, "path_info", $self->path_info}
MC/DC100%1/1
$self->{"hash_base"} ||= {"script_name", $self->script_name, "path_info", $self->path_info}
$self->{"hash_base"}
Truth table100%2/2
A
A= $self->{"hash_base"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 646 | script_name => $self->script_name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 647 | path_info => $self->path_info, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 648 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 649 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 650 | 78 | my $copy = $self; eval { require Scalar::Util; Scalar::Util::weaken($copy) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 651 | 78 | ▶ | $hash->{'js_validation'} = sub { $copy->run_hook('js_validation', $step, shift) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 652 | 78 | ▶ | $hash->{'generate_form'} = sub { $copy->run_hook('generate_form', $step, (ref($_[0]) ? (undef, shift) : shift)) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=13.0
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 653 | 78 | $hash->{'form_name'} = $self->run_hook('form_name', $step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 654 | 78 | $hash->{$self->step_key} = $step; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 655 | 78 | return $hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 656 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 657 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 658 | 61 | ▶ | sub hash_common { $_[0]->{'hash_common'} ||= {} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
hash_common: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
$_[0]{"hash_common"} ||= {}
MC/DC100%1/1
$_[0]{"hash_common"} ||= {}
$_[0]{"hash_common"}
Truth table100%2/2
A
A= $_[0]{"hash_common"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 659 | 82 | ▶ | sub hash_errors { $_[0]->{'hash_errors'} ||= {} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
hash_errors: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
$_[0]{"hash_errors"} ||= {}
MC/DC100%1/1
$_[0]{"hash_errors"} ||= {}
$_[0]{"hash_errors"}
Truth table100%2/2
A
A= $_[0]{"hash_errors"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 660 | 72 | ▶ | sub hash_fill { $_[0]->{'hash_fill'} ||= {} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
hash_fill: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
$_[0]{"hash_fill"} ||= {}
MC/DC100%1/1
$_[0]{"hash_fill"} ||= {}
$_[0]{"hash_fill"}
Truth table100%2/2
A
A= $_[0]{"hash_fill"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 661 | 76 | ▶ | sub hash_form { $_[0]->form } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
hash_form: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 662 | 72 | ▶ | sub hash_swap { $_[0]->{'hash_swap'} ||= {} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
hash_swap: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
$_[0]{"hash_swap"} ||= {}
MC/DC100%1/1
$_[0]{"hash_swap"} ||= {}
$_[0]{"hash_swap"}
Truth table100%2/2
A
A= $_[0]{"hash_swap"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 663 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 664 | sub hash_validation { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 665 | 2 | ▶ | my ($self, $step) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
hash_validation: called CC=3 SCAR=11.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 666 | 2 | ▶ | return $self->{'hash_validation'}->{$step} ||= do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$self->{"hash_validation"}{$step} ||= do {
my $file = $self->run_hook("file_val", $step);
$file ? $self->val_obj->get_validation($file) : {}
}
MC/DC0%0/2
$self->{"hash_validation"}{$step} ||= do {
my $file = $self->run_hook("file_val", $step);
$file ? $self->val_obj->get_validation($file) : {}
}
$self->{"hash_validation"}{$step}
do {
my $file = $self->run_hook("file_val", $step);
$file ? $self->val_obj->get_validation($file) : {}
}
Truth table66%2/3
A ||= B
A= $self->{"hash_validation"}{$step}B= do {
my $file = $self->run_hook("file_val", $step);
$file ? $self->val_obj->get_validation($file) : {}
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 667 | 1 | my $file = $self->run_hook('file_val', $step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 668 | 1 | ▶ | $file ? $self->val_obj->get_validation($file) : {}; # if the file is not found, errors will be in the webserver logs (all else dies) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 669 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 670 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 671 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 672 | sub info_complete { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 673 | 9 | ▶ | my ($self, $step) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info_complete: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 674 | 9 | ▶ | return 0 if ! $self->run_hook('ready_validate', $step); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 675 | 8 | ▶ | return $self->run_hook('validate', $step, $self->form) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 676 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 677 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 678 | sub js_validation { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 679 | 6 | ▶ | my ($self, $step) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
js_validation: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 680 | 6 | ▶ | my $form_name = $_[2] || $self->run_hook('form_name', $step); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$_[2] || $self->run_hook('form_name', $step)
MC/DC100%2/2
$_[2] || $self->run_hook('form_name', $step)
$_[2]
$self->run_hook('form_name', $step)
Truth table100%3/3
A || B
A= $_[2]B= $self->run_hook('form_name', $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 681 | 6 | ▶ | my $hash_val = $_[3] || $self->run_hook('hash_validation', $step); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$_[3] || $self->run_hook('hash_validation', $step)
MC/DC100%2/2
$_[3] || $self->run_hook('hash_validation', $step)
$_[3]
$self->run_hook('hash_validation', $step)
Truth table100%3/3
A || B
A= $_[3]B= $self->run_hook('hash_validation', $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 682 | 6 | ▶ | return '' if ! $form_name || ! ref($hash_val) || ! scalar keys %$hash_val; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
$form_name and ref $hash_val and scalar keys %$hash_val
$form_name and ref $hash_val
MC/DC100%3/3
$form_name and ref $hash_val and scalar keys %$hash_val
$form_name
ref $hash_val
scalar keys %$hash_val
Truth table100%4/4
A and B and C
A= $form_nameB= ref $hash_valC= scalar keys %$hash_val
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 683 | 2 | return $self->val_obj->generate_js($hash_val, $form_name, $self->js_uri_path); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 684 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 685 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 686 | sub generate_form { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 687 | 0 | ▶ | my ($self, $step) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
generate_form: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 688 | 0 | ▶ | my $form_name = $_[2] || $self->run_hook('form_name', $step); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$_[2] || $self->run_hook('form_name', $step)
MC/DC0%0/2
$_[2] || $self->run_hook('form_name', $step)
$_[2]
$self->run_hook('form_name', $step)
Truth table0%0/3
A || B
A= $_[2]B= $self->run_hook('form_name', $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 689 | 0 | ▶ | my $args = ref($_[3]) eq 'HASH' ? $_[3] : {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 690 | 0 | my $hash_val = $self->run_hook('hash_validation', $step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 691 | 0 | ▶ | return '' if ! $form_name || ! ref($hash_val) || ! scalar keys %$hash_val; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$form_name and ref $hash_val and scalar keys %$hash_val
$form_name and ref $hash_val
MC/DC0%0/3
$form_name and ref $hash_val and scalar keys %$hash_val
$form_name
ref $hash_val
scalar keys %$hash_val
Truth table0%0/4
A and B and C
A= $form_nameB= ref $hash_valC= scalar keys %$hash_val
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 692 | 0 | local $args->{'js_uri_path'} = $self->js_uri_path; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 693 | 0 | return $self->val_obj->generate_form($hash_val, $form_name, $args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 694 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 695 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 696 | 20 | ▶ | sub morph_base { my $self = shift; ref($self) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
morph_base: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 697 | sub morph_package { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 698 | 20 | ▶ | my ($self, $step) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
morph_package: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 699 | 20 | my $cur = $self->morph_base; # default to using self as the base for morphed modules | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 700 | 20 | ▶ | my $new = ($cur ? $cur .'::' : '') . ($step || croak "Missing step"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$step || croak('Missing step')
MC/DC0%0/2
$step || croak('Missing step')
$step
croak('Missing step')
Truth table33%1/3
A || B
A= $stepB= croak('Missing step')
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 701 | 19 | $new =~ s/\B__+/::/g; # turn Foo::my_nested__step info Foo::my_nested::step | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 702 | 19 | $new =~ s/(?:_+|\b)(\w)/\u$1/g; # turn Foo::my_step_name into Foo::MyStepName | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 703 | 19 | return $new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 704 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 705 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 706 | sub name_module { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 707 | 21 | ▶ | my ($self, $step) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
name_module: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 708 | 21 | ▶ | return $self->{'name_module'} ||= ($self->script_name =~ m/ (\w+) (?:\.\w+)? $/x) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition80%4/5
$self->{"name_module"} ||= $self->script_name =~ / (\w+) (?:\.\w+)? $/x ? $1 : die('Could not determine module name from "name_module" lookup (' . ($step || "") . ")\n")
$step || ''
MC/DC0%0/2
$self->{"name_module"} ||= $self->script_name =~ / (\w+) (?:\.\w+)? $/x ? $1 : die('Could not determine module name from "name_module" lookup (' . ($step || "") . ")\n")
$self->{"name_module"}
$self->script_name =~ / (\w+) (?:\.\w+)? $/x ? $1 : die('Could not determine module name from "name_module" lookup (' . ($step || "") . ")\n")
MC/DC100%1/1
$step || ''
$step
Truth table66%2/3
A ||= B
A= $self->{"name_module"}B= $self->script_name =~ / (\w+) (?:\.\w+)? $/x ? $1 : die('Could not determine module name from "name_module" lookup (' . ($step || "") . ")\n")
Truth table100%2/2
A
A= $step
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 709 | ? $1 : die "Could not determine module name from \"name_module\" lookup (".($step||'').")\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 710 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 711 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 712 | 10 | ▶ | sub name_step { my ($self, $step) = @_; $step } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
name_step: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 713 | 28 | ▶ | sub next_step { $_[0]->step_by_path_index(($_[0]->{'path_i'} || 0) + 1) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
next_step: called CC=2 SCAR=6.9
Pod
documented
Condition100%2/2
$_[0]{'path_i'} || 0
MC/DC100%1/1
$_[0]{'path_i'} || 0
$_[0]{'path_i'}
Truth table100%2/2
A
A= $_[0]{'path_i'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 714 | 72 | ▶ | sub post_print { 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
post_print: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 715 | 27 | ▶ | sub post_step { 0 } # true indicates we handled step (exit loop) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
post_step: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 716 | 109 | ▶ | sub pre_step { 0 } # true indicates we handled step (exit loop) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pre_step: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 717 | 100 | ▶ | sub prepare { 1 } # false means show step | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prepare: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 718 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 719 | sub print_out { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 720 | 4 | ▶ | my ($self, $step, $out) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
print_out: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 721 | 4 | $self->cgix->print_content_type($self->run_hook('mimetype', $step), $self->run_hook('charset', $step)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 722 | 4 | ▶ | print ref($out) eq 'SCALAR' ? $$out : $out; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 723 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 724 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 725 | sub ready_validate { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 726 | 12 | ▶ | my ($self, $step) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
ready_validate: called CC=7 SCAR=27.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 727 | 12 | ▶ | if ($self->run_hook('validate_when_data', $step) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->run_hook("validate_when_data", $step) and my(@keys) = keys %{$self->run_hook("hash_validation", $step) or {};}
MC/DC0%0/2
$self->run_hook("validate_when_data", $step) and my(@keys) = keys %{$self->run_hook("hash_validation", $step) or {};}
$self->run_hook("validate_when_data", $step)
my(@keys) = keys %{$self->run_hook("hash_validation", $step) or {};}
Truth table33%1/3
A and B
A= $self->run_hook("validate_when_data", $step)B= my(@keys) = keys %{$self->run_hook("hash_validation", $step) or {};}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 728 | 0 | ▶ | and my @keys = keys %{ $self->run_hook('hash_validation', $step) || {} }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 729 | 0 | my $form = $self->form; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 730 | 0 | ▶ | return (grep { exists $form->{$_} } @keys) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 731 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 732 | 12 | ▶ | return ($ENV{'REQUEST_METHOD'} && $ENV{'REQUEST_METHOD'} eq 'POST') ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$ENV{"REQUEST_METHOD"} and $ENV{"REQUEST_METHOD"} eq "POST"
MC/DC50%1/2
$ENV{"REQUEST_METHOD"} and $ENV{"REQUEST_METHOD"} eq "POST"
$ENV{"REQUEST_METHOD"}
$ENV{"REQUEST_METHOD"} eq "POST"
Truth table66%2/3
A and B
A= $ENV{"REQUEST_METHOD"}B= $ENV{"REQUEST_METHOD"} eq "POST"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 733 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 734 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 735 | sub refine_path { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 736 | 36 | ▶ | my ($self, $step, $is_at_end) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
refine_path: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 737 | 36 | ▶ | return 0 if ! $is_at_end; # if we are not at the end of the path, do not do anything | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 738 | 27 | ▶ | my $next_step = $self->run_hook('next_step', $step) || return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->run_hook('next_step', $step) || (return 0)
MC/DC100%1/1
$self->run_hook('next_step', $step) || (return 0)
$self->run_hook('next_step', $step)
Truth table100%2/2
A
A= $self->run_hook('next_step', $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 739 | 1 | $self->run_hook('set_ready_validate', $step, 0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 740 | 1 | $self->append_path($next_step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 741 | 1 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 742 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 743 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 744 | sub set_ready_validate { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 745 | 5 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_ready_validate: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 746 | 5 | ▶ | my ($step, $is_ready) = (@_ == 2) ? @_ : (undef, shift); # hook and method | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 747 | 5 | ▶ | $ENV{'REQUEST_METHOD'} = ($is_ready) ? 'POST' : 'GET'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 748 | 5 | return $is_ready; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 749 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 750 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 751 | 101 | ▶ | sub skip { 0 } # success indicates to skip the step (and continue loop) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
skip: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 752 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 753 | sub swap_template { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 754 | 72 | ▶ | my ($self, $step, $file, $swap) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
swap_template: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 755 | 72 | my $t = $self->__template_obj($step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 756 | 72 | my $out = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 757 | 72 | ▶ | $t->process($file, $swap, \$out) || die $t->error; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 758 | 72 | return $out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 759 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 760 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 761 | sub __template_obj { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 762 | 72 | ▶ | my ($self, $step) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__template_obj: called CC=4 SCAR=16.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 763 | 72 | ▶ | my $args = $self->run_hook('template_args', $step) || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->run_hook('template_args', $step) || {}
MC/DC0%0/1
$self->run_hook('template_args', $step) || {}
$self->run_hook('template_args', $step)
Truth table50%1/2
A
A= $self->run_hook('template_args', $step)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 764 | 72 | ▶ | $args->{'INCLUDE_PATH'} ||= $args->{'include_path'} || $self->template_path; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%2/6
$args->{"INCLUDE_PATH"} ||= $args->{"include_path"} || $self->template_path
$args->{'include_path'} || $self->template_path
MC/DC0%0/3
$args->{"INCLUDE_PATH"} ||= $args->{"include_path"} || $self->template_path
$args->{"INCLUDE_PATH"}
$args->{'include_path'}
$self->template_path
Truth table0%0/4
A ||= B || C
A= $args->{"INCLUDE_PATH"}B= $args->{'include_path'}C= $self->template_path
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 765 | 72 | return $self->template_obj($args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 766 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 767 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 768 | sub validate { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 769 | 8 | ▶ | my ($self, $step, $form) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
validate: called CC=12 SCAR=28.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 770 | 8 | my $hash = $self->__hash_validation($step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 771 | 8 | ▶ | return 1 if ! ref($hash) || ! scalar keys %$hash; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $hash and scalar keys %$hash
MC/DC50%1/2
ref $hash and scalar keys %$hash
ref $hash
scalar keys %$hash
Truth table66%2/3
A and B
A= ref $hashB= scalar keys %$hash
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 772 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 773 | 7 | my @validated_fields; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 774 | 7 | ▶ | if (my $err_obj = eval { $self->val_obj->validate($form, $hash, \@validated_fields) }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 775 | 4 | $self->add_errors($err_obj->as_hash({as_hash_join => "<br>\n", as_hash_suffix => '_error'})); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 776 | 4 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 777 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 778 | 3 | ▶ | die "Step $step: $@" if $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 779 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 780 | 3 | foreach my $ref (@validated_fields) { # allow for the validation to give us some redirection | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 781 | 3 | ▶ | $self->append_path( ref $_ ? @$_ : $_) if $_ = $ref->{'append_path'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 782 | 3 | ▶ | $self->replace_path(ref $_ ? @$_ : $_) if $_ = $ref->{'replace_path'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 783 | 3 | ▶ | $self->insert_path( ref $_ ? @$_ : $_) if $_ = $ref->{'insert_path'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 784 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 785 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 786 | 3 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 787 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 788 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 789 | 8 | ▶ | sub __hash_validation { shift->run_hook('hash_validation', @_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__hash_validation: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 790 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 791 | 12 | ▶ | sub validate_when_data { $_[0]->{'validate_when_data'} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
validate_when_data: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 792 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 793 | ###---------------------### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 794 | # authentication | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 795 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 796 | sub navigate_authenticated { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 797 | 3 | ▶ | my ($self, $args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
navigate_authenticated: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 798 | 3 | ▶ | $self = $self->new($args) if ! ref $self; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 799 | 3 | ▶ | croak "Cannot call navigate_authenticated method if default require_auth method is overwritten" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 800 | if $self->can('require_auth') != \&CGI::Ex::App::require_auth; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 801 | 2 | $self->require_auth(1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 802 | 2 | return $self->navigate; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 803 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 804 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 805 | sub require_auth { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 806 | 116 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
require_auth: called CC=6 SCAR=18.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 807 | 116 | ▶ | $self->{'require_auth'} = shift if @_ == 1 && (! defined($_[0]) || ref($_[0]) || $_[0] =~ /^[01]$/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition77%7/9
@_ == 1 and !defined($_[0]) || ref $_[0] || $_[0] =~ /^[01]$/
not defined $_[0] or ref $_[0] or $_[0] =~ /^[01]$/
not defined $_[0] or ref $_[0]
MC/DC25%1/4
@_ == 1 and !defined($_[0]) || ref $_[0] || $_[0] =~ /^[01]$/
@_ == 1
not defined $_[0]
ref $_[0]
$_[0] =~ /^[01]$/
Truth table40%2/5
A and not(B) or C or D
A= @_ == 1B= not defined $_[0]C= ref $_[0]D= $_[0] =~ /^[01]$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 808 | 116 | ▶ | return $self->{'require_auth'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{'require_auth'} || 0
MC/DC100%1/1
$self->{'require_auth'} || 0
$self->{'require_auth'}
Truth table100%2/2
A
A= $self->{'require_auth'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 809 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 810 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 811 | 138 | ▶ | sub is_authed { my $data = shift->auth_data; $data && ! $data->{'error'} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_authed: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 812 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 813 | 4 | ▶ | sub check_valid_auth { shift->_do_auth({login_print => sub {}, location_bounce => sub {}}) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=0.0
Subroutine
check_valid_auth: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 814 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 815 | sub get_valid_auth { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 816 | 8 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_valid_auth: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 817 | return $self->_do_auth({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 818 | login_print => sub { # use CGI::Ex::Auth - but use our formatting and printing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 819 | 7 | ▶ | my ($auth, $template, $hash) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 820 | 7 | local $self->{'__login_file_print'} = $template; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 821 | 7 | local $self->{'__login_hash_common'} = $hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 822 | 7 | return $self->goto_step($self->login_step); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 823 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 824 | 8 | }); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 825 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 826 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 827 | sub _do_auth { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 828 | 12 | ▶ | my ($self, $extra) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_do_auth: called CC=16 SCAR=31.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 829 | 12 | ▶ | return $self->auth_data if $self->is_authed; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 830 | 11 | ▶ | my $args = { %{ $self->auth_args || {} }, %{ $extra || {} } }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 831 | 11 | ▶ | $args->{'script_name'} ||= $self->script_name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$args->{"script_name"} ||= $self->script_name
MC/DC0%0/2
$args->{"script_name"} ||= $self->script_name
$args->{"script_name"}
$self->script_name
Truth table33%1/3
A ||= B
A= $args->{"script_name"}B= $self->script_name
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 832 | 11 | ▶ | $args->{'path_info'} ||= $self->path_info; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$args->{"path_info"} ||= $self->path_info
MC/DC0%0/2
$args->{"path_info"} ||= $self->path_info
$args->{"path_info"}
$self->path_info
Truth table33%1/3
A ||= B
A= $args->{"path_info"}B= $self->path_info
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 833 | 11 | ▶ | $args->{'cgix'} ||= $self->cgix; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$args->{"cgix"} ||= $self->cgix
MC/DC0%0/2
$args->{"cgix"} ||= $self->cgix
$args->{"cgix"}
$self->cgix
Truth table33%1/3
A ||= B
A= $args->{"cgix"}B= $self->cgix
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 834 | 11 | ▶ | $args->{'form'} ||= $self->form; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$args->{"form"} ||= $self->form
MC/DC0%0/2
$args->{"form"} ||= $self->form
$args->{"form"}
$self->form
Truth table33%1/3
A ||= B
A= $args->{"form"}B= $self->form
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 835 | 11 | ▶ | $args->{'cookies'} ||= $self->cookies; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$args->{"cookies"} ||= $self->cookies
MC/DC0%0/2
$args->{"cookies"} ||= $self->cookies
$args->{"cookies"}
$self->cookies
Truth table33%1/3
A ||= B
A= $args->{"cookies"}B= $self->cookies
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 836 | 11 | ▶ | $args->{'js_uri_path'} ||= $self->js_uri_path; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$args->{"js_uri_path"} ||= $self->js_uri_path
MC/DC0%0/2
$args->{"js_uri_path"} ||= $self->js_uri_path
$args->{"js_uri_path"}
$self->js_uri_path
Truth table33%1/3
A ||= B
A= $args->{"js_uri_path"}B= $self->js_uri_path
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 837 | 11 | ▶ | $args->{'get_pass_by_user'} ||= sub { my ($auth, $user) = @_; $self->get_pass_by_user($user, $auth) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.4
Condition33%1/3
$args->{"get_pass_by_user"} ||= sub {
my($auth, $user) = @_;
$self->get_pass_by_user($user, $auth);
}
MC/DC0%0/2
$args->{"get_pass_by_user"} ||= sub {
my($auth, $user) = @_;
$self->get_pass_by_user($user, $auth);
}
$args->{"get_pass_by_user"}
sub {
my($auth, $user) = @_;
$self->get_pass_by_user($user, $auth);
}
Truth table33%1/3
A ||= B
A= $args->{"get_pass_by_user"}B= sub {
my($auth, $user) = @_;
$self->get_pass_by_user($user, $auth);
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 838 | 11 | ▶ | $args->{'verify_user'} ||= sub { my ($auth, $user) = @_; $self->verify_user( $user, $auth) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.4
Condition33%1/3
$args->{"verify_user"} ||= sub {
my($auth, $user) = @_;
$self->verify_user($user, $auth);
}
MC/DC0%0/2
$args->{"verify_user"} ||= sub {
my($auth, $user) = @_;
$self->verify_user($user, $auth);
}
$args->{"verify_user"}
sub {
my($auth, $user) = @_;
$self->verify_user($user, $auth);
}
Truth table33%1/3
A ||= B
A= $args->{"verify_user"}B= sub {
my($auth, $user) = @_;
$self->verify_user($user, $auth);
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 839 | 11 | ▶ | $args->{'cleanup_user'} ||= sub { my ($auth, $user) = @_; $self->cleanup_user( $user, $auth) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.4
Condition33%1/3
$args->{"cleanup_user"} ||= sub {
my($auth, $user) = @_;
$self->cleanup_user($user, $auth);
}
MC/DC0%0/2
$args->{"cleanup_user"} ||= sub {
my($auth, $user) = @_;
$self->cleanup_user($user, $auth);
}
$args->{"cleanup_user"}
sub {
my($auth, $user) = @_;
$self->cleanup_user($user, $auth);
}
Truth table33%1/3
A ||= B
A= $args->{"cleanup_user"}B= sub {
my($auth, $user) = @_;
$self->cleanup_user($user, $auth);
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 840 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 841 | 11 | my $obj = $self->auth_obj($args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 842 | 11 | my $resp = $obj->get_valid_auth; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 843 | 4 | my $data = $obj->last_auth_data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 844 | 4 | ▶ | delete $data->{'real_pass'} if defined $data; # data may be defined but false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 845 | 4 | $self->auth_data($data); # failed authentication may still have auth_data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 846 | 4 | ▶ | return ($resp && $data) ? $data : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$resp and $data
MC/DC50%1/2
$resp and $data
$resp
$data
Truth table66%2/3
A and B
A= $respB= $data
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 847 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 848 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 849 | ###---------------------### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 850 | # default steps | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 851 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 852 | 1 | ▶ | sub js_require_auth { 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
js_require_auth: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 853 | sub js_run_step { # step that allows for printing javascript libraries that are stored in perls @INC. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 854 | 3 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
js_run_step: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 855 | 3 | ▶ | my $path = $self->form->{'js'} || $self->path_info; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$self->form->{'js'} || $self->path_info
MC/DC100%2/2
$self->form->{'js'} || $self->path_info
$self->form->{'js'}
$self->path_info
Truth table100%3/3
A || B
A= $self->form->{'js'}B= $self->path_info
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 856 | 3 | ▶ | $self->cgix->print_js($path =~ m!^(?:/js/|/)?(\w+(?:/\w+)*\.js)$! ? $1 : ''); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 857 | 3 | $self->{'_no_post_navigate'} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 858 | 3 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 859 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 860 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 861 | 3 | ▶ | sub __forbidden_require_auth { 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__forbidden_require_auth: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 862 | 3 | ▶ | sub __forbidden_allow_morph { shift->allow_morph(@_) && 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__forbidden_allow_morph: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 863 | 3 | ▶ | sub __forbidden_info_complete { 0 } # step that will be used the path method determines it is forbidden | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__forbidden_info_complete: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 864 | 3 | ▶ | sub __forbidden_hash_common { shift->stash } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__forbidden_hash_common: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 865 | 3 | ▶ | sub __forbidden_file_print { \ "<h1>Denied</h1>You do not have access to the step <b>\"[% forbidden_step.html %]\"</b>" } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__forbidden_file_print: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 866 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 867 | 4 | ▶ | sub __error_allow_morph { shift->allow_morph(@_) && 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__error_allow_morph: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 868 | 6 | ▶ | sub __error_info_complete { 0 } # step that is used by the default handle_error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__error_info_complete: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 869 | 6 | ▶ | sub __error_hash_common { shift->stash } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__error_hash_common: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 870 | 4 | ▶ | sub __error_file_print { \ "<h1>A fatal error occurred</h1>Step: <b>\"[% error_step.html %]\"</b><br>[% TRY; CONFIG DUMP => {header => 0}; DUMP error; END %]" } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__error_file_print: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 871 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 872 | 7 | ▶ | sub __login_require_auth { 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__login_require_auth: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 873 | 7 | ▶ | sub __login_allow_morph { shift->allow_morph(@_) && 1 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__login_allow_morph: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 874 | 7 | ▶ | sub __login_info_complete { 0 } # step used by default authentication | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__login_info_complete: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 875 | 7 | ▶ | sub __login_hash_common { shift->{'__login_hash_common'} || {error => "hash_common not set during default __login"} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__login_hash_common: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 876 | 7 | ▶ | sub __login_file_print { shift->{'__login_file_print'} || \ "file_print not set during default __login<br>[% login_error %]" } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__login_file_print: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 877 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 878 | 2 | 1; # Full documentation resides in CGI/Ex/App.pod | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||