Pluggable.pm

filter: Statementstmt 100% 28 / 28 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 97.3% 36 / 37 CC 2 SCAR 2.3
CC
2
Cov
97%
import
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Pluggable/EventHandler.pm ↑ Summary Pluggable/Plugin/JobsFromData.pm »
1 package Schedule::Pluggable;
2  
3 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Carp qw/ croak /;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use Try::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '0.0.7';
8 3 with 'MooseX::Workers';
9 3 with 'MooseX::Object::Pluggable';
10  
11 3 with 'Schedule::Pluggable::Config';
12 3 with 'Schedule::Pluggable::Run';
13 3 with 'Schedule::Pluggable::EventHandler';
14 3 with 'Schedule::Pluggable::Status';
15  
16 3 our %imports = (); # Anything supplied in the use statement goes in here e.g. use Schedule::Pluggable (something => value);
17  
18 # merge anything specied in %imports with any parameters passed on object creation
19 1 ▶sub BUILDARGS {
Subroutine BUILDARGS: called CC=1 SCAR=0.0
20 1 my $class = shift;
21  
22 1 my %params = ( %imports, @_ );
23 1 return \%params;
24 }
25 1 ▶sub BUILD {
Subroutine BUILD: called CC=1 SCAR=0.0
26 1 my $self = shift;
27 }
28  
29 # Populate %imports with whatever gets supplied on the use line
30 5 ▶sub import {
Subroutine import: called CC=2 SCAR=7.1
31 5 my $class = shift;
32 5 ▶ if (scalar(@_) % 2 == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar(@_) % 2 == 0) 5 0 5
33 5 %imports = @_;
34 }
35 }
36  
37 3 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
38  
39  
40 3 1; # Magic true value required at end of module
41 __END__
« Pluggable/EventHandler.pm ↑ Summary Pluggable/Plugin/JobsFromData.pm »