bin/ubic

filter: Statementstmt 64.5% 20 / 31 Branchbran 70.0% 7 / 10 Conditioncond 50.0% 3 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 64.2% 36 / 56 SCAR 0.5
CC
1
Cov
64%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« bin/ubic-daemon ↑ Summary lib/Ubic/Daemon/OS.pm »
1 #!/usr/bin/env perl
2 package ubic;
3 1 $ubic::VERSION = '1.59';
4 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 51 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # ABSTRACT: command-line frontend to ubic services
8  
9  
10 11 ▶use Getopt::Long 2.33;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 11 ▶use Pod::Usage;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 10 ▶use Ubic;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 6 ▶use Ubic::Cmd;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 ▶return 1 if caller();
Branch: 1 branch
BranchTrueFalseTotal
if caller() 1 5 6
17 0 ▶unless (grep { $_ eq '/usr/local/bin' } split /:/, $ENV{PATH}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (grep {$_ eq "/usr/local/bin";} split(/:/, $ENV{"PATH"}, 0)) 0 5 5
18 0 $ENV{PATH} = "/usr/local/bin:$ENV{PATH}";
19 }
20  
21 0 my $force;
22 0 ▶GetOptions(
Branch: 1 branch
BranchTrueFalseTotal
&GetOptions("f|force", \$force) or pod2usage(2) 0 5 5
23 'f|force' => \$force,
24 ) or pod2usage(2);
25  
26 0 ▶if (
Branch: 1 branch
BranchTrueFalseTotal
if (not @ARGV or @ARGV == 1 and $ARGV[0] eq "help") 0 5 5
Condition50%3/6
not @ARGV or @ARGV == 1 and $ARGV[0] eq "help"
l!l&&r!l&&!r
005
@ARGV == 1 and $ARGV[0] eq "help"
!ll&&!rl&&r
140
MC/DC0%0/3
not @ARGV or @ARGV == 1 and $ARGV[0] eq "help"
not @ARGV @ARGV == 1 $ARGV[0] eq "help"
Truth table0%0/4
not(A) or B and C
A= not @ARGVB= @ARGV == 1C= $ARGV[0] eq "help"
ABCresult
1XX1
0111
00X0
0100
27 not @ARGV
28 or @ARGV == 1 and $ARGV[0] eq 'help'
29 ) {
30 0 pod2usage(2);
31 }
32  
33 0 my $command = shift @ARGV;
34 0 ▶if (@ARGV) {
Branch: 1 branch
BranchTrueFalseTotal
if (@ARGV) { } 1 4 5
35 0 Ubic::Cmd->run({
36 name => [@ARGV],
37 command => $command,
38 force => $force,
39 });
40 }
41 else {
42 0 Ubic::Cmd->run({
43 name => undef,
44 command => $command,
45 force => $force,
46 });
47 }
48  
49 __END__
« bin/ubic-daemon ↑ Summary lib/Ubic/Daemon/OS.pm »