lib/Narada.pm

filter: Statementstmt 76.1% 16 / 21 Branchbran 50.0% 8 / 16 Conditioncond 50.0% 9 / 18 MC/DCmcdc 50.0% 6 / 12 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 2 totaltotal 58.1% 43 / 74 CC 15 SCAR 26.1
CC
15
Cov
60%
detect
16.0
detect
16.0
BEGIN
1.0
CRAP 13.6
« blib/script/narada-mysqldump ↑ Summary blib/script/narada-new-1 »
1 package Narada;
2  
3 345 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 345 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 345 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 345 our $VERSION = 'v2.3.8';
8  
9  
10 # Possible types of current directory:
11 # - narada-1
12 # config/patch/
13 # config/version
14 # var/backup/
15 # var/patch/
16 # - narada
17 # VERSION (except when migrating from 0.0.0)
18 # .backup/
19 # - narada-1 and narada
20 # config/backup/
21 # config/log/
22 # var/log/
23 673 ▶sub detect {
Subroutine detect: called CC=8 SCAR=27.7
Pod undocumented
24 0 ▶ my %need = map {$_=>1} @_ ? @_ : qw( narada narada-1 );
Subroutine detect: not called CC=8 SCAR=27.7
Pod undocumented
Branch: 2 branches
BranchTrueFalseTotal
@_ ? : 251 422 673
@_ ? : 0 0 0
25 0 ▶ my $type
Branch: 4 branches
BranchTrueFalseTotal
-d 'config/backup' && -d '.backup' ? : 402 271 673
-d 'config/backup' && -d 'var/backup' ? : 217 54 271
-d 'config/backup' && -d '.backup' ? : 0 0 0
-d 'config/backup' && -d 'var/backup' ? : 0 0 0
Condition50%6/12
-d "config/backup" and -d ".backup"
!ll&&!rl&&r
53218402
-d "config/backup" and -d "var/backup"
!ll&&!rl&&r
531217
-d "config/backup" and -d ".backup"
!ll&&!rl&&r
000
-d "config/backup" and -d "var/backup"
!ll&&!rl&&r
000
MC/DC100%2/2
-d "config/backup" and -d ".backup"
-d "config/backup" -d ".backup"
MC/DC100%2/2
-d "config/backup" and -d "var/backup"
-d "config/backup" -d "var/backup"
MC/DC0%0/2
-d "config/backup" and -d ".backup"
-d "config/backup" -d ".backup"
MC/DC0%0/2
-d "config/backup" and -d "var/backup"
-d "config/backup" -d "var/backup"
Truth table100%3/3
A and B
A= -d "config/backup"B= -d ".backup"
ABresult
0X0
100
111
Truth table100%3/3
A and B
A= -d "config/backup"B= -d "var/backup"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= -d "config/backup"B= -d ".backup"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= -d "config/backup"B= -d "var/backup"
ABresult
0X0
100
111
26 = -d 'config/backup' && -d '.backup' ? 'narada'
27 : -d 'config/backup' && -d 'var/backup' ? 'narada-1'
28 : undef
29 ;
30 0 ▶ return $type if $type && $need{$type};
Branch: 2 branches
BranchTrueFalseTotal
if $type and $need{$type} 513 160 673
if $type and $need{$type} 0 0 0
Condition50%3/6
$type and $need{$type}
!ll&&!rl&&r
54106513
$type and $need{$type}
!ll&&!rl&&r
000
MC/DC100%2/2
$type and $need{$type}
$type $need{$type}
MC/DC0%0/2
$type and $need{$type}
$type $need{$type}
Truth table100%3/3
A and B
A= $typeB= $need{$type}
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $typeB= $need{$type}
ABresult
0X0
100
111
31 0 die 'This is not '.join(' or ', keys %need)." directory\n";
32 }
33  
34  
35 345 1; # Magic true value required at end of module
36 __END__
« blib/script/narada-mysqldump ↑ Summary blib/script/narada-new-1 »