| 1 | package Test2::API::InterceptResult::Event; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 98 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 98 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 98 | our $VERSION = '1.302226'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 98 | ▶ | use List::Util qw/first/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 98 | ▶ | use Test2::Util qw/pkg_to_file/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 98 | ▶ | use Scalar::Util qw/reftype blessed/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 98 | ▶ | use Storable qw/dclone/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 98 | ▶ | use Carp qw/confess croak/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 98 | ▶ | use Test2::API::InterceptResult::Facet; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 98 | ▶ | use Test2::API::InterceptResult::Hub; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 98 | ▶ | use Test2::Util::HashBase qw{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | +causes_failure | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | <facet_data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | <result_class | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 98 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 98 | my %FACETS; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 98 | ▶ | BEGIN { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=5 SCAR=26.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 98 | local $@; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 98 | local *plugins; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | if (eval { require Module::Pluggable; 1 }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | Module::Pluggable->import( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | # We will replace the sub later | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | require => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | ▶ | on_require_error => sub { 1 }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | search_path => ['Test2::EventFacet'], | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | max_depth => 3, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | min_depth => 3, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | for my $facet_type (__PACKAGE__->plugins) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | my ($key, $list); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | $key = $facet_type->facet_key; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | $list = $facet_type->is_list; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | ▶ | next unless $key && defined($list); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$key and defined $list
MC/DC0%0/2
$key and defined $list
$key
defined $list
Truth table0%0/3
A and B
A= $keyB= defined $list
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | $FACETS{$key} = {list => $list, class => $facet_type, loaded => 1}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 98 | $FACETS{__GENERIC__} = {class => 'Test2::API::InterceptResult::Facet', loaded => 1}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 1 | ▶ | sub facet_map { \%FACETS } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
facet_map: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 807 | ▶ | sub facet_info { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
facet_info: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 807 | my $facet = pop; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 807 | ▶ | return $FACETS{$facet} if exists $FACETS{$facet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 29 | my $mname = ucfirst(lc($facet)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 29 | $mname =~ s/s$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 29 | for my $name ($mname, "${mname}s") { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 32 | my $file = "Test2/EventFacet/$name.pm"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 32 | my $class = "Test2::EventFacet::$name"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 32 | local $@; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 32 | my $ok = eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 32 | require $file; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 26 | my $key = $class->facet_key; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 26 | my $list = $class->is_list; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 26 | $FACETS{$key} = {list => $list, class => $class, loaded => 1}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 26 | ▶ | $FACETS{$facet} = $FACETS{$key} if $facet ne $key; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 26 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 32 | ▶ | return $FACETS{$facet} if $ok && $FACETS{$facet}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$ok and $FACETS{$facet}
MC/DC50%1/2
$ok and $FACETS{$facet}
$ok
$FACETS{$facet}
Truth table66%2/3
A and B
A= $okB= $FACETS{$facet}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 3 | return $FACETS{$facet} = $FACETS{__GENERIC__}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 118 | ▶ | sub init { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: called CC=11 SCAR=24.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 118 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 118 | ▶ | my $rc = $self->{+RESULT_CLASS} ||= 'Test2::API::InterceptResult'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{"result_class"} ||= "Test2::API::InterceptResult"
MC/DC100%1/1
$self->{"result_class"} ||= "Test2::API::InterceptResult"
$self->{"result_class"}
Truth table100%2/2
A
A= $self->{"result_class"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 118 | my $rc_file = pkg_to_file($rc); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 118 | ▶ | require($rc_file) unless $INC{$rc_file}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 118 | ▶ | my $fd = $self->{+FACET_DATA} ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{"facet_data"} ||= {}
MC/DC100%1/1
$self->{"facet_data"} ||= {}
$self->{"facet_data"}
Truth table100%2/2
A
A= $self->{"facet_data"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 118 | for my $facet (keys %$fd) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 355 | my $finfo = $self->facet_info($facet); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 355 | my $is_list = $finfo->{list}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 355 | ▶ | next unless defined $is_list; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 349 | my $type = reftype($fd->{$facet}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 349 | ▶ | if ($is_list) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 128 | ▶ | confess "Facet '$facet' is a list facet, but got '$type' instead of an arrayref" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | unless $type eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 127 | for my $item (@{$fd->{$facet}}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 176 | my $itype = reftype($item); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 176 | ▶ | next if $itype eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 1 | confess "Got item type '$itype' in list-facet '$facet', all items must be hashrefs"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 221 | ▶ | confess "Facet '$facet' is an only-one facet, but got '$type' instead of a hashref" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | unless $type eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 18 | ▶ | sub clone { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
clone: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 18 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 18 | my $class = blessed($self); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 18 | my %data = %$self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 18 | $data{+FACET_DATA} = dclone($data{+FACET_DATA}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 18 | return bless(\%data, $class); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 219 | ▶ | sub _facet_class { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_facet_class: called CC=3 SCAR=13.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 219 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 219 | my ($name) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 219 | my $spec = $self->facet_info($name); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 219 | my $class = $spec->{class}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 219 | ▶ | unless ($spec->{loaded}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | my $file = pkg_to_file($class); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | ▶ | require $file unless $INC{$file}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | $spec->{loaded} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 219 | return $class; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 157 | ▶ | sub the_facet { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
the_facet: called CC=7 SCAR=19.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 157 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 157 | my ($name) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 157 | ▶ | return undef unless defined $self->{+FACET_DATA}->{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 133 | my $data = $self->{+FACET_DATA}->{$name}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 133 | ▶ | my $type = reftype($data) or confess "Facet '$name' has a value that is not a reference, this should not happen"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 133 | ▶ | return $self->_facet_class($name)->new(%{dclone($data)}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | if $type eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 4 | ▶ | if ($type eq 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 4 | ▶ | return undef unless @$data; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 4 | ▶ | croak "'the_facet' called for facet '$name', but '$name' has '" . @$data . "' items" if @$data != 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 3 | return $self->_facet_class($name)->new(%{dclone($data->[0])}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | die "Invalid facet data type: $type"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 131 | ▶ | sub facet { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
facet: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 131 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 131 | my ($name) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 131 | ▶ | return () unless exists $self->{+FACET_DATA}->{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 87 | my $data = $self->{+FACET_DATA}->{$name}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 87 | ▶ | my $type = reftype($data) or confess "Facet '$name' has a value that is not a reference, this should not happen"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 87 | my @out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 87 | ▶ | @out = ($data) if $type eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 87 | ▶ | @out = (@$data) if $type eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 87 | my $class = $self->_facet_class($name); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 87 | return map { $class->new(%{dclone($_)}) } @out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 55 | ▶ | sub causes_failure { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
causes_failure: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 55 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | return $self->{+CAUSES_FAILURE} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 55 | ▶ | if exists $self->{+CAUSES_FAILURE}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 37 | my $hub = Test2::API::InterceptResult::Hub->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 37 | $hub->process($self); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 37 | ▶ | return $self->{+CAUSES_FAILURE} = ($hub->is_passing ? 0 : 1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 31 | ▶ | sub causes_fail { shift->causes_failure } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
causes_fail: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 2 | ▶ | sub trace { $_[0]->facet('trace') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trace: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 146 | ▶ | sub the_trace { $_[0]->the_facet('trace') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
the_trace: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 82 | ▶ | sub frame { my $t = $_[0]->the_trace or return undef; $t->{frame} || undef } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
frame: called CC=3 SCAR=11.1
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 24 | ▶ | sub trace_details { my $t = $_[0]->the_trace or return undef; $t->{details} || undef } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trace_details: called CC=3 SCAR=11.0
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 2 | ▶ | sub trace_stamp { my $f = $_[0]->the_trace or return undef; $f->{stamp} || undef } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trace_stamp: called CC=3 SCAR=12.0
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 3 | ▶ | sub trace_package { my $f = $_[0]->frame or return undef; $f->[0] || undef } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trace_package: called CC=3 SCAR=11.0
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 24 | ▶ | sub trace_file { my $f = $_[0]->frame or return undef; $f->[1] || undef } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trace_file: called CC=3 SCAR=11.0
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 25 | ▶ | sub trace_line { my $f = $_[0]->frame or return undef; $f->[2] || undef } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trace_line: called CC=3 SCAR=11.0
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 24 | ▶ | sub trace_subname { my $f = $_[0]->frame or return undef; $f->[3] || undef } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trace_subname: called CC=3 SCAR=11.0
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 3 | ▶ | sub trace_tool { my $f = $_[0]->frame or return undef; $f->[3] || undef } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trace_tool: called CC=3 SCAR=11.0
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 36 | ▶ | sub trace_signature { my $t = $_[0]->the_trace or return undef; Test2::EventFacet::Trace::signature($t) || undef } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trace_signature: called CC=3 SCAR=12.0
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 30 | ▶ | sub brief { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
brief: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 30 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 30 | my @try = qw{ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | bailout_brief | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | error_brief | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | assert_brief | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | plan_brief | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 30 | for my $meth (@try) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 79 | ▶ | my $got = $self->$meth or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 27 | return $got; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 3 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 13 | ▶ | sub flatten { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
flatten: called CC=37 SCAR=36.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 13 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 13 | my %params = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 13 | my $todo = {%{$self->{+FACET_DATA}}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 13 | delete $todo->{hubs}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 13 | delete $todo->{meta}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 13 | delete $todo->{trace}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 13 | my $out = $self->summary; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 13 | delete $out->{brief}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 13 | delete $out->{facets}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 13 | delete $out->{trace_tool}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 13 | ▶ | delete $out->{trace_details} unless defined($out->{trace_details}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 13 | ▶ | for my $tagged (grep { my $finfo = $self->facet_info($_); $finfo->{list} && $finfo->{class}->can('tag') } keys %FACETS, keys %$todo) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$finfo->{'list'} && $finfo->{'class'}->can('tag')
MC/DC100%2/2
$finfo->{'list'} && $finfo->{'class'}->can('tag')
$finfo->{'list'}
$finfo->{'class'}->can('tag')
Truth table100%3/3
A && B
A= $finfo->{'list'}B= $finfo->{'class'}->can('tag')
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 57 | ▶ | my $set = delete $todo->{$tagged} or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 13 | my $fd = $self->{+FACET_DATA}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 13 | my $has_assert = $self->has_assert; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 13 | my $has_parent = $self->has_subtest; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 13 | ▶ | my $has_fatal_error = $self->has_errors && grep { $_->{fail} } $self->errors; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$self->has_errors && grep({$_->{'fail'};} $self->errors)
MC/DC50%1/2
$self->has_errors && grep({$_->{'fail'};} $self->errors)
$self->has_errors
grep({$_->{'fail'};} $self->errors)
Truth table66%2/3
A && B
A= $self->has_errorsB= grep({$_->{'fail'};} $self->errors)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 13 | ▶ | next if $tagged eq 'amnesty' && !($has_assert || $has_parent || $has_fatal_error); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
$tagged eq "amnesty" and not $has_assert || $has_parent || $has_fatal_error
$has_assert || $has_parent || $has_fatal_error
$has_assert or $has_parent
MC/DC75%3/4
$tagged eq "amnesty" and not $has_assert || $has_parent || $has_fatal_error
$tagged eq "amnesty"
$has_assert
$has_parent
$has_fatal_error
Truth table80%4/5
A and not(B or C || D)
A= $tagged eq "amnesty"B= $has_assertC= $has_parentD= $has_fatal_error
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 12 | for my $item (@$set) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 34 | ▶ | push @{$out->{lc($item->{tag})}} => $item->{fail} ? "FATAL: $item->{details}" : $item->{details}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 13 | ▶ | if (my $assert = delete $todo->{assert}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 7 | $out->{pass} = $assert->{pass}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 7 | $out->{name} = $assert->{details}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 13 | ▶ | if (my $parent = delete $todo->{parent}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 2 | ▶ | delete $out->{subtest}->{bailed_out} unless defined $out->{subtest}->{bailed_out}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 2 | ▶ | delete $out->{subtest}->{skip_reason} unless defined $out->{subtest}->{skip_reason}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 2 | ▶ | if (my $res = $self->subtest_result) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 2 | my $state = $res->state; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 2 | delete $state->{$_} for grep { !defined($state->{$_}) } keys %$state; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 2 | $out->{subtest} = $state; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | $out->{subevents} = $res->flatten(%params) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 2 | ▶ | if $params{include_subevents}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 13 | ▶ | if (my $control = delete $todo->{control}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 3 | ▶ | if ($control->{halt}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 1 | ▶ | $out->{bailed_out} = $control->{details} || 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$control->{'details'} || 1
MC/DC0%0/1
$control->{'details'} || 1
$control->{'details'}
Truth table50%1/2
A
A= $control->{'details'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | elsif(defined $control->{details}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 2 | $out->{control} = $control->{details}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 13 | ▶ | if (my $plan = delete $todo->{plan}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 1 | $out->{plan} = $self->plan_brief; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 1 | $out->{plan} =~ s/^PLAN\s*//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 13 | for my $other (keys %$todo) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 8 | ▶ | my $data = $todo->{$other} or next; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 8 | ▶ | if (reftype($data) eq 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 2 | ▶ | if (!$out->{$other} || reftype($out->{$other}) eq 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not $out->{$other} or builtin::reftype($out->{$other}) eq "ARRAY"
MC/DC0%0/2
not $out->{$other} or builtin::reftype($out->{$other}) eq "ARRAY"
not $out->{$other}
builtin::reftype($out->{$other}) eq "ARRAY"
Truth table33%1/3
not(A) or B
A= not $out->{$other}B= builtin::reftype($out->{$other}) eq "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 2 | for my $item (@$data) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 2 | ▶ | push @{$out->{$other}} => $item->{details} if defined $item->{details}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 6 | ▶ | $out->{$other} = $data->{details} if defined($data->{details}) && !defined($out->{$other}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $data->{"details"} and not defined $out->{$other}
MC/DC0%0/2
defined $data->{"details"} and not defined $out->{$other}
defined $data->{"details"}
not defined $out->{$other}
Truth table33%1/3
A and not(B)
A= defined $data->{"details"}B= not defined $out->{$other}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 13 | ▶ | if (my $fields = $params{fields}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 1 | ▶ | $out = { map {exists($out->{$_}) ? ($_ => $out->{$_}) : ()} @$fields }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 13 | ▶ | if (my $remove = $params{remove}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 1 | delete $out->{$_} for @$remove; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | 13 | return $out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 21 | ▶ | sub summary { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
summary: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 21 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | 21 | my %params = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | my $out = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | brief => $self->brief || '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | causes_failure => $self->causes_failure, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | trace_line => $self->trace_line, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | trace_file => $self->trace_file, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | trace_tool => $self->trace_subname, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | trace_details => $self->trace_details, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 21 | ▶ | facets => [ sort keys(%{$self->{+FACET_DATA}}) ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->brief || ''
MC/DC100%1/1
$self->brief || ''
$self->brief
Truth table100%2/2
A
A= $self->brief
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | 21 | ▶ | if (my $fields = $params{fields}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | 1 | ▶ | $out = { map {exists($out->{$_}) ? ($_ => $out->{$_}) : ()} @$fields }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 21 | ▶ | if (my $remove = $params{remove}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 1 | delete $out->{$_} for @$remove; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 21 | return $out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 87 | ▶ | sub has_assert { $_[0]->{+FACET_DATA}->{assert} ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_assert: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 0 | ▶ | sub the_assert { $_[0]->the_facet('assert') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
the_assert: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | 4 | ▶ | sub assert { $_[0]->facet('assert') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
assert: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 24 | ▶ | sub assert_brief { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
assert_brief: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 24 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 24 | my $fd = $self->{+FACET_DATA}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 24 | ▶ | my $as = $fd->{assert} or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | 18 | my $am = $fd->{amnesty}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | 18 | ▶ | my $out = $as->{pass} ? "PASS" : "FAIL"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 18 | ▶ | $out .= " with amnesty" if $am; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | 18 | return $out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | 48 | ▶ | sub has_subtest { $_[0]->{+FACET_DATA}->{parent} ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_subtest: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 2 | ▶ | sub the_subtest { $_[0]->the_facet('parent') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
the_subtest: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 2 | ▶ | sub subtest { $_[0]->facet('parent') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
subtest: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 9 | ▶ | sub subtest_result { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
subtest_result: called CC=5 SCAR=16.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 9 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 9 | ▶ | my $parent = $self->{+FACET_DATA}->{parent} or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 7 | ▶ | my $children = $parent->{children} || []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$parent->{'children'} || []
MC/DC0%0/1
$parent->{'children'} || []
$parent->{'children'}
Truth table50%1/2
A
A= $parent->{'children'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | $children = $self->{+RESULT_CLASS}->new(@$children)->upgrade | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | 7 | ▶ | unless blessed($children) && $children->isa($self->{+RESULT_CLASS}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($children) and $children->isa($self->{"result_class"})
MC/DC50%1/2
builtin::blessed($children) and $children->isa($self->{"result_class"})
builtin::blessed($children)
$children->isa($self->{"result_class"})
Truth table66%2/3
A and B
A= builtin::blessed($children)B= $children->isa($self->{"result_class"})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | 7 | return $children; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 29 | ▶ | sub has_bailout { $_[0]->bailout ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_bailout: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | 0 | ▶ | sub the_bailout { my ($b) = $_[0]->bailout; $b } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
the_bailout: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | 66 | ▶ | sub bailout { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
bailout: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | 66 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | 66 | ▶ | my $control = $self->{+FACET_DATA}->{control} or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | 12 | ▶ | return $control if $control->{halt}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | 33 | ▶ | sub bailout_brief { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
bailout_brief: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | 33 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | 33 | ▶ | my $bo = $self->bailout or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | 7 | ▶ | my $reason = $bo->{details} or return "BAILED OUT"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | 7 | return "BAILED OUT: $reason"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | 2 | ▶ | sub bailout_reason { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
bailout_reason: called CC=3 SCAR=11.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | 2 | ▶ | my $bo = $self->bailout or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | 1 | ▶ | return $bo->{details} || ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$bo->{'details'} || ''
MC/DC0%0/1
$bo->{'details'} || ''
$bo->{'details'}
Truth table50%1/2
A
A= $bo->{'details'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 35 | ▶ | sub has_plan { $_[0]->{+FACET_DATA}->{plan} ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_plan: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 0 | ▶ | sub the_plan { $_[0]->the_facet('plan') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
the_plan: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 2 | ▶ | sub plan { $_[0]->facet('plan') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
plan: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 13 | ▶ | sub plan_brief { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
plan_brief: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | 13 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | 13 | ▶ | my $plan = $self->{+FACET_DATA}->{plan} or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | 9 | my $base = $self->_plan_brief($plan); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | 9 | ▶ | my $reason = $plan->{details} or return $base; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | 4 | return "$base: $reason"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | 9 | ▶ | sub _plan_brief { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_plan_brief: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | 9 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | 9 | my ($plan) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | 9 | ▶ | return 'NO PLAN' if $plan->{none}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | 8 | ▶ | return "SKIP ALL" if $plan->{skip} || !$plan->{count}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$plan->{"skip"} or not $plan->{"count"}
MC/DC100%2/2
$plan->{"skip"} or not $plan->{"count"}
$plan->{"skip"}
not $plan->{"count"}
Truth table100%3/3
A or not(B)
A= $plan->{"skip"}B= not $plan->{"count"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | 6 | return "PLAN $plan->{count}"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | 2 | ▶ | sub has_amnesty { $_[0]->{+FACET_DATA}->{amnesty} ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_amnesty: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | 0 | ▶ | sub the_amnesty { $_[0]->the_facet('amnesty') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
the_amnesty: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | 22 | ▶ | sub amnesty { $_[0]->facet('amnesty') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
amnesty: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | 2 | ▶ | sub amnesty_reasons { map { $_->{details} } $_[0]->amnesty } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
amnesty_reasons: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | 1 | ▶ | sub has_todos { &first(sub { uc($_->{tag}) eq 'TODO' }, $_[0]->amnesty) ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Subroutine
has_todos: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | 4 | ▶ | sub todos { grep { uc($_->{tag}) eq 'TODO' } $_[0]->amnesty } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
todos: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | 2 | ▶ | sub todo_reasons { map { $_->{details} || 'TODO' } $_[0]->todos } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
todo_reasons: called CC=2 SCAR=7.2
Pod
documented
Condition50%1/2
$_->{'details'} || 'TODO'
MC/DC0%0/1
$_->{'details'} || 'TODO'
$_->{'details'}
Truth table50%1/2
A
A= $_->{'details'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | 3 | ▶ | sub has_skips { &first(sub { uc($_->{tag}) eq 'SKIP' }, $_[0]->amnesty) ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Subroutine
has_skips: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | 4 | ▶ | sub skips { grep { uc($_->{tag}) eq 'SKIP' } $_[0]->amnesty } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
skips: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | 2 | ▶ | sub skip_reasons { map { $_->{details} || 'SKIP' } $_[0]->skips } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
skip_reasons: called CC=2 SCAR=7.2
Pod
documented
Condition50%1/2
$_->{'details'} || 'SKIP'
MC/DC0%0/1
$_->{'details'} || 'SKIP'
$_->{'details'}
Truth table50%1/2
A
A= $_->{'details'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | 98 | my %TODO_OR_SKIP = (SKIP => 1, TODO => 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | 5 | ▶ | sub has_other_amnesty { &first( sub { !$TODO_OR_SKIP{uc($_->{tag})} }, $_[0]->amnesty) ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Subroutine
has_other_amnesty: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | 4 | ▶ | sub other_amnesty { grep { !$TODO_OR_SKIP{uc($_->{tag})} } $_[0]->amnesty } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
other_amnesty: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | 2 | ▶ | sub other_amnesty_reasons { map { $_->{details} || $_->{tag} || 'AMNESTY' } $_[0]->other_amnesty } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
other_amnesty_reasons: called CC=3 SCAR=13.1
Pod
documented
Condition40%2/5
$_->{'details'} || $_->{'tag'} || 'AMNESTY'
$_->{"details"} or $_->{"tag"}
MC/DC0%0/2
$_->{'details'} || $_->{'tag'} || 'AMNESTY'
$_->{"details"}
$_->{"tag"}
Truth table33%1/3
A or B
A= $_->{"details"}B= $_->{"tag"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | 50 | ▶ | sub has_errors { $_[0]->{+FACET_DATA}->{errors} ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_errors: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | 0 | ▶ | sub the_errors { $_[0]->the_facet('errors') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
the_errors: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | 26 | ▶ | sub errors { $_[0]->facet('errors') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
errors: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | 10 | ▶ | sub error_messages { map { $_->{details} || $_->{tag} || 'ERROR' } $_[0]->errors } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
error_messages: called CC=3 SCAR=13.1
Pod
documented
Condition40%2/5
$_->{'details'} || $_->{'tag'} || 'ERROR'
$_->{"details"} or $_->{"tag"}
MC/DC0%0/2
$_->{'details'} || $_->{'tag'} || 'ERROR'
$_->{"details"}
$_->{"tag"}
Truth table33%1/3
A or B
A= $_->{"details"}B= $_->{"tag"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | 30 | ▶ | sub error_brief { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
error_brief: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | 30 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | 30 | ▶ | my $errors = $self->{+FACET_DATA}->{errors} or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | 10 | ▶ | my $base = @$errors > 1 ? "ERRORS" : "ERROR"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | 10 | ▶ | return $base unless @$errors; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | 10 | my ($msg, @extra) = split /[\n\r]+/, $errors->[0]->{details}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | 10 | my $out = "$base: $msg"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | 10 | ▶ | $out .= " [...]" if @extra || @$errors > 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@extra or @$errors > 1
MC/DC100%2/2
@extra or @$errors > 1
@extra
@$errors > 1
Truth table100%3/3
A or B
A= @extraB= @$errors > 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | 10 | return $out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 34 | ▶ | sub has_info { $_[0]->{+FACET_DATA}->{info} ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
has_info: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | 0 | ▶ | sub the_info { $_[0]->the_facet('info') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
the_info: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | 64 | ▶ | sub info { $_[0]->facet('info') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | 7 | ▶ | sub info_messages { map { $_->{details} } $_[0]->info } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info_messages: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | 3 | ▶ | sub has_diags { &first(sub { uc($_->{tag}) eq 'DIAG' }, $_[0]->info) ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Subroutine
has_diags: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | 10 | ▶ | sub diags { grep { uc($_->{tag}) eq 'DIAG' } $_[0]->info } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
diags: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | 8 | ▶ | sub diag_messages { map { $_->{details} || 'DIAG' } $_[0]->diags } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
diag_messages: called CC=2 SCAR=7.2
Pod
documented
Condition50%1/2
$_->{'details'} || 'DIAG'
MC/DC0%0/1
$_->{'details'} || 'DIAG'
$_->{'details'}
Truth table50%1/2
A
A= $_->{'details'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | 5 | ▶ | sub has_notes { &first(sub { uc($_->{tag}) eq 'NOTE' }, $_[0]->info) ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Subroutine
has_notes: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | 10 | ▶ | sub notes { grep { uc($_->{tag}) eq 'NOTE' } $_[0]->info } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
notes: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | 8 | ▶ | sub note_messages { map { $_->{details} || 'NOTE' } $_[0]->notes } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
note_messages: called CC=2 SCAR=7.2
Pod
documented
Condition50%1/2
$_->{'details'} || 'NOTE'
MC/DC0%0/1
$_->{'details'} || 'NOTE'
$_->{'details'}
Truth table50%1/2
A
A= $_->{'details'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | 98 | my %NOTE_OR_DIAG = (NOTE => 1, DIAG => 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | 5 | ▶ | sub has_other_info { &first(sub { !$NOTE_OR_DIAG{uc($_->{tag})} }, $_[0]->info) ? 1 : 0 } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Subroutine
has_other_info: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | 4 | ▶ | sub other_info { grep { !$NOTE_OR_DIAG{uc($_->{tag})} } $_[0]->info } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
other_info: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | 2 | ▶ | sub other_info_messages { map { $_->{details} || $_->{tag} || 'INFO' } $_[0]->other_info } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
other_info_messages: called CC=3 SCAR=13.1
Pod
documented
Condition40%2/5
$_->{'details'} || $_->{'tag'} || 'INFO'
$_->{"details"} or $_->{"tag"}
MC/DC0%0/2
$_->{'details'} || $_->{'tag'} || 'INFO'
$_->{"details"}
$_->{"tag"}
Truth table33%1/3
A or B
A= $_->{"details"}B= $_->{"tag"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | 98 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||