Scaffold/Context.pm

filter: Statementstmt 60.8% 14 / 23 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 100% 2 / 2 totaltotal 55.2% 21 / 38 CC 4 SCAR 16.7
CC
4
Cov
48%
as_string
12.0
parse_context
6.0
BEGIN
1.0
CRAP 5.3
« Scaffold/Accessor.pm ↑ Summary Scaffold/Exception/Util.pm »
1 1 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Class::Scaffold::Context;
6 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 $Class::Scaffold::Context::VERSION = '1.102280';
8 }
9 # ABSTRACT: Holds execution and job context
10 1 ▶use parent 'Class::Scaffold::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 __PACKAGE__->mk_scalar_accessors(qw(execution job));
12  
13 # types of execution context: cron, apache, shell, soap
14 # types of job context: mail, sif, epp
15 # takes something like 'run/epp' and sets execution and job context
16 0 ▶sub parse_context {
Subroutine parse_context: not called CC=2 SCAR=17.9
Pod documented
17 0 my ($self, $spec) = @_;
18 0 ▶ if ($spec =~ m!^(\w+)/(\w+)$!) {
Branch: 1 branch
BranchTrueFalseTotal
if ($spec =~ m[^(\w+)/(\w+)$]) { } 0 0 0
19 0 my ($job, $execution) = ($1, $2);
20 0 $self->execution($execution);
21 0 $self->job($job);
22 } else {
23 0 throw Error::Hierarchy::Internal::CustomMessage(
24 custom_message => "Invalid context specification [$spec]",);
25 }
26 0 $self;
27 }
28  
29 0 ▶sub as_string {
Subroutine as_string: not called CC=3 SCAR=24.8
Pod documented
30 0 my $self = shift;
31 0 ▶ sprintf '%s/%s',
Branch: 2 branches
BranchTrueFalseTotal
defined $self->job ? : 0 0 0
defined $self->execution ? : 0 0 0
32 (defined $self->job ? $self->job : 'none'),
33 (defined $self->execution ? $self->execution : 'none');
34 }
35 1 1;
36  
37  
38 __END__
« Scaffold/Accessor.pm ↑ Summary Scaffold/Exception/Util.pm »