Rabbit/Root.pm

filter: Statementstmt 93.1% 27 / 29 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 100% 1 / 1 totaltotal 86.0% 37 / 43 CC 3 SCAR 7.4
CC
3
Cov
85%
unimport
6.0
import
2.0
BEGIN
1.0
CRAP 2.1
« Rabbit.pm ↑ Summary Rabbit/Sugar.pm »
1 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package XML::Rabbit::Root;
5 7 $XML::Rabbit::Root::VERSION = '0.4.1';
6 7 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # ABSTRACT: Root class with sugar functions available
9  
10 7 ▶use XML::Rabbit::Sugar (); # no magic, just load
Subroutine BEGIN: called CC=1 SCAR=0.0
11 7 ▶use namespace::autoclean (); # no cleanup, just load
Subroutine BEGIN: called CC=1 SCAR=0.0
12 7 ▶use Moose::Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 7 my ($import, $unimport, $init_meta) = Moose::Exporter->build_import_methods(
15 also => 'XML::Rabbit::Sugar',
16 base_class_roles => ['XML::Rabbit::RootNode'],
17 );
18  
19  
20 6 ▶sub import {
Subroutine import: called CC=2 SCAR=7.1
21 6 namespace::autoclean->import( -cleanee => scalar caller );
22 6 ▶ return unless $import;
Branch: 1 branch
BranchTrueFalseTotal
unless $import 0 6 6
23 6 goto &$import;
24 }
25  
26  
27 0 ▶sub unimport {
Subroutine unimport: not called CC=2 SCAR=17.9
28 0 ▶ return unless $unimport;
Branch: 1 branch
BranchTrueFalseTotal
unless $unimport 0 0 0
29 0 goto &$unimport;
30 }
31  
32  
33 #sub init_meta {
34 # return unless $init_meta;
35 # goto &$init_meta;
36 #}
37  
38 # FIXME: https://rt.cpan.org/Ticket/Display.html?id=51561
39 # Hopefully fixed by 2.06 (doy)
40 6 ▶sub init_meta {
Subroutine init_meta: called CC=1 SCAR=0.0
Pod documented
41 6 my ($dummy, %opts) = @_;
42 6 Moose->init_meta(%opts);
43 Moose::Util::MetaRole::apply_base_class_roles(
44 for => $opts{for_class},
45 6 roles => ['XML::Rabbit::RootNode']
46 );
47 6 return Moose::Util::find_meta($opts{for_class});
48 }
49  
50 7 1;
51  
52 __END__
« Rabbit.pm ↑ Summary Rabbit/Sugar.pm »