| 1 | 53 | ▶ | use strict; use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 2 | package Lingy::Util; | ||||||||||||||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 53 | ▶ | use Lingy::Common; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 9 | ▶ | sub identical { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
identical: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 9 | BOOLEAN->new(refaddr($_[0]) == refaddr($_[1])); | |||||||||||||||||||||||||||||||||||||||||||||
| 8 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | #------------------------------------------------------------------------------ | ||||||||||||||||||||||||||||||||||||||||||||||
| 11 | # Devel functions: | ||||||||||||||||||||||||||||||||||||||||||||||
| 12 | #------------------------------------------------------------------------------ | ||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 4 | ▶ | sub applyTo { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
applyTo: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 4 | my ($method, $args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 16 | 53 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 4 | &{"$method"}(@$args); | |||||||||||||||||||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | sub eval_perl { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
eval_perl: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | my $ret = eval("$_[0]"); | |||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | $_[1] // $ret; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$_[1] // $ret
MC/DC0%0/2
$_[1] // $ret
$_[1]
$ret
Truth table0%0/3
A // B
A= $_[1]B= $ret
| |||||||||||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 2 | ▶ | sub rt_internal { my $m = "$_[0]"; RT->$m } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
rt_internal: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | sub env_data { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
env_data: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | my $env = $Lingy::Evaluator::ENV; | |||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | my $www = {}; | |||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | my $w = $www; | |||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | my $e = $env; | |||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | while ($e) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | $w->{'+'} = join ' ', sort CORE::keys %{$e->space}; | |||||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | $w->{'^'} = {}; | |||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | $w = $w->{'^'}; | |||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | $e = $e->{outer}; | |||||||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | bless $www, 'lingy-internal'; | |||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 20318 | ▶ | sub equiv { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
equiv: called CC=13 SCAR=25.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 20318 | my ($x, $y) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 43 | 20318 | ▶ | return false | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
$x->isa("Lingy::ListClass") and $y->isa("Lingy::ListClass") or ref $x eq ref $y
$x->isa("Lingy::ListClass") and $y->isa("Lingy::ListClass")
MC/DC100%3/3
$x->isa("Lingy::ListClass") and $y->isa("Lingy::ListClass") or ref $x eq ref $y
$x->isa("Lingy::ListClass")
$y->isa("Lingy::ListClass")
ref $x eq ref $y
Truth table80%4/5
A and B or C
A= $x->isa("Lingy::ListClass")B= $y->isa("Lingy::ListClass")C= ref $x eq ref $y
| |||||||||||||||||||||||||||||||||||||||||||||||
| 44 | unless | ||||||||||||||||||||||||||||||||||||||||||||||
| 45 | ( | ||||||||||||||||||||||||||||||||||||||||||||||
| 46 | $x->isa(LISTTYPE) and | ||||||||||||||||||||||||||||||||||||||||||||||
| 47 | $y->isa(LISTTYPE) | ||||||||||||||||||||||||||||||||||||||||||||||
| 48 | ) or ref($x) eq ref($y); | ||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 20300 | ▶ | if ($x->isa(LISTTYPE)) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 26 | ▶ | return false unless @$x == @$y; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 21 | ▶ | for (my $i = 0; $i < @$x; $i++) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 23 | my $bool = equiv($x->[$i], $y->[$i]); | |||||||||||||||||||||||||||||||||||||||||||||
| 53 | 23 | ▶ | return false if "$bool" eq '0'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 21 | return true; | |||||||||||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 20274 | ▶ | if ($x->isa(HASHMAP)) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 9 | my @xkeys = sort map "$_", keys %$x; | |||||||||||||||||||||||||||||||||||||||||||||
| 59 | 9 | my @ykeys = sort map "$_", keys %$y; | |||||||||||||||||||||||||||||||||||||||||||||
| 60 | 9 | ▶ | return false unless @xkeys == @ykeys; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 8 | my @xvals = map $x->{$_}, @xkeys; | |||||||||||||||||||||||||||||||||||||||||||||
| 62 | 8 | my @yvals = map $y->{$_}, @ykeys; | |||||||||||||||||||||||||||||||||||||||||||||
| 63 | 8 | ▶ | for (my $i = 0; $i < @xkeys; $i++) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 10 | ▶ | return false unless "$xkeys[$i]" eq "$ykeys[$i]"; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 10 | my $bool = equiv($xvals[$i], $yvals[$i]); | |||||||||||||||||||||||||||||||||||||||||||||
| 66 | 10 | ▶ | return false if "$bool" eq '0'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 7 | return true; | |||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 20265 | BOOLEAN->new($$x eq $$y); | |||||||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 53 | 1; | |||||||||||||||||||||||||||||||||||||||||||||