lib/TUI/Gadgets/PuzzleWindow.pm

filter: Statementstmt 60.2% 41 / 68 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 70.5% 12 / 17 Podpod 60.0% 3 / 5 totaltotal 56.0% 56 / 100 CC 6 SCAR 18.1
CC
6
Cov
53%
build
20.0
BUILD
12.0
new_TPuzzleWindow
2.0
CRAP 6.1
« lib/TUI/Gadgets/CalendarWindow.pm ↑ Summary lib/TUI/toolkit.pm »
1 package TUI::Gadgets::PuzzleWindow;
2 # ABSTRACT: window containing a sliding tile puzzle
3
4 5 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 5 our $VERSION = '2.000003';
9 5 $VERSION =~ tr/_//d;
10 5 our $AUTHORITY = 'cpan:BRICKPOOL';
11
12 5 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 5 our @EXPORT = qw(
14 TPuzzleWindow
15 new_TPuzzleWindow
16 );
17
18 5 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
19 5 ▶use Storable;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 5 ▶use TUI::toolkit;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 5 ▶use TUI::toolkit::Types qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
22 is_Object
23 is_Str
24 :types
25 5 );
26
27 5 ▶use TUI::Gadgets::PuzzleView;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 5 ▶use TUI::Objects::Rect;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 5 ▶use TUI::Views::Const qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
30 wfGrow
31 wfZoom
32 wnNoNumber
33 5 );
34 5 ▶use TUI::Views::Window;
Subroutine BEGIN: called CC=1 SCAR=0.0
35
36 sub TPuzzleWindow() { __PACKAGE__ }
37 sub name() { 'TPuzzleWindow' }
38 0 ▶sub new_TPuzzleWindow { __PACKAGE__->from(@_) }
Subroutine new_TPuzzleWindow: not called CC=1 SCAR=6.9
Pod documented
39
40 5 extends TWindow;
41
42 0 ▶sub BUILDARGS { # \%args (%args)
Subroutine BUILDARGS: not called CC=1 SCAR=6.9
Pod documented
43 0 state $sig = signature(
44 method => 1,
45 named => [],
46 caller_level => +1,
47 );
48 0 my ( $class ) = $sig->( @_ );
49 0 local $Carp::CarpLevel = $Carp::CarpLevel + 1;
50 0 return $class->SUPER::BUILDARGS(
51 bounds => TRect->new( ax => 1, ay => 1, bx => 21, by => 7 ),
52 title => 'Puzzle',
53 number => wnNoNumber,
54 );
55 }
56
57 0 ▶sub BUILD { # void (\%args)
Subroutine BUILD: not called CC=3 SCAR=24.8
Pod documented
58 0 my ( $self, $args ) = @_;
59 0 ▶ assert ( @_ == 2 );
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 2 0 0 0
60 0 ▶ assert ( is_Object $self );
Branch: 1 branch
BranchTrueFalseTotal
unless &is_Object($self) 0 0 0
61
62 0 $self->{flags} &= ~( wfZoom | wfGrow );
63 0 $self->{growMode} = 0;
64
65 0 my $r = $self->getExtent();
66 0 $r->grow( -1, -1 );
67 0 $self->insert( TPuzzleView->new( bounds => $r ) );
68 0 return;
69 }
70
71 0 ▶sub from { # $puzzleWindow ()
Subroutine from: not called CC=1 SCAR=6.9
Pod undocumented
72 0 state $sig = signature(
73 method => 1,
74 pos => [],
75 );
76 0 my ( $class ) = $sig->( @_ );
77 0 return $class->new();
78 }
79
80 0 ▶sub build { # $obj ()
Subroutine build: not called CC=4 SCAR=30.0
Pod undocumented
81 0 my ( $class ) = @_;
82 0 ▶ assert ( @_ == 1 );
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 1 0 0 0
83 0 ▶ assert ( is_Str $class );
Branch: 1 branch
BranchTrueFalseTotal
unless &is_Str($class) 0 0 0
84 0 ▶ assert ( Storable::is_retrieving );
Branch: 1 branch
BranchTrueFalseTotal
unless &Storable::is_retrieving() 0 0 0
85 0 return $class->new();
86 }
87
88 5 1
89
90 __END__
« lib/TUI/Gadgets/CalendarWindow.pm ↑ Summary lib/TUI/toolkit.pm »