lib/XT/Files/Plugin/lib.pm

filter: Statementstmt 100% 32 / 32 Branchbran 83.3% 5 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 90.2% 46 / 51 CC 6 SCAR 12.7
CC
6
Cov
93%
run
6.1
BEGIN
1.0
BEGIN
1.0
CRAP 3.5
« lib/XT/Files/Plugin/Default.pm ↑ Summary blib/lib/XT/Files/Plugin/Excludes.pm »
1 package XT::Files::Plugin::lib; ## no critic (NamingConventions::Capitalization)
2  
3 3 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '0.001';
8  
9 3 ▶use parent 'XT::Files::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 ▶use Cwd ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12 3 ▶use lib ();
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 sub run {
15 6 ▶ my ( $self, $args ) = @_;
Subroutine run: called CC=6 SCAR=18.1
Pod documented
16  
17 ARG:
18 6 for my $arg ( @{$args} ) {
19 5 my ( $key, $value ) = @{$arg};
20  
21 5 ▶ if ( $key eq 'lib' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($key eq "lib") 3 2 5
22 3 ▶ if ( -d $value ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-d $value) 2 1 3
23 2 my $dir = Cwd::abs_path($value);
24  
25 2 ▶ if ( ( defined $dir ) && ( -d $dir ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $dir and -d $dir) 2 0 2
Condition33%1/3
defined $dir and -d $dir
!ll&&!rl&&r
002
MC/DC0%0/2
defined $dir and -d $dir
defined $dir -d $dir
Truth table33%1/3
A and B
A= defined $dirB= -d $dir
ABresult
0X0
100
111
26 2 lib->import($dir);
27 }
28 }
29  
30 3 next ARG;
31 }
32  
33 2 $self->log_fatal("Invalid configuration option '$key = $value' for plugin 'lib'");
34 }
35  
36 4 return;
37 }
38  
39 3 1;
40  
41 __END__
« lib/XT/Files/Plugin/Default.pm ↑ Summary blib/lib/XT/Files/Plugin/Excludes.pm »