Scaffold/BusinessObject.pm

filter: Statementstmt 71.8% 23 / 32 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 61.5% 8 / 13 Podpod 100% 5 / 5 totaltotal 69.2% 36 / 52 CC 2 SCAR 6.2
CC
2
Cov
68%
store
6.0
used_objects
2.0
assert_key
2.0
CRAP 1.9
« Scaffold/YAML/Active/Environment.pm ↑ Summary Scaffold/Test/Inherited.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::BusinessObject;
6 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 $Class::Scaffold::BusinessObject::VERSION = '1.102280';
8 }
9 # ABSTRACT: Base class for framework business objects
10 1 ▶use Error::Hierarchy::Util 'assert_defined';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use parent qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
12 Class::Scaffold::Storable
13 Class::Scaffold::HierarchicalDirty
14 1 );
15 1 __PACKAGE__->mk_scalar_accessors(qw(key_name))
16 ->mk_abstract_accessors(qw(key object_type));
17 1 ▶use constant DEFAULTS => (key_name => 'key field',);
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 # Each business object can tell its defining key, e.g. handle for persons,
20 # domainname for domains etc.
21  
22 0 ▶sub check { }
Subroutine check: not called CC=1 SCAR=0.0
Pod documented
23  
24 0 ▶sub used_objects {
Subroutine used_objects: not called CC=1 SCAR=6.9
Pod documented
25 0 my $self = shift;
26 0 ($self->object_type => $self->key);
27 }
28  
29 0 ▶sub assert_key {
Subroutine assert_key: not called CC=1 SCAR=6.9
Pod documented
30 0 my $self = shift;
31 0 local $Error::Depth = $Error::Depth + 1;
32 0 assert_defined $self->key,
33 sprintf('called without defined %s', $self->key_name);
34 }
35  
36 0 ▶sub store {
Subroutine store: not called CC=2 SCAR=17.9
Pod documented
37 0 my $self = shift;
38 0 ▶ if ($self->key) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->key) { } 0 0 0
39 0 $self->update;
40 } else {
41 0 $self->insert;
42 }
43 }
44 1 ▶use constant SKIP_COMPARABLE_KEYS => ('key_name');
Subroutine BEGIN: called CC=1 SCAR=0.0
45  
46 0 ▶sub apply_instruction_container { }
Subroutine apply_instruction_container: not called CC=1 SCAR=0.0
Pod documented
47 1 1;
48  
49  
50 __END__
« Scaffold/YAML/Active/Environment.pm ↑ Summary Scaffold/Test/Inherited.pm »