lib/ChordPro/lib/SVGPDF/Use.pm

filter: Statementstmt 40.4% 17 / 42 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 35.4% 22 / 62 CC 6 SCAR 30.8
CC
6
Cov
32%
process
39.2
BEGIN
1.0
BEGIN
1.0
CRAP 21.8
« lib/ChordPro/lib/SVGPDF/Polyline.pm ↑ Summary blib/lib/ChordPro/Config/Properties.pm »
1 #! perl
2  
3 12 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use Object::Pad;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 12 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 12 ▶use Storable;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 class SVGPDF::Use :isa(SVGPDF::Element);
10  
11 0 ▶method process () {
Subroutine process: not called CC=6 SCAR=36.7
Pod undocumented
12 0 my $atts = $self->atts;
13 0 my $xo = $self->xo;
14 0 ▶ return if $atts->{omit}; # for testing/debugging.
Branch: 1 branch
BranchTrueFalseTotal
if $atts->{"omit"} 0 0 0
15  
16 0 my ( $x, $y, $hr, $tf ) =
17 $self->get_params( $atts, qw( x:H y:V href:! transform:s ) );
18  
19 0 my $r = $self->root->defs->{$hr};
20 0 ▶ unless ( $r ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($r) 0 0 0
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 0 $r->xo = $self->xo;
28  
29 0 $self->_dbg( $self->name, " \"$hr\" (", $r->name, "), x=$x, y=$y" );
30  
31 0 $self->_dbg("+ xo save");
32 0 $xo->save;
33 0 ▶ if ( $x || $y ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($x or $y) 0 0 0
Condition0%0/3
$x or $y
l!l&&r!l&&!r
000
MC/DC0%0/2
$x or $y
$x $y
Truth table0%0/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 0 ▶ $self->set_transform($tf) if $tf;
Branch: 1 branch
BranchTrueFalseTotal
if $tf 0 0 0
38 0 $self->set_graphics;
39 0 $r->process;
40 0 $self->_dbg("- xo restore");
41 0 $xo->restore;
42 0 $self->css_pop;
43 12 }
44  
45  
46 12 1;
« lib/ChordPro/lib/SVGPDF/Polyline.pm ↑ Summary blib/lib/ChordPro/Config/Properties.pm »