| 1 | package Test2::EventFacet::Trace; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 455 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 455 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | 455 | our $VERSION = '1.302226'; | |||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 455 | ▶ | BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 455 | ▶ | use Test2::Util qw/get_tid pkg_to_file gen_uid/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | 455 | ▶ | use Time::HiRes qw/time/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 455 | ▶ | use Carp qw/confess/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | 455 | ▶ | use Test2::Util::HashBase qw{^frame ^pid ^tid ^cid -hid -nested details -buffered -uuid -huuid <full_caller <stamp}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | { | ||||||||||||||||||||||||||||||||||||||||||
| 16 | 455 | ▶ | no warnings 'once'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 455 | *DETAIL = \&DETAILS; | |||||||||||||||||||||||||||||||||||||||||
| 18 | 455 | *detail = \&details; | |||||||||||||||||||||||||||||||||||||||||
| 19 | 455 | *set_detail = \&set_details; | |||||||||||||||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | 2598 | ▶ | sub init { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: called CC=8 SCAR=21.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | confess "The 'frame' attribute is required" | ||||||||||||||||||||||||||||||||||||||||||
| 24 | 2598 | ▶ | unless $_[0]->{+FRAME}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | 2596 | ▶ | $_[0]->{+DETAILS} = delete $_[0]->{detail} if $_[0]->{detail}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 2596 | ▶ | unless (defined($_[0]->{+PID}) || defined($_[0]->{+TID}) || defined($_[0]->{+CID})) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
defined $_[0]{"pid"} or defined $_[0]{"tid"} or defined $_[0]{"cid"}
defined $_[0]{"pid"} or defined $_[0]{"tid"}
MC/DC66%2/3
defined $_[0]{"pid"} or defined $_[0]{"tid"} or defined $_[0]{"cid"}
defined $_[0]{"pid"}
defined $_[0]{"tid"}
defined $_[0]{"cid"}
Truth table75%3/4
A or B or C
A= defined $_[0]{"pid"}B= defined $_[0]{"tid"}C= defined $_[0]{"cid"}
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 1109 | ▶ | $_[0]->{+PID} = $$ unless defined $_[0]->{+PID}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 1109 | ▶ | $_[0]->{+TID} = get_tid() unless defined $_[0]->{+TID}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | 3774 | ▶ | sub snapshot { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
snapshot: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 35 | 3774 | my ($orig, @override) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 36 | 3774 | bless {%$orig, @override}, __PACKAGE__; | |||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | 50 | ▶ | sub signature { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
signature: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | 50 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | # Signature is only valid if all of these fields are defined, there is no | ||||||||||||||||||||||||||||||||||||||||||
| 43 | # signature if any is missing. '0' is ok, but '' is not. | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 238 | ▶ | return join ':' => map { (defined($_) && length($_)) ? $_ : return undef } ( | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $_ and length $_
MC/DC50%1/2
defined $_ and length $_
defined $_
length $_
Truth table66%2/3
A and B
A= defined $_B= length $_
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | $self->{+CID}, | ||||||||||||||||||||||||||||||||||||||||||
| 46 | $self->{+PID}, | ||||||||||||||||||||||||||||||||||||||||||
| 47 | $self->{+TID}, | ||||||||||||||||||||||||||||||||||||||||||
| 48 | $self->{+FRAME}->[1], | ||||||||||||||||||||||||||||||||||||||||||
| 49 | 50 | $self->{+FRAME}->[2], | |||||||||||||||||||||||||||||||||||||||||
| 50 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | 159 | ▶ | sub debug { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
debug: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 54 | 159 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 55 | 159 | ▶ | return $self->{+DETAILS} if $self->{+DETAILS}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 56 | 157 | my ($pkg, $file, $line) = $self->call; | |||||||||||||||||||||||||||||||||||||||||
| 57 | 157 | return "at $file line $line"; | |||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||
| 60 | 8 | ▶ | sub alert { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
alert: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 61 | 8 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 62 | 8 | my ($msg) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 63 | 8 | warn $msg . ' ' . $self->debug . ".\n"; | |||||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | 27 | ▶ | sub throw { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
throw: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | 27 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 68 | 27 | my ($msg) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 69 | 27 | die $msg . ' ' . $self->debug . ".\n"; | |||||||||||||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||
| 72 | 1677 | ▶ | sub call { @{$_[0]->{+FRAME}} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
call: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | ▶ | sub full_call { @{$_[0]->{+FULL_CALLER}} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
full_call: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||
| 76 | 684 | ▶ | sub package { $_[0]->{+FRAME}->[0] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
package: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 77 | 209 | ▶ | sub file { $_[0]->{+FRAME}->[1] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
file: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 78 | 177 | ▶ | sub line { $_[0]->{+FRAME}->[2] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
line: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 79 | 9 | ▶ | sub subname { $_[0]->{+FRAME}->[3] } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
subname: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||
| 81 | 615 | ▶ | sub warning_bits { $_[0]->{+FULL_CALLER} ? $_[0]->{+FULL_CALLER}->[9] : undef } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
warning_bits: called CC=2 SCAR=7.6
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||
| 83 | 455 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||
| 85 | __END__ | ||||||||||||||||||||||||||||||||||||||||||