Role/ContextReference.pm

filter: Statementstmt 100% 30 / 30 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 12 / 12 Podpod 100% 4 / 4 totaltotal 100% 48 / 48 CC 2 SCAR 1.4
CC
2
Cov
100%
BEGIN
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Role/ScopeManager.pm ↑ Summary Role/SpanContext.pm »
1 package OpenTracing::Role::ContextReference;
2  
3 3 our $VERSION = 'v0.80.0-TRIAL_007';
4  
5 3 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use MooX::Enumeration;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use MooX::ProtectedAttributes;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶use OpenTracing::Types qw/SpanContext/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use Types::Standard qw/Enum/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 3 ▶use constant CHILD_OF => 'child_of';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 3 ▶use constant FOLLOWS_FROM => 'follows_from';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 3 protected_has reference_type => (
16 is => 'ro',
17 isa => Enum[ CHILD_OF, FOLLOWS_FROM ],
18 );
19  
20 3 has referenced_context => (
21 is => 'ro',
22 isa => SpanContext,
23 required => 1,
24 reader => 'get_referenced_context',
25 );
26  
27 sub new_child_of {
28 1 ▶ $_[0]->new(
Subroutine new_child_of: called CC=1 SCAR=0.0
Pod documented
29 reference_type => CHILD_OF,
30 referenced_context => $_[1],
31 )
32 }
33  
34 1 ▶sub type_is_child_of { $_[0]->reference_type eq CHILD_OF }
Subroutine type_is_child_of: called CC=1 SCAR=0.0
Pod documented
35  
36 sub new_follows_from {
37 1 ▶ $_[0]->new(
Subroutine new_follows_from: called CC=1 SCAR=0.0
Pod documented
38 reference_type => FOLLOWS_FROM,
39 referenced_context => $_[1],
40 )
41 }
42  
43 1 ▶sub type_is_follows_from { $_[0]->reference_type eq FOLLOWS_FROM }
Subroutine type_is_follows_from: called CC=1 SCAR=0.0
Pod documented
44  
45  
46  
47 BEGIN {
48 with 'OpenTracing::Interface::ContextReference'
49 3 ▶ if $ENV{OPENTRACING_INTERFACE};
Subroutine BEGIN: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"OPENTRACING_INTERFACE"} 2 1 3
50 }
51  
52  
53  
54 3 1;
« Role/ScopeManager.pm ↑ Summary Role/SpanContext.pm »