lib/XT/Files/Plugin/Files.pm

filter: Statementstmt 100% 41 / 41 Branchbran 91.6% 11 / 12 Conditioncond 100% 15 / 15 MC/DCmcdc 100% 7 / 7 Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 98.7% 80 / 81 CC 14 SCAR 24.1
CC
14
Cov
99%
run
14.0
BEGIN
1.0
BEGIN
1.0
CRAP 11.1
« blib/lib/XT/Files/File.pm ↑ Summary blib/lib/XT/Files/Plugin/lib.pm »
1 package XT::Files::Plugin::Files;
2  
3 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = '0.001';
8  
9 2 ▶use parent 'XT::Files::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub run {
12 4 ▶ my ( $self, $args ) = @_;
Subroutine run: called CC=14 SCAR=26.4
Pod documented
13  
14 4 my @files;
15  
16 ARG:
17 4 for my $arg ( @{$args} ) {
18 11 my ( $key, $value ) = @{$arg};
19  
20 11 ▶ if ( ( $key eq 'bin' ) || ( $key eq 'module' ) || ( $key eq 'pod' ) || ( $key eq 'test' ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($key eq "bin" or $key eq "module" or $key eq "pod" or $key eq "test") 3 1 4
Condition100%9/9
$key eq "bin" or $key eq "module" or $key eq "pod" or $key eq "test"
l!l&&r!l&&!r
821
$key eq "bin" or $key eq "module" or $key eq "pod"
l!l&&r!l&&!r
713
$key eq "bin" or $key eq "module"
l!l&&r!l&&!r
524
MC/DC100%4/4
$key eq "bin" or $key eq "module" or $key eq "pod" or $key eq "test"
$key eq "bin" $key eq "module" $key eq "pod" $key eq "test"
Truth table100%5/5
A or B or C or D
A= $key eq "bin"B= $key eq "module"C= $key eq "pod"D= $key eq "test"
ABCDresult
1XXX1
01XX1
001X1
00011
00000
21 10 push @files, $arg;
22 10 next ARG;
23 }
24  
25 1 $self->log_fatal("Invalid configuration option '$key = $value' for plugin 'Files'");
26 }
27  
28 3 my $xtf = $self->xtf;
29  
30 FILE:
31 3 for my $file (@files) {
32 10 my ( $type, $name ) = @{$file};
33  
34 10 ▶ next FILE if -l $name || -d _ || !-e _;
Branch: 1 branch
BranchTrueFalseTotal
if -l $name or -d _ or not -e _ 2 7 9
Condition100%6/6
-l $name or -d _ or not -e _
l!l&&r!l&&!r
217
-l $name or -d _
l!l&&r!l&&!r
118
MC/DC100%3/3
-l $name or -d _ or not -e _
-l $name -d _ not -e _
Truth table100%4/4
A or B or not(C)
A= -l $nameB= -d _C= not -e _
ABCresult
1XX1
01X1
0011
0000
35  
36 7 ▶ if ( $type eq 'bin' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($type eq "bin") 2 5 7
37 2 $xtf->bin_file($name);
38 2 next FILE;
39 }
40  
41 5 ▶ if ( $type eq 'module' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($type eq "module") 2 3 5
42 2 $xtf->module_file($name);
43 2 next FILE;
44 }
45  
46 3 ▶ if ( $type eq 'pod' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($type eq "pod") 1 2 3
47 1 $xtf->pod_file($name);
48 1 next FILE;
49 }
50  
51 2 ▶ if ( $type eq 'test' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($type eq "test") 2 0 2
52 2 $xtf->test_file($name);
53 2 next FILE;
54 }
55 }
56  
57 3 return;
58 }
59  
60 2 1;
61  
62 __END__
« blib/lib/XT/Files/File.pm ↑ Summary blib/lib/XT/Files/Plugin/lib.pm »