SVGPDF/Polyline.pm

filter: Statementstmt 100% 43 / 43 Branchbran 70.0% 7 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 91.8% 56 / 61 CC 6 SCAR 13.2
CC
6
Cov
94%
process_polyline
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.7
« SVGPDF/Use.pm ↑ Summary SVGPDF/Style.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  
8 class SVGPDF::Polyline :isa(SVGPDF::Element);
9  
10 5 ▶method process () {
Subroutine process: called CC=1 SCAR=0.0
Pod undocumented
11 5 $self->process_polyline(0);
12 2 }
13  
14 7 ▶method process_polyline ( $close ) {
Subroutine process_polyline: called CC=6 SCAR=18.0
Pod undocumented
15 7 my $atts = $self->atts;
16 7 my $xo = $self->xo;
17 7 ▶ return if $atts->{omit}; # for testing/debugging.
Branch: 1 branch
BranchTrueFalseTotal
if $atts->{"omit"} 0 7 7
18  
19 7 my ( $points, $tf ) = $self->get_params( $atts, qw(points:s transform:s) );
20  
21 7 my @d = $self-> getargs($points);
22  
23 7 my $t = $points;
24 7 ▶ $t = substr($t,0,20) . "..." if length($t) > 20;
Branch: 1 branch
BranchTrueFalseTotal
if length $t > 20 6 1 7
25 7 $self->_dbg( $self->name, " points=\"$t\"" );
26 7 $self->_dbg( "+ xo save" );
27 7 $xo->save;
28  
29 7 $self->set_graphics;
30 7 ▶ $self->set_transform($tf) if $tf;
Branch: 1 branch
BranchTrueFalseTotal
if $tf 0 7 7
31  
32 7 ▶ if ( @d ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@d) 7 0 7
33 7 $xo->move( $d[0], $d[1] );
34 7 $xo->polyline( @d[2 .. $#d] );
35 7 ▶ $xo->close if $close;
Branch: 1 branch
BranchTrueFalseTotal
if $close 2 5 7
36 7 $self->_paintsub->();
37 }
38  
39 7 $self->_dbg( "- xo restore" );
40 7 $xo->restore;
41 7 $self->css_pop;
42 2 }
43  
44  
45 2 1;
« SVGPDF/Use.pm ↑ Summary SVGPDF/Style.pm »