| 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
Condition100%9/9
$key eq "bin" or $key eq "module" or $key eq "pod" or $key eq "test"
$key eq "bin" or $key eq "module" or $key eq "pod"
$key eq "bin" or $key eq "module"
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"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
Condition100%6/6
-l $name or -d _ or not -e _
-l $name or -d _
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 _
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 7 | ▶ | if ( $type eq 'bin' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 2 | $xtf->bin_file($name); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 2 | next FILE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 5 | ▶ | if ( $type eq 'module' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 2 | $xtf->module_file($name); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 2 | next FILE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 3 | ▶ | if ( $type eq 'pod' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 1 | $xtf->pod_file($name); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 1 | next FILE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 2 | ▶ | if ( $type eq 'test' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 2 | $xtf->test_file($name); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 2 | next FILE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 3 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||