lib/Test/File/ShareDir/Module.pm

filter: Statementstmt 92.8% 26 / 28 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 82.9% 34 / 41 CC 3 SCAR 6.2
CC
3
Cov
85%
import
3.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« blib/lib/Test/File/ShareDir/Dist.pm ↑ Summary lib/Test/File/ShareDir/Object/Inc.pm »
1 3 ▶use 5.006; # pragmas
Subroutine BEGIN: called CC=1 SCAR=0.0
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Test::File::ShareDir::Module;
6  
7 3 our $VERSION = '1.001002';
8  
9 # ABSTRACT: Simplified module oriented ShareDir tester
10  
11 3 our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
12  
13 3 ▶use File::ShareDir 1.00 qw();
Subroutine BEGIN: called CC=1 SCAR=0.0
14 3 ▶use Test::File::ShareDir::Utils qw( extract_dashes );
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27 2 ▶sub import {
Subroutine import: called CC=3 SCAR=11.9
28 2 my ( undef, $arg ) = @_;
29  
30 2 ▶ if ( not ref $arg or 'HASH' ne ref $arg ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not ref $arg or "HASH" ne ref $arg) 0 2 2
Condition33%1/3
not ref $arg or "HASH" ne ref $arg
l!l&&r!l&&!r
002
MC/DC0%0/2
not ref $arg or "HASH" ne ref $arg
not ref $arg "HASH" ne ref $arg
Truth table33%1/3
not(A) or B
A= not ref $argB= "HASH" ne ref $arg
ABresult
1X1
011
000
31 0 require Carp;
32 0 return Carp::croak q[Must pass a hashref];
33 }
34  
35 2 my %input_config = %{$arg};
36  
37 2 require Test::File::ShareDir::Object::Module;
38  
39 2 my $module_object = Test::File::ShareDir::Object::Module->new(extract_dashes('modules', \%input_config ));
40 2 $module_object->install_all_modules();
41 2 $module_object->register();
42 2 return 1;
43 }
44  
45 3 1;
46  
47 __END__
« blib/lib/Test/File/ShareDir/Dist.pm ↑ Summary lib/Test/File/ShareDir/Object/Inc.pm »