bin/dest

filter: Statementstmt 100% 23 / 23 Branchbran 75.0% 3 / 4 Conditioncond 60.0% 3 / 5 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 87.5% 35 / 40 CC 1 SCAR 0.0
CC
1
Cov
91%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/App/Dest.pm ↑ Summary
1 #!/usr/bin/env perl
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # PODNAME: dest
6 # ABSTRACT: Deployment State Manager
7 2 our $VERSION = '1.37'; # VERSION
8  
9 2 ▶use Pod::Usage 'pod2usage';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use App::Dest;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 my @commands = qw(
13 init add rm
14 watches putwatch writewatch
15 make expand list prereqs
16 status diff clean preinstall nuke
17 deploy redeploy revdeploy verify revert update
18 man version
19 );
20  
21 2 my ( $command, @args ) = @ARGV;
22 2 ▶( $command = lc( $command || 'undef' ) ) =~ s/^\-+//;
Condition50%1/2
$command || 'undef'
l!l
20
MC/DC0%0/1
$command || 'undef'
$command
Truth table50%1/2
A
A= $command
Aresult
11
00
23 2 my @command = grep { index( $_, $command ) == 0 } @commands;
24 2 ($command) = @command;
25  
26 1 ▶sub usage {
Subroutine usage: called CC=1 SCAR=0.0
27 1 pod2usage(
28 '-exitval' => 1,
29 '-verbose' => $_[0],
30 '-input' => 'App/Dest.pm',
31 '-pathlist' => \@INC,
32 );
33 }
34  
35 2 ▶usage(1) if ( not @command or @command > 1 );
Branch: 1 branch
BranchTrueFalseTotal
if not @command or @command > 1 1 1 2
Condition66%2/3
not @command or @command > 1
l!l&&r!l&&!r
101
MC/DC50%1/2
not @command or @command > 1
not @command @command > 1
Truth table66%2/3
not(A) or B
A= not @commandB= @command > 1
ABresult
1X1
011
000
36 1 ▶usage(2) if ( $command eq 'man' );
Branch: 1 branch
BranchTrueFalseTotal
if $command eq "man" 0 1 1
37  
38 1 exit App::Dest->$command(@args);
39  
40 __END__
« lib/App/Dest.pm ↑ Summary