lib/ChordPro/Output/SVG/Images.pm

filter: Statementstmt 67.8% 19 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 2 totaltotal 64.8% 24 / 37 CC 1 SCAR 2.2
CC
1
Cov
68%
SVG
2.0
alert
1.7
BEGIN
1.0
CRAP 1.2
« lib/ChordPro/Logger.pm ↑ Summary lib/ChordPro/lib/SVGPDF/Polygon.pm »
1 #! perl
2  
3 13 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 13 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 13 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 13 ▶use Object::Pad;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 class ChordPro::Output::SVG::Images;
9  
10 0 ▶method alert :common ( $size ) {
Subroutine alert: not called CC=1 SCAR=5.3
Pod undocumented
11  
12 0 my $scale = $size / 20;
13 0 my $width = $size;
14 0 my $height = int(18 * $scale);
15  
16 0 return <<ESVG;
17 <?xml version="1.0" encoding="utf-8"?>
18 <svg xmlns="http://www.w3.org/2000/svg" width="$width" height="$height" viewBox="0 0 $width $height">
19 <g stroke="red" fill="none" stroke-width="2" transform="scale($scale,$scale)">
20 <polygon points="1 17 19 17 10 1" stroke-linejoin="round"/>
21 <rect x="9" y="13" width="2" height="2" stroke="none" fill="red"/>
22 <polygon points="9 12 8.5 7 11.5 7 11 12" stroke="none" fill="red"/>
23 </g>
24 </svg>
25 ESVG
26  
27 13 }
28  
29 ################ Export ################
30  
31 # For convenience.
32  
33 13 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
34 13 our @EXPORT;
35  
36 0 ▶sub SVG() { __PACKAGE__ }
Subroutine SVG: not called CC=1 SCAR=6.9
Pod undocumented
37  
38 13 push( @EXPORT, 'SVG' );
39  
40 13 1;
« lib/ChordPro/Logger.pm ↑ Summary lib/ChordPro/lib/SVGPDF/Polygon.pm »