SVGPDF/Use.pm

filter: Statementstmt 88.1% 37 / 42 Branchbran 50.0% 4 / 8 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 77.4% 48 / 62 CC 6 SCAR 14.5
CC
6
Cov
79%
process
6.9
BEGIN
1.0
BEGIN
1.0
CRAP 4.2
« SVGPDF/PAST.pm ↑ Summary SVGPDF/Polyline.pm »
1 #! perl
2  
3 2 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Object::Pad;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Storable;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 class SVGPDF::Use :isa(SVGPDF::Element);
10  
11 5 ▶method process () {
Subroutine process: called CC=6 SCAR=19.4
Pod undocumented
12 5 my $atts = $self->atts;
13 5 my $xo = $self->xo;
14 5 ▶ return if $atts->{omit}; # for testing/debugging.
Branch: 1 branch
BranchTrueFalseTotal
if $atts->{"omit"} 0 5 5
15  
16 5 my ( $x, $y, $hr, $tf ) =
17 $self->get_params( $atts, qw( x:H y:V href:! transform:s ) );
18  
19 5 my $r = $self->root->defs->{$hr};
20 5 ▶ unless ( $r ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($r) 0 5 5
21 0 warn("SVG: Missing def for use \"$hr\" (skipped)\n");
22 0 $self->css_pop;
23 0 return;
24 }
25  
26 # Update its xo.
27 5 $r->xo = $self->xo;
28  
29 5 $self->_dbg( $self->name, " \"$hr\" (", $r->name, "), x=$x, y=$y" );
30  
31 5 $self->_dbg("+ xo save");
32 5 $xo->save;
33 5 ▶ if ( $x || $y ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($x or $y) 0 5 5
Condition33%1/3
$x or $y
l!l&&r!l&&!r
005
MC/DC0%0/2
$x or $y
$x $y
Truth table33%1/3
A or B
A= $xB= $y
ABresult
1X1
011
000
34 0 $self->_dbg( "translate( %.2f %.2f )", $x, $y );
35 0 $xo->transform( translate => [ $x, $y ] );
36 }
37 5 ▶ $self->set_transform($tf) if $tf;
Branch: 1 branch
BranchTrueFalseTotal
if $tf 0 5 5
38 5 $self->set_graphics;
39 5 $r->process;
40 5 $self->_dbg("- xo restore");
41 5 $xo->restore;
42 5 $self->css_pop;
43 2 }
44  
45  
46 2 1;
« SVGPDF/PAST.pm ↑ Summary SVGPDF/Polyline.pm »