bin/echo

filter: Statementstmt 100% 13 / 13 Branchbran 83.3% 5 / 6 Conditioncond 55.5% 5 / 9 MC/DCmcdc 40.0% 2 / 5 Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 77.1% 27 / 35 CC 4 SCAR 12.2
CC
4
Cov
82%
run
4.0
BEGIN
1.0
CRAP 3.4
« bin/od ↑ Summary blib/script/find »
1 #!/usr/bin/perl
2  
3 =begin metadata
4  
5 Name: echo
6 Description: echo arguments
7 Author: Randy Yarger, randy.yarger@nextel.com
8 License: perl
9  
10 =end metadata
11  
12 =cut
13  
14 package PerlPowerTools::echo;
15  
16 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 4 our $VERSION = '1.3';
19  
20 # run if called directly, indirectly, directly par-packed, undirectly par-packed
21 4 ▶__PACKAGE__->run( @ARGV ) if !caller() || caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/ || caller(1) eq 'PAR';
Branch: 1 branch
BranchTrueFalseTotal
if not caller() or caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/ or caller 1 eq "PAR" 4 0 4
Condition33%2/6
not caller() or caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/ or caller 1 eq "PAR"
l!l&&r!l&&!r
400
not caller() or caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/
l!l&&r!l&&!r
400
MC/DC0%0/3
not caller() or caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/ or caller 1 eq "PAR"
not caller() caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/ caller 1 eq "PAR"
Truth table25%1/4
not(A) or B or C
A= not caller()B= caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/C= caller 1 eq "PAR"
ABCresult
1XX1
01X1
0011
0000
22  
23 4 ▶sub run {
Subroutine run: called CC=4 SCAR=13.9
24 4 my ( $self, @args ) = @_;
25  
26 4 my $N = 1;
27 4 ▶ if (@args && $args[0] eq '-n') {
Branch: 1 branch
BranchTrueFalseTotal
if (@args and $args[0] eq "-n") 1 3 4
Condition100%3/3
@args and $args[0] eq "-n"
!ll&&!rl&&r
121
MC/DC100%2/2
@args and $args[0] eq "-n"
@args $args[0] eq "-n"
Truth table100%3/3
A and B
A= @argsB= $args[0] eq "-n"
ABresult
0X0
100
111
28 1 $N = 0;
29 1 shift @args;
30 }
31  
32 4 print join ' ', @args;
33 4 ▶ print "\n" if $N == 1;
Branch: 1 branch
BranchTrueFalseTotal
if $N == 1 3 1 4
34  
35 4 exit 0;
36 }
37  
38 1;
39  
40 __END__
« bin/od ↑ Summary blib/script/find »