Diff/Filter.pm

filter: Statementstmt 98.3% 117 / 119 Branchbran 86.9% 80 / 92 Conditioncond 92.2% 71 / 77 MC/DCmcdc 88.6% 39 / 44 Subroutinesub 94.7% 18 / 19 Podpod 0.0% 0 / 7 totaltotal 90.7% 325 / 358 CC 78 SCAR 22.5
CC
78
Cov
93%
_info_filter
17.0
filter
11.7
_deep_value_filter
11.4
CRAP 9.5
« Diff.pm ↑ Summary Diff/Source.pm »
1 package DBIx::Class::Schema::Diff::Filter;
2 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # Further filters diff data produced by DBIx::Class::Schema::Diff
6  
7 5 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 with 'DBIx::Class::Schema::Diff::Role::Common';
9  
10 5 ▶use Types::Standard qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 108 ▶has 'mode', is => 'ro', isa => Enum[qw(limit ignore)], default => sub{'limit'};
Subroutine __ANON__: called CC=1 SCAR=0.0
13 0 ▶has 'match', is => 'ro', isa => Maybe[InstanceOf['Hash::Layout']], default => sub{undef};
Subroutine __ANON__: not called CC=1 SCAR=1.2
14  
15 5 has 'events', is => 'ro', coerce => \&_coerce_list_hash,
16 isa => Maybe[Map[Enum[qw(added changed deleted)],Bool]];
17  
18 5 has 'source_events', is => 'ro', coerce => \&_coerce_list_hash,
19 isa => Maybe[Map[Enum[qw(added changed deleted)],Bool]];
20  
21 has 'empty_match', is => 'ro', lazy => 1, default => sub {
22 108 ▶ my $self = shift;
Subroutine __ANON__: called CC=2 SCAR=6.9
23 108 ▶ return (scalar(keys %{$self->match->Data}) > 0) ? 0 : 1;
Branch: 1 branch
BranchTrueFalseTotal
scalar keys %{$self->match->Data;} > 0 ? : 103 5 108
24 5 }, init_arg => undef, isa => Bool;
25  
26 127 ▶has 'matched_paths', is => 'ro', init_arg => undef, default => sub {[]};
Subroutine __ANON__: called CC=1 SCAR=0.0
27  
28 sub filter {
29 127 ▶ my ($self, $diff) = @_;
Subroutine filter: called CC=11 SCAR=24.6
Pod undocumented
30 127 ▶ return undef unless ($diff);
Branch: 1 branch
BranchTrueFalseTotal
unless $diff 0 127 127
31
32 127 my $newd = {};
33 127 for my $s_name (keys %$diff) {
34 719 my $h = $diff->{$s_name};
35 next if (
36 $self->skip_source($s_name)
37 || $self->_is_skip( source_events => $h->{_event})
38 719 ▶ );
Branch: 1 branch
BranchTrueFalseTotal
if $self->skip_source($s_name) or $self->_is_skip("source_events", $h->{"_event"}) 199 520 719
Condition100%3/3
$self->skip_source($s_name) or $self->_is_skip("source_events", $h->{"_event"})
l!l&&r!l&&!r
17821520
MC/DC100%2/2
$self->skip_source($s_name) or $self->_is_skip("source_events", $h->{"_event"})
$self->skip_source($s_name) $self->_is_skip("source_events", $h->{"_event"})
Truth table100%3/3
A or B
A= $self->skip_source($s_name)B= $self->_is_skip("source_events", $h->{"_event"})
ABresult
1X1
011
000
39
40 520 $newd->{$s_name} = $self->source_filter( $s_name => $h );
41 520 ▶ delete $newd->{$s_name} unless (defined $newd->{$s_name});
Branch: 1 branch
BranchTrueFalseTotal
unless defined $newd->{$s_name} 0 520 520
42  
43 # Strip if the event is 'changed' but the diff data has been stripped
44 delete $newd->{$s_name} if (
45 $newd->{$s_name} &&
46 $newd->{$s_name}{_event} &&
47 $newd->{$s_name}{_event} eq 'changed' &&
48 520 ▶ scalar(keys %{$newd->{$s_name}}) == 1
Branch: 1 branch
BranchTrueFalseTotal
if $newd->{$s_name} and $newd->{$s_name}{"_event"} and $newd->{$s_name}{"_event"} eq "changed" and scalar keys %{$$newd{$s_name};} == 1 125 395 520
Condition66%6/9
$newd->{$s_name} and $newd->{$s_name}{"_event"} and $newd->{$s_name}{"_event"} eq "changed" and scalar keys %{$$newd{$s_name};} == 1
!ll&&!rl&&r
94301125
$newd->{$s_name} and $newd->{$s_name}{"_event"} and $newd->{$s_name}{"_event"} eq "changed"
!ll&&!rl&&r
094426
$newd->{$s_name} and $newd->{$s_name}{"_event"}
!ll&&!rl&&r
00520
MC/DC50%2/4
$newd->{$s_name} and $newd->{$s_name}{"_event"} and $newd->{$s_name}{"_event"} eq "changed" and scalar keys %{$$newd{$s_name};} == 1
$newd->{$s_name} $newd->{$s_name}{"_event"} $newd->{$s_name}{"_event"} eq "changed" scalar keys %{$$newd{$s_name};} == 1
Truth table60%3/5
A and B and C and D
A= $newd->{$s_name}B= $newd->{$s_name}{"_event"}C= $newd->{$s_name}{"_event"} eq "changed"D= scalar keys %{$$newd{$s_name};} == 1
ABCDresult
0XXX0
10XX0
110X0
11100
11111
49 );
50 }
51
52 127 ▶ return scalar(keys %$newd) > 0 ? $newd : undef;
Branch: 1 branch
BranchTrueFalseTotal
scalar keys %$newd > 0 ? : 127 0 127
53 }
54  
55  
56 sub source_filter {
57 520 ▶ my ($self, $s_name, $diff) = @_;
Subroutine source_filter: called CC=10 SCAR=23.1
Pod undocumented
58 520 ▶ return undef unless ($diff);
Branch: 1 branch
BranchTrueFalseTotal
unless $diff 0 520 520
59
60 520 my $newd = {};
61 520 for my $type (keys %$diff) {
62 1221 ▶ next if ($type ne '_event' && $self->skip_type($s_name => $type));
Branch: 1 branch
BranchTrueFalseTotal
if $type ne "_event" and $self->skip_type($s_name, $type) 201 1020 1221
Condition100%3/3
$type ne "_event" and $self->skip_type($s_name, $type)
!ll&&!rl&&r
520500201
MC/DC100%2/2
$type ne "_event" and $self->skip_type($s_name, $type)
$type ne "_event" $self->skip_type($s_name, $type)
Truth table100%3/3
A and B
A= $type ne "_event"B= $self->skip_type($s_name, $type)
ABresult
0X0
100
111
63 1020 my $val = $diff->{$type};
64 1020 ▶ if($type eq 'columns' || $type eq 'relationships' || $type eq 'constraints') {
Branch: 1 branch
BranchTrueFalseTotal
if ($type eq 'columns' or $type eq 'relationships' or $type eq 'constraints') { } 338 682 1020
Condition100%6/6
$type eq "columns" or $type eq "relationships" or $type eq "constraints"
l!l&&r!l&&!r
191147682
$type eq "columns" or $type eq "relationships"
l!l&&r!l&&!r
9398829
MC/DC100%3/3
$type eq "columns" or $type eq "relationships" or $type eq "constraints"
$type eq "columns" $type eq "relationships" $type eq "constraints"
Truth table100%4/4
A or B or C
A= $type eq "columns"B= $type eq "relationships"C= $type eq "constraints"
ABCresult
1XX1
01X1
0011
0000
65 338 $newd->{$type} = $self->_info_filter( $type, $s_name => $val );
66 338 ▶ delete $newd->{$type} unless (defined $newd->{$type});
Branch: 1 branch
BranchTrueFalseTotal
unless defined $newd->{$type} 86 252 338
67 }
68 else {
69 682 $newd->{$type} = $val
70 }
71 }
72
73 520 ▶ return (scalar(keys %$newd) > 0) ? $newd : undef;
Branch: 1 branch
BranchTrueFalseTotal
scalar keys %$newd > 0 ? : 520 0 520
74 }
75  
76 sub _should_skip_info_item {
77 707 ▶ my ($self, $type, $s_name, $name, $data) = @_;
Subroutine _should_skip_info_item: called CC=3 SCAR=11.0
78 707 ▶ return 1 if ($self->_is_skip( 'events' => $data->{_event} ));
Branch: 1 branch
BranchTrueFalseTotal
if $self->_is_skip("events", $data->{"_event"}) 6 701 707
79 701 ▶ return 1 if ($self->skip_type_id($s_name, $type => $name ));
Branch: 1 branch
BranchTrueFalseTotal
if $self->skip_type_id($s_name, $type, $name) 150 551 701
80 551 return 0
81 }
82  
83 sub _info_filter {
84 338 ▶ my ($self, $type, $s_name, $items) = @_;
Subroutine _info_filter: called CC=17 SCAR=28.3
85 338 ▶ return undef unless ($items);
Branch: 1 branch
BranchTrueFalseTotal
unless $items 0 338 338
86  
87 338 my $new_items = {};
88  
89 338 for my $name (keys %$items) {
90
91 #next if ($self->_should_skip_info_item($type, $s_name, $name, $items->{$name}));
92
93 567 ▶ if($items->{$name}{_event} eq 'changed') {
Branch: 1 branch
BranchTrueFalseTotal
if ($items->{$name}{'_event'} eq 'changed') { } 280 287 567
94
95 280 my $check = $self->test_path($s_name, $type, $name);
96 280 my $globmatch = 0;
97 280 ▶ my $filter_deep = ($check && ref($check) eq 'HASH');
Condition100%3/3
$check && ref $check eq 'HASH'
!ll&&!rl&&r
2013247
MC/DC100%2/2
$check && ref $check eq 'HASH'
$check ref $check eq 'HASH'
Truth table100%3/3
A && B
A= $checkB= ref $check eq 'HASH'
ABresult
0X0
100
111
98
99 280 ▶ unless($filter_deep) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($filter_deep) 233 47 280
100 233 my $diff = $items->{$name}{diff};
101 233 for my $k (keys %$diff) {
102
103 233 ▶ if($self->match->lookup_path_globmatch($s_name, $type, $name, $k)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->match->lookup_path_globmatch($s_name, $type, $name, $k)) 14 219 233
104 14 $globmatch = 1;
105 14 last;
106 }
107 }
108 }
109
110 280 ▶ $filter_deep = ($check && ref($check) eq 'HASH') || $globmatch;
Condition100%6/6
$check && ref $check eq 'HASH' || $globmatch
l!l&&r!l&&!r
4714219
$check and ref $check eq "HASH"
!ll&&!rl&&r
2013247
MC/DC100%3/3
$check && ref $check eq 'HASH' || $globmatch
$check ref $check eq "HASH" $globmatch
Truth table80%4/5
A and B || C
A= $checkB= ref $check eq "HASH"C= $globmatch
ABCresult
11X1
0X11
1011
0X00
1000
111
112 280 ▶ next if (!$globmatch && $self->_should_skip_info_item($type, $s_name, $name, $items->{$name}));
Branch: 1 branch
BranchTrueFalseTotal
if not $globmatch and $self->_should_skip_info_item($type, $s_name, $name, $items->{$name}) 65 215 280
Condition100%3/3
not $globmatch and $self->_should_skip_info_item($type, $s_name, $name, $items->{$name})
!ll&&!rl&&r
1420165
MC/DC100%2/2
not $globmatch and $self->_should_skip_info_item($type, $s_name, $name, $items->{$name})
not $globmatch $self->_should_skip_info_item($type, $s_name, $name, $items->{$name})
Truth table100%3/3
not(A) and B
A= not $globmatchB= $self->_should_skip_info_item($type, $s_name, $name, $items->{$name})
ABresult
0X0
100
111
113
114 215 ▶ if($filter_deep) {
Branch: 1 branch
BranchTrueFalseTotal
if ($filter_deep) { } 61 154 215
115 my $new_diff = $self->_deep_value_filter(
116 61 ▶ $items->{$name}{diff}, $s_name, $type, $name
Branch: 1 branch
BranchTrueFalseTotal
my $new_diff = $self->_deep_value_filter($items->{$name}{"diff"}, $s_name, $type, $name) or next 23 38 61
117 ) or next;
118
119 38 $new_items->{$name} = {
120 _event => 'changed',
121 diff => $new_diff
122 };
123 }
124 else {
125 # Allow through as-is:
126 154 ▶ $new_items->{$name} = $items->{$name} unless ($self->_should_skip_info_item($type, $s_name, $name, $items->{$name}))
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_should_skip_info_item($type, $s_name, $name, $items->{$name}) 154 0 154
127 }
128 }
129 else {
130 # Allow through as-is:
131 287 ▶ $new_items->{$name} = $items->{$name} unless ($self->_should_skip_info_item($type, $s_name, $name, $items->{$name}))
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_should_skip_info_item($type, $s_name, $name, $items->{$name}) 196 91 287
132 #if($self->match->lookup_leaf_path($s_name, $type, $name));
133 }
134 }
135
136 338 ▶ return scalar(keys %$new_items) > 0 ? $new_items : undef;
Branch: 1 branch
BranchTrueFalseTotal
scalar keys %$new_items > 0 ? : 252 86 338
137 }
138  
139 sub _deep_value_filter {
140 73 ▶ my ($self, $hash, @path) = @_;
Subroutine _deep_value_filter: called CC=11 SCAR=24.3
141
142 73 my $new_hash = {};
143 73 for my $k (keys %$hash) {
144 73 my $val = $hash->{$k};
145 73 my $set = $self->test_path(@path,$k);
146  
147 73 ▶ if($set) {
Branch: 1 branch
BranchTrueFalseTotal
if ($set) { } 51 22 73
148 51 ▶ if($val && ref($val) eq 'HASH' && ref($set) eq 'HASH' && scalar(keys %$val) > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($val and ref $val eq 'HASH' and ref $set eq 'HASH' and scalar keys %$val > 0) { } 12 39 51
Condition77%7/9
$val and ref $val eq "HASH" and ref $set eq "HASH" and scalar keys %$val > 0
!ll&&!rl&&r
39012
$val and ref $val eq "HASH" and ref $set eq "HASH"
!ll&&!rl&&r
162312
$val and ref $val eq "HASH"
!ll&&!rl&&r
01635
MC/DC50%2/4
$val and ref $val eq "HASH" and ref $set eq "HASH" and scalar keys %$val > 0
$val ref $val eq "HASH" ref $set eq "HASH" scalar keys %$val > 0
Truth table60%3/5
A and B and C and D
A= $valB= ref $val eq "HASH"C= ref $set eq "HASH"D= scalar keys %$val > 0
ABCDresult
0XXX0
10XX0
110X0
11100
11111
149 12 $new_hash->{$k} = $self->_deep_value_filter($val,@path,$k);
150 12 ▶ delete $new_hash->{$k} unless (defined $new_hash->{$k});
Branch: 1 branch
BranchTrueFalseTotal
unless defined $new_hash->{$k} 0 12 12
151 }
152 else {
153 39 ▶ next if ($self->mode eq 'ignore');
Branch: 1 branch
BranchTrueFalseTotal
if $self->mode eq "ignore" 1 38 39
154 38 $new_hash->{$k} = $val;
155 }
156 }
157 else {
158 22 ▶ next if ($self->mode eq 'limit');
Branch: 1 branch
BranchTrueFalseTotal
if $self->mode eq "limit" 22 0 22
159 0 $new_hash->{$k} = $val;
160 }
161 }
162
163 73 ▶ return scalar(keys %$new_hash) > 0 ? $new_hash : undef;
Branch: 1 branch
BranchTrueFalseTotal
scalar keys %$new_hash > 0 ? : 50 23 73
164 }
165  
166  
167 sub _is_skip {
168 1248 ▶ my ($self, $meth, $key) = @_;
Subroutine _is_skip: called CC=4 SCAR=13.9
169 1248 my $h = $self->$meth;
170 1248 ▶ $self->mode eq 'limit' ? $h && ! $h->{$key} : $h && $h->{$key};
Branch: 1 branch
BranchTrueFalseTotal
$self->mode eq 'limit' ? : 989 259 1248
Condition100%6/6
$h and not $h->{$key}
!ll&&!rl&&r
98117
$h and $h->{$key}
!ll&&!rl&&r
2162320
MC/DC100%2/2
$h and not $h->{$key}
$h not $h->{$key}
MC/DC100%2/2
$h and $h->{$key}
$h $h->{$key}
Truth table100%3/3
A and not(B)
A= $hB= not $h->{$key}
ABresult
0X0
100
111
Truth table100%3/3
A and B
A= $hB= $h->{$key}
ABresult
0X0
100
111
171 }
172  
173  
174 sub skip_source {
175 719 ▶ my ($self, $s_name) = @_;
Subroutine skip_source: called CC=8 SCAR=20.8
Pod undocumented
176 719 ▶ my $HL = $self->match or return 0;
Branch: 1 branch
BranchTrueFalseTotal
my $HL = $self->match or return 0 0 719 719
177 719 ▶ my $set = $self->test_path($s_name) || 0;
Condition100%2/2
$self->test_path($s_name) || 0
l!l
433286
MC/DC100%1/1
$self->test_path($s_name) || 0
$self->test_path($s_name)
Truth table100%2/2
A
A= $self->test_path($s_name)
Aresult
11
00
178
179 719 ▶ if($self->mode eq 'limit') {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->mode eq 'limit') { } 602 117 719
180 602 ▶ return 0 if ($self->empty_match);
Branch: 1 branch
BranchTrueFalseTotal
if $self->empty_match 40 562 602
181 562 ▶ return $set ? 0 : 1;
Branch: 1 branch
BranchTrueFalseTotal
$set ? : 388 174 562
182 }
183 else {
184 117 ▶ return $set && ! ref($set) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$set && !ref($set) ? : 4 113 117
Condition100%3/3
$set and not ref $set
!ll&&!rl&&r
72414
MC/DC100%2/2
$set and not ref $set
$set not ref $set
Truth table100%3/3
A and not(B)
A= $setB= not ref $set
ABresult
0X0
100
111
185 }
186 }
187  
188 sub skip_type {
189 701 ▶ my ($self, $s_name, $type) = @_;
Subroutine skip_type: called CC=8 SCAR=20.8
Pod undocumented
190 701 ▶ my $HL = $self->match or return 0;
Branch: 1 branch
BranchTrueFalseTotal
my $HL = $self->match or return 0 0 701 701
191 701 my $set = $self->test_path($s_name,$type);
192
193 701 ▶ if($self->mode eq 'limit') {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->mode eq 'limit') { } 586 115 701
194 586 ▶ return 0 if ($self->empty_match);
Branch: 1 branch
BranchTrueFalseTotal
if $self->empty_match 44 542 586
195 # If this source/type is set, OR if the entire source is included:
196 542 ▶ return $set || $self->test_leaf_path($s_name) ? 0 : 1;
Branch: 1 branch
BranchTrueFalseTotal
$set || $self->test_leaf_path($s_name) ? : 357 185 542
Condition100%3/3
$set or $self->test_leaf_path($s_name)
l!l&&r!l&&!r
29859185
MC/DC100%2/2
$set or $self->test_leaf_path($s_name)
$set $self->test_leaf_path($s_name)
Truth table100%3/3
A or B
A= $setB= $self->test_leaf_path($s_name)
ABresult
1X1
011
000
197 }
198 else {
199 115 ▶ return $set && ! ref($set) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$set && !ref($set) ? : 16 99 115
Condition100%3/3
$set and not ref $set
!ll&&!rl&&r
732616
MC/DC100%2/2
$set and not ref $set
$set not ref $set
Truth table100%3/3
A and not(B)
A= $setB= not ref $set
ABresult
0X0
100
111
200 }
201 }
202  
203 sub skip_type_id {
204 701 ▶ my ($self, $s_name, $type, $id) = @_;
Subroutine skip_type_id: called CC=9 SCAR=22.0
Pod undocumented
205  
206 701 ▶ my $HL = $self->match or return 0;
Branch: 1 branch
BranchTrueFalseTotal
my $HL = $self->match or return 0 0 701 701
207 701 my $set = $self->test_path($s_name,$type,$id);
208
209 701 ▶ if($self->mode eq 'limit') {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->mode eq 'limit') { } 561 140 701
210 561 ▶ return 0 if ($self->empty_match);
Branch: 1 branch
BranchTrueFalseTotal
if $self->empty_match 76 485 561
211  
212 # If this source/type is set, OR if the entire source or source/type is included:
213 485 ▶ return $set
Branch: 1 branch
BranchTrueFalseTotal
$set || $self->test_leaf_path($s_name) || $self->test_leaf_path($s_name, $type) ? : 346 139 485
Condition100%6/6
$set or $self->test_leaf_path($s_name) or $self->test_leaf_path($s_name, $type)
l!l&&r!l&&!r
200146139
$set or $self->test_leaf_path($s_name)
l!l&&r!l&&!r
10892285
MC/DC100%3/3
$set or $self->test_leaf_path($s_name) or $self->test_leaf_path($s_name, $type)
$set $self->test_leaf_path($s_name) $self->test_leaf_path($s_name, $type)
Truth table100%4/4
A or B or C
A= $setB= $self->test_leaf_path($s_name)C= $self->test_leaf_path($s_name, $type)
ABCresult
1XX1
01X1
0011
0000
214 || $self->test_leaf_path($s_name)
215 || $self->test_leaf_path($s_name,$type) ? 0 : 1;
216 }
217 else {
218 140 ▶ return $set && ! ref($set) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$set && !ref($set) ? : 11 129 140
Condition100%3/3
$set and not ref $set
!ll&&!rl&&r
126311
MC/DC100%2/2
$set and not ref $set
$set not ref $set
Truth table100%3/3
A and not(B)
A= $setB= not ref $set
ABresult
0X0
100
111
219 }
220 }
221  
222 sub test_path {
223 2474 ▶ my ($self, @path) = @_;
Subroutine test_path: called CC=2 SCAR=6.9
Pod undocumented
224 2474 ▶ return $self->test_leaf_path(@path) || $self->match->lookup_path(@path)
Condition100%3/3
$self->test_leaf_path(@path) || $self->match->lookup_path(@path)
l!l&&r!l&&!r
3107151449
MC/DC100%2/2
$self->test_leaf_path(@path) || $self->match->lookup_path(@path)
$self->test_leaf_path(@path) $self->match->lookup_path(@path)
Truth table100%3/3
A || B
A= $self->test_leaf_path(@path)B= $self->match->lookup_path(@path)
ABresult
1X1
011
000
225 }
226  
227 sub test_leaf_path {
228 3380 ▶ my ($self, @path) = @_;
Subroutine test_leaf_path: called CC=4 SCAR=13.9
Pod undocumented
229 3380 ▶ my $ret = $self->match->lookup_leaf_path(@path) || $self->match->lookup_path_globmatch(@path);
Condition100%3/3
$self->match->lookup_leaf_path(@path) || $self->match->lookup_path_globmatch(@path)
l!l&&r!l&&!r
551562773
MC/DC100%2/2
$self->match->lookup_leaf_path(@path) || $self->match->lookup_path_globmatch(@path)
$self->match->lookup_leaf_path(@path) $self->match->lookup_path_globmatch(@path)
Truth table100%3/3
A || B
A= $self->match->lookup_leaf_path(@path)B= $self->match->lookup_path_globmatch(@path)
ABresult
1X1
011
000
230 3380 ▶ push @{$self->matched_paths}, \@path if (
Branch: 1 branch
BranchTrueFalseTotal
if $ret and not ref $ret 607 2773 3380
Condition66%2/3
$ret and not ref $ret
!ll&&!rl&&r
27730607
MC/DC50%1/2
$ret and not ref $ret
$ret not ref $ret
Truth table66%2/3
A and not(B)
A= $retB= not ref $ret
ABresult
0X0
100
111
231 $ret
232 # We don't want to record the path as "matched" for empty HashRef {} leafs
233 && ! ref $ret
234 );
235 3380 return $ret;
236 }
237  
238 5 1;
239  
240  
241 __END__
242  
243 =pod
244  
245 =head1 NAME
246  
247 DBIx::Class::Schema::Diff::Filter - internal filtering object class
248  
249 =head1 DESCRIPTION
250  
251 This class is used internally by L<DBIx::Class::Schema::Diff> and is not meant to be called directly.
252  
253 Please refer to the main L<DBIx::Class::Schema::Diff> documentation for more info.
254  
255 =head1 AUTHOR
256  
257 Henry Van Styn <vanstyn@cpan.org>
258  
259 =head1 COPYRIGHT AND LICENSE
260  
261 This software is copyright (c) 2014 by IntelliTree Solutions llc.
262  
263 This is free software; you can redistribute it and/or modify it under
264 the same terms as the Perl 5 programming language system itself.
265  
266 =cut
« Diff.pm ↑ Summary Diff/Source.pm »