IsDev.pm

filter: Statementstmt 93.5% 29 / 31 Branchbran 25.0% 1 / 4 Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 87.5% 7 / 8 Podpod 100% 1 / 1 totaltotal 78.8% 41 / 52 CC 4 SCAR 9.0
CC
4
Cov
82%
debug
6.0
__ANON__
3.1
_build_is_dev
1.0
CRAP 2.5
« IsDev/Result.pm ↑ Summary IsDev/Role/Matcher/Child/Exists/Any/Dir.pm »
1 12 ▶use 5.008; # utf8
Subroutine BEGIN: called CC=1 SCAR=0.0
2 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 package Path::IsDev;
7  
8 12 our $VERSION = '1.001003';
9  
10 # ABSTRACT: Determine if a given Path resembles a development source tree
11  
12 12 our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25 12 ▶use Sub::Exporter -setup => { exports => [ is_dev => \&_build_is_dev, ], };
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 12 our $ENV_KEY_DEBUG = 'PATH_ISDEV_DEBUG';
28  
29 12 ▶our $DEBUG = ( exists $ENV{$ENV_KEY_DEBUG} ? $ENV{$ENV_KEY_DEBUG} : undef );
Branch: 1 branch
BranchTrueFalseTotal
exists $ENV{$Path::IsDev::ENV_KEY_DEBUG} ? : 0 12 12
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41 0 ▶sub debug {
Subroutine debug: not called CC=2 SCAR=17.9
Pod documented
42 0 ▶ return unless $DEBUG;
Branch: 1 branch
BranchTrueFalseTotal
unless $Path::IsDev::DEBUG 0 0 0
43 0 return *STDERR->printf( qq{[Path::IsDev] %s\n}, shift );
44 }
45  
46 21 ▶sub _build_is_dev {
Subroutine _build_is_dev: called CC=1 SCAR=0.0
47 21 my ( undef, undef, $arg ) = @_;
48  
49 21 my $isdev_object;
50 10 ▶ return sub {
Subroutine __ANON__: called CC=3 SCAR=11.2
51 10 my ($path) = @_;
52 10 ▶ $isdev_object ||= do {
Condition66%2/3
$isdev_object ||= do { require Path::IsDev::Object; "Path::IsDev::Object"->new(%{$arg or {};}) }
l!l&&r!l&&!r
190
MC/DC0%0/2
$isdev_object ||= do { require Path::IsDev::Object; "Path::IsDev::Object"->new(%{$arg or {};}) }
$isdev_object do { require Path::IsDev::Object; "Path::IsDev::Object"->new(%{$arg or {};}) }
Truth table66%2/3
A ||= B
A= $isdev_objectB= do { require Path::IsDev::Object; "Path::IsDev::Object"->new(%{$arg or {};}) }
ABresult
1X1
011
000
53 9 require Path::IsDev::Object;
54 9 ▶ Path::IsDev::Object->new( %{ $arg || {} } );
Condition50%1/2
$arg || {}
l!l
90
MC/DC0%0/1
$arg || {}
$arg
Truth table50%1/2
A
A= $arg
Aresult
11
00
55 };
56 10 return $isdev_object->matches($path);
57 21 };
58 }
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83 12 *is_dev = _build_is_dev( 'Path::IsDev', 'is_dev', {} );
84  
85 12 1;
86  
87 __END__
« IsDev/Result.pm ↑ Summary IsDev/Role/Matcher/Child/Exists/Any/Dir.pm »