| 1 | package Data::Hash::Diff::Smart::Renderer::Text; | ||||||||||||||||||||||
| 2 | |||||||||||||||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 5 | |||||||||||||||||||||||
| 6 | 74 | ▶ | sub render { | ||||||||||||||||||||
|
Subroutine
render: called CC=10 SCAR=23.0
Pod
undocumented
| |||||||||||||||||||||||
| 7 | 74 | my $changes = $_[0]; | |||||||||||||||||||||
| 8 | |||||||||||||||||||||||
| 9 | 74 | ▶ | return '' unless @{$changes}; | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 10 | |||||||||||||||||||||||
| 11 | 63 | my @out; | |||||||||||||||||||||
| 12 | |||||||||||||||||||||||
| 13 | 63 | for my $c (@$changes) { | |||||||||||||||||||||
| 14 | 101 | my $op = $c->{op}; | |||||||||||||||||||||
| 15 | 101 | my $path = $c->{path}; | |||||||||||||||||||||
| 16 | |||||||||||||||||||||||
| 17 | 101 | ▶ | if ($op eq 'change') { | ||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||
| 18 | push @out, | ||||||||||||||||||||||
| 19 | "~ $path", | ||||||||||||||||||||||
| 20 | '- ' . ($c->{from} // ''), | ||||||||||||||||||||||
| 21 | 60 | ▶ | '+ ' . ($c->{to} // ''), | ||||||||||||||||||||
|
Condition100%4/4
$c->{"from"} // ""
$c->{"to"} // ""
MC/DC100%1/1
$c->{"from"} // ""
$c->{"from"}
MC/DC100%1/1
$c->{"to"} // ""
$c->{"to"}
Truth table100%2/2
A
A= $c->{"from"}
Truth table100%2/2
A
A= $c->{"to"}
| |||||||||||||||||||||||
| 22 | ''; | ||||||||||||||||||||||
| 23 | } elsif ($op eq 'add') { | ||||||||||||||||||||||
| 24 | push @out, | ||||||||||||||||||||||
| 25 | "+ $path", | ||||||||||||||||||||||
| 26 | 21 | ▶ | '+ ' . ($c->{value} // ''), | ||||||||||||||||||||
|
Condition100%2/2
$c->{"value"} // ""
MC/DC100%1/1
$c->{"value"} // ""
$c->{"value"}
Truth table100%2/2
A
A= $c->{"value"}
| |||||||||||||||||||||||
| 27 | ''; | ||||||||||||||||||||||
| 28 | } elsif ($op eq 'remove') { | ||||||||||||||||||||||
| 29 | push @out, | ||||||||||||||||||||||
| 30 | "- $path", | ||||||||||||||||||||||
| 31 | 17 | ▶ | '- ' . ($c->{from} // ''), | ||||||||||||||||||||
|
Condition50%1/2
$c->{"from"} // ""
MC/DC0%0/1
$c->{"from"} // ""
$c->{"from"}
Truth table50%1/2
A
A= $c->{"from"}
| |||||||||||||||||||||||
| 32 | ''; | ||||||||||||||||||||||
| 33 | } else { | ||||||||||||||||||||||
| 34 | 3 | push @out, "# unknown op: $op"; | |||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||
| 37 | |||||||||||||||||||||||
| 38 | 63 | return join("\n", @out) . "\n"; | |||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||
| 40 | |||||||||||||||||||||||
| 41 | 6 | 1; | |||||||||||||||||||||