lib/Reaction/Role.pm

filter: Statementstmt 82.9% 34 / 41 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 71.4% 10 / 14 Podpod 0.0% 0 / 1 totaltotal 69.8% 44 / 63 CC 3 SCAR 11.5
CC
3
Cov
74%
do_role_sub
12.0
__ANON__
2.0
1.3
CRAP 3.2
« lib/Reaction/UI/Widget/Field/Mutable/MatchingPasswords.pm ↑ Summary lib/Reaction/UI/ViewPort/Field/String/Fragment.pm »
1 package Reaction::Role;
2  
3 6 ▶use Moose::Role ();
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use Reaction::ClassExporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use Reaction::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use Moose::Meta::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 #TODO: review for Reaction::Object switch / Reaction::Meta::Class
9  
10 6 ▶use namespace::clean -except => [ qw(meta) ];
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 69 ▶override exports_for_package => sub {
Subroutine __ANON__: called CC=1 SCAR=0.2
13 69 my ($self, $package) = @_;
14 69 my %exports = $self->SUPER::exports_for_package($package);
15 69 delete $exports{class};
16 0 ▶ $exports{role} = sub { $self->do_role_sub($package, @_); };
Subroutine : not called CC=1 SCAR=2.6
Subroutine __ANON__: not called CC=1 SCAR=2.6
17 69 return %exports;
18 6 };
19  
20 138 ▶override next_import_package => sub { 'Moose::Role' };
Subroutine __ANON__: called CC=1 SCAR=0.0
21  
22 69 ▶override default_base => sub { () };
Subroutine __ANON__: called CC=1 SCAR=0.0
23  
24 0 ▶override add_method_to_target => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
25 0 my ($self, $target, $method) = @_;
26 0 $target->meta->add_method(@$method);
27 6 };
28 138 ▶override next_import => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
29 138 my ($self) = @_;
30 138 my $import = super;
31 # ugh
32 69 ▶ return sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
33 69 push @_, '-metaclass' => 'Reaction::Meta::Role';
34 69 goto $import;
35 138 };
36 6 };
37 0 ▶sub do_role_sub {
Subroutine do_role_sub: not called CC=3 SCAR=24.8
Pod undocumented
38 0 my ($self, $package, $role, $which, $setup) = @_;
39 0 ▶ confess "Invalid role declaration, should be: role Role which { ... }"
Branch: 1 branch
BranchTrueFalseTotal
unless $which eq "which" and ref $setup eq "CODE" 0 0 0
Condition0%0/3
$which eq "which" and ref $setup eq "CODE"
!ll&&!rl&&r
000
MC/DC0%0/2
$which eq "which" and ref $setup eq "CODE"
$which eq "which" ref $setup eq "CODE"
Truth table0%0/3
A and B
A= $which eq "which"B= ref $setup eq "CODE"
ABresult
0X0
100
111
40 unless ($which eq 'which' && ref($setup) eq 'CODE');
41 0 $self->setup_and_cleanup($role, $setup);
42 };
43  
44 6 __PACKAGE__->meta->make_immutable;
45  
46  
47 6 1;
48  
49 =head1 NAME
50  
51 Reaction::Role
52  
53 =head1 DESCRIPTION
54  
55 =head1 SEE ALSO
56  
57 L<Moose::Role>
58  
59 =head1 AUTHORS
60  
61 See L<Reaction::Class> for authors.
62  
63 =head1 LICENSE
64  
65 See L<Reaction::Class> for the license.
66  
67 =cut
« lib/Reaction/UI/Widget/Field/Mutable/MatchingPasswords.pm ↑ Summary lib/Reaction/UI/ViewPort/Field/String/Fragment.pm »