lib/XT/Files/Plugin/Default.pm

filter: Statementstmt 100% 34 / 34 Branchbran 100% 8 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 48 / 48 CC 6 SCAR 13.9
CC
6
Cov
100%
run
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.0
« corpus/dist1/xt/lib/Local/Test.pm ↑ Summary lib/XT/Files/Plugin/lib.pm »
1 package XT::Files::Plugin::Default;
2  
3 6 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 6 our $VERSION = '0.001';
8  
9 6 ▶use parent 'XT::Files::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub run {
12 7 ▶ my ( $self, $args ) = @_;
Subroutine run: called CC=6 SCAR=17.9
Pod documented
13  
14 7 my $dirs = 1;
15 7 my $excludes = 1;
16  
17 ARG:
18 7 for my $arg ( @{$args} ) {
19 4 my ( $key, $value ) = @{$arg};
20  
21 4 ▶ if ( $key eq 'dirs' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($key eq "dirs") 2 2 4
22 2 $dirs = !!$value;
23 2 next ARG;
24 }
25  
26 2 ▶ if ( $key eq 'excludes' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($key eq "excludes") 1 1 2
27 1 $excludes = !!$value;
28 1 next ARG;
29 }
30  
31 1 $self->log_fatal("Invalid configuration option '$key = $value' for plugin 'Default'");
32 }
33  
34 6 my $xtf = $self->xtf;
35  
36 6 ▶ if ($excludes) {
Branch: 1 branch
BranchTrueFalseTotal
if ($excludes) 5 1 6
37 5 $xtf->plugin( 'Excludes', undef, [ map { [ 'exclude' => $_ ] } (qw([.]swp$ [.]bak$ ~$)) ] );
38 }
39  
40 6 ▶ if ($dirs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($dirs) 4 2 6
41 4 $xtf->plugin(
42 'Dirs', undef,
43 [
44 [ bin => 'bin' ],
45 [ bin => 'script' ],
46 [ module => 'lib' ],
47 ],
48 );
49 }
50  
51 6 return;
52 }
53  
54 6 1;
55  
56 __END__
« corpus/dist1/xt/lib/Local/Test.pm ↑ Summary lib/XT/Files/Plugin/lib.pm »