AuditAny/AuditContext.pm

filter: Statementstmt 47.2% 17 / 36 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 35.7% 5 / 14 Podpod 100% 8 / 8 totaltotal 48.3% 30 / 62 CC 4 SCAR 13.7
CC
4
Cov
42%
get_datapoint_value
12.0
get_datapoints_data
6.0
_build_tiedContexts
2.0
CRAP 3.9
« AuditAny/AuditContext/Source.pm ↑ Summary AuditAny/Collector/AutoDBIC.pm »
1 package # Hide from PAUSE
2 DBIx::Class::AuditAny::AuditContext;
3 14 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 14 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # ABSTRACT: Base class for context objects in DBIx::Class::AuditAny
7  
8 14 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 14 ▶use MooX::Types::MooseLike::Base qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 =head1 NAME
12  
13 DBIx::Class::AuditAny::AuditContext - Base class for context objects in DBIx::Class::AuditAny
14  
15 =head1 DESCRIPTION
16  
17 This class is used internally and typically does not need to be called directly
18  
19 =head1 ATTRIBUTES
20  
21 =head2 AuditObj
22  
23 Required. Reference to the Auditor object (L<DBIx::Class::AuditAny>).
24  
25 =cut
26 14 has 'AuditObj', is => 'ro', isa => InstanceOf['DBIx::Class::AuditAny'], required => 1;
27  
28 =head2 tiedContexts
29  
30 Used internally
31  
32 =cut
33 14 has 'tiedContexts', is => 'lazy', isa => ArrayRef[Object];#, lazy_build => 1;
34  
35 =head2 local_datapoint_data
36  
37 Used internally
38  
39 =cut
40 14 has 'local_datapoint_data', is => 'lazy', isa => HashRef;#, lazy_build => 1;
41  
42 0 ▶sub _build_tiedContexts { die "Virtual method" }
Subroutine _build_tiedContexts: not called CC=1 SCAR=6.9
43 0 ▶sub _build_local_datapoint_data { die "Virtual method" }
Subroutine _build_local_datapoint_data: not called CC=1 SCAR=6.9
44  
45  
46 =head1 METHODS
47  
48 =head2 get_datapoint_value
49  
50 =cut
51 0 ▶sub get_datapoint_value {
Subroutine get_datapoint_value: not called CC=3 SCAR=24.8
Pod documented
52 0 my $self = shift;
53 0 my $name = shift;
54 0 my @Contexts = ($self,@{$self->tiedContexts},$self->AuditObj);
55 0 foreach my $Context (@Contexts) {
56 return $Context->local_datapoint_data->{$name}
57 0 ▶ if (exists $Context->local_datapoint_data->{$name});
Branch: 1 branch
BranchTrueFalseTotal
if exists $Context->local_datapoint_data->{$name} 0 0 0
58 }
59 0 die "Unknown datapoint '$name'";
60 }
61  
62 =head2 get_datapoints_data
63  
64 =cut
65 0 ▶sub get_datapoints_data {
Subroutine get_datapoints_data: not called CC=2 SCAR=17.9
Pod documented
66 0 my $self = shift;
67 0 ▶ my @names = (ref($_[0]) eq 'ARRAY') ? @{ $_[0] } : @_; # <-- arg as array or arrayref
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] eq 'ARRAY' ? : 0 0 0
68 0 return { map { $_ => $self->get_datapoint_value($_) } @names };
69 }
70  
71  
72 =head2 SchemaObj
73  
74 =cut
75 0 ▶sub SchemaObj { (shift)->AuditObj->schema };
Subroutine SchemaObj: not called CC=1 SCAR=6.9
Pod documented
76  
77  
78 =head2 schema
79  
80 =cut
81 0 ▶sub schema { ref (shift)->AuditObj->schema };
Subroutine schema: not called CC=1 SCAR=6.9
Pod documented
82  
83  
84 =head2 primary_key_separator
85  
86 =cut
87 0 ▶sub primary_key_separator { (shift)->AuditObj->primary_key_separator };
Subroutine primary_key_separator: not called CC=1 SCAR=6.9
Pod documented
88  
89  
90 =head2 get_context_datapoints
91  
92 =cut
93 0 ▶sub get_context_datapoints { (shift)->AuditObj->get_context_datapoints(@_) };
Subroutine get_context_datapoints: not called CC=1 SCAR=6.9
Pod documented
94  
95  
96 =head2 get_context_datapoint_names
97  
98 =cut
99 0 ▶sub get_context_datapoint_names { (shift)->AuditObj->get_context_datapoint_names(@_) };
Subroutine get_context_datapoint_names: not called CC=1 SCAR=6.9
Pod documented
100  
101  
102 =head2 get_dt
103  
104 =cut
105 4 ▶sub get_dt { (shift)->AuditObj->get_dt(@_) };
Subroutine get_dt: called CC=1 SCAR=0.0
Pod documented
106  
107 14 1;
108  
109 __END__
« AuditAny/AuditContext/Source.pm ↑ Summary AuditAny/Collector/AutoDBIC.pm »