DeclareX/Plugin/types.pm

filter: Statementstmt 100% 26 / 26 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 91.8% 34 / 37 CC 2 SCAR 2.2
CC
2
Cov
96%
plugin_setup
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« DeclareX/Plugin/guard.pm ↑ Summary DeclareX/Plugin/preprocess.pm »
1 package MooseX::DeclareX::Plugin::types;
2  
3 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 $MooseX::DeclareX::Plugin::types::AUTHORITY = 'cpan:TOBYINK';
5 1 $MooseX::DeclareX::Plugin::types::VERSION = '0.009';
6 }
7  
8 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 with 'MooseX::DeclareX::Plugin';
10  
11 1 ▶use MooseX::Declare ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Moose::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Data::OptList;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 sub plugin_setup
16 6 ▶{
Subroutine plugin_setup: called CC=2 SCAR=6.9
Pod undocumented
17 6 my ($class, $kw, $opt) = @_;
18 6 $opt = Data::OptList::mkopt($opt);
19
20 my @codeparts = map {
21 6 my ($module, $terms) = @$_;
22 6 $module =~ s/^-/MooseX::Types::/;
23 6 ▶ $terms ||= ['-all'];
Condition50%1/2
$terms ||= ["-all"]
l!l
60
MC/DC0%0/1
$terms ||= ["-all"]
$terms
Truth table50%1/2
A
A= $terms
Aresult
11
00
24 6 sprintf('use %s qw(%s)', $module, join q[ ], @$terms);
25 } @$opt;
26  
27 $kw->meta->add_after_method_modifier(
28 1 ▶ add_namespace_customizations => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
29 1 my ($self, $ctx, $package) = @_;
30 1 $ctx->add_preamble_code_parts(@codeparts);
31 },
32 6 );
33 }
34  
35 1 1;
36  
« DeclareX/Plugin/guard.pm ↑ Summary DeclareX/Plugin/preprocess.pm »