Memoir44/Types.pm

filter: Statementstmt 85.7% 18 / 21 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod n/a totaltotal 73.3% 22 / 30 CC 2 SCAR 8.2
CC
2
Cov
78%
__ANON__
6.0
__ANON__
1.1
__ANON__
1.1
CRAP 2.3
« Memoir44/App/Command/update.pm ↑ Summary Memoir44/DB/Params.pm »
1 #
2 # This file is part of WWW-DaysOfWonder-Memoir44
3 #
4 # This software is copyright (c) 2009 by Jerome Quelin.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 5 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 package WWW::DaysOfWonder::Memoir44::Types;
14 # ABSTRACT: various types used in the distribution
15 5 $WWW::DaysOfWonder::Memoir44::Types::VERSION = '3.000';
16 5 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 5 enum Board => [ qw{ beach country winter desert } ];
19 5 enum Format => [ qw{ standard brkthru overlord } ];
20 5 enum Source => [ qw{ game approved classified public } ];
21  
22 subtype 'Int_0_3',
23 as 'Int',
24 0 ▶ where { $_>=0 && $_<=3 },
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ >= 0 and $_ <= 3 0 0 0
25 0 ▶ message { "Integer should be between 0 and 3\n" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
26  
27 coerce 'Int_0_3',
28 from 'Int',
29 0 ▶ via { 0+$_ };
Subroutine __ANON__: not called CC=1 SCAR=1.2
30  
31 5 1;
32  
33 __END__
« Memoir44/App/Command/update.pm ↑ Summary Memoir44/DB/Params.pm »