Khonsu/Page.pm

filter: Statementstmt 79.1% 19 / 24 Branchbran 50.0% 3 / 6 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 3 totaltotal 68.1% 30 / 44 CC 5 SCAR 10.6
CC
5
Cov
72%
add
5.3
rotate
2.0
BEGIN
1.0
CRAP 2.9
« Khonsu/Text/H6.pm ↑ Summary Khonsu/Ra.pm »
1 package Khonsu::Page;
2  
3 2 ▶use parent 'Khonsu::Ra';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 sub attributes {
6 2 ▶ my $a = shift;
Subroutine attributes: called CC=1 SCAR=0.0
Pod undocumented
7 return (
8 page_size => {$a->RW, $a->REQ, $a->STR},
9 background => {$a->RW, $a->STR},
10 num => {$a->RW, $a->REQ, $a->NUM},
11 current => {$a->RW, $a->OBJ},
12 2 ▶ columns => {$a->RW, $a->NUM, default => sub { 1 }},
Subroutine __ANON__: called CC=1 SCAR=0.0
13 2 ▶ column => {$a->RW, $a->NUM, default => sub { 1 }},
Subroutine __ANON__: called CC=1 SCAR=0.0
14 2 ▶ rows => {$a->RW, $a->NUM, default => sub { 1 }},
Subroutine __ANON__: called CC=1 SCAR=0.0
15 2 ▶ row => {$a->RW, $a->NUM, default => sub { 1 }},
Subroutine __ANON__: called CC=1 SCAR=0.0
16 2 is_rotated => {$a->RW, $a->NUM},
17 header => {$a->RW, $a->Object},
18 footer => {$a->RW, $a->Object},
19 $a->POINTS,
20 $a->BOX,
21 );
22 }
23  
24 sub add {
25 2 ▶ my ($self, $file, %args) = @_;
Subroutine add: called CC=5 SCAR=16.7
Pod undocumented
26 2 ▶ my $page = $args{open} ? $file->pdf->openpage($args{num}) : $file->pdf->page($args{num} || 0);
Branch: 1 branch
BranchTrueFalseTotal
$args{'open'} ? : 0 2 2
Condition50%1/2
$args{'num'} || 0
l!l
02
MC/DC0%0/1
$args{'num'} || 0
$args{'num'}
Truth table50%1/2
A
A= $args{'num'}
Aresult
11
00
27 2 $page->mediabox($self->page_size);
28 2 $self->set_points($page->get_mediabox);
29 2 $self->current($page);
30 2 ▶ $self->rotate if $args{rotate};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"rotate"} 0 2 2
31 2 ▶ if ($self->background) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->background) 2 0 2
32 2 $self->box->add(
33 $file,
34 fill_colour => $self->background,
35 $self->get_points
36 );
37 }
38 2 return $self;
39 }
40  
41 sub rotate {
42 0 ▶ my ($self) = shift;
Subroutine rotate: not called CC=1 SCAR=6.9
Pod undocumented
43 0 my ($blx, $bly, $trx, $try) = $self->current->get_mediabox;
44 0 $self->current->mediabox(
45 $self->x(0),
46 $self->y(0),
47 $self->w($try),
48 $self->h($trx),
49 );
50 0 $self->is_rotated(!$self->is_rotated);
51 0 return $self;
52 }
53  
54 2 1;
« Khonsu/Text/H6.pm ↑ Summary Khonsu/Ra.pm »