bin/spipe

filter: Statementstmt 96.0% 48 / 50 Branchbran 83.3% 15 / 18 Conditioncond 46.1% 6 / 13 MC/DCmcdc 16.6% 1 / 6 Subroutinesub 88.8% 8 / 9 Podpod n/a totaltotal 81.2% 78 / 96 CC 1 SCAR 1.2
CC
1
Cov
85%
CLEANUP
2.0
__ANON__
1.1
BEGIN
1.0
CRAP 1.1
« /usr/local/bin/perldoc ↑ Summary
1 #!/usr/bin/env perl
2  
3 5 ▶use App::Pipeline::Simple;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use Getopt::Long;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 5 ▶use constant PROGRAMME_NAME => 'spipe';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 # ABSTRACT: simple pipeline running interface
12 5 our $VERSION = '0.9.1'; # VERSION
13 # PODNAME: spipe
14  
15 # raising $OUTPUT_AUTOFLUSH flag to get immediate reporting
16 5 $| = 1;
17  
18 # catch interuptions cleanly
19 5 $SIG{'INT'} = 'CLEANUP';
20 0 ▶sub CLEANUP { exit(1) }
Subroutine CLEANUP: not called CC=1 SCAR=6.9
21  
22  
23 # variables to catch command line options
24 5 our $DEBUG = '';
25 5 our $CONFIG = '';
26 5 our $DIR = '.';
27 5 our $GRAPHVIZ;
28 5 our $INPUT = '';
29 5 our $ITYPE = '';
30 #our $CONTINUE; # not implemented yet
31 5 our $START = '';
32 5 our $STOP = '';
33 5 our $VERBOSE;
34  
35 GetOptions(
36 1 ▶ 'v|version' => sub{ print PROGRAMME_NAME, ", version ", $VERSION, "\n";
Subroutine __ANON__: called CC=1 SCAR=0.0
37 1 exit(1); },
38 'g|debug' => \$DEBUG,
39 'c|config:s' => \$CONFIG,
40 'd|directory:s' => \$DIR,
41 'i|input:s' => \$INPUT,
42 'it|itype:s' => \$ITYPE,
43 'graphviz' => \$GRAPHVIZ,
44 # 'continue' => \$CONTINUE,
45 'start:s' => \$START,
46 'stop:s' => \$STOP,
47 'verbose:i' => \$VERBOSE,
48 0 ▶ 'h|help|?' => sub{ exec('perldoc',$0); exit(0) },
Subroutine __ANON__: called CC=1 SCAR=1.2
49 5 );
50  
51  
52 3 my %args;
53 3 ▶$args{config} = $CONFIG if $CONFIG;
Branch: 1 branch
BranchTrueFalseTotal
if $main::CONFIG 2 1 3
54 3 $args{dir} = $DIR;
55 3 ▶$args{input} = $INPUT if $INPUT;
Branch: 1 branch
BranchTrueFalseTotal
if $main::INPUT 1 2 3
56 3 ▶$args{itype} = $ITYPE if $ITYPE;
Branch: 1 branch
BranchTrueFalseTotal
if $main::ITYPE 1 2 3
57 3 ▶$args{start} = $START if $START;
Branch: 1 branch
BranchTrueFalseTotal
if $main::START 0 3 3
58 3 ▶$args{stop} = $STOP if $STOP;
Branch: 1 branch
BranchTrueFalseTotal
if $main::STOP 0 3 3
59 3 ▶$args{verbose} = $VERBOSE if $VERBOSE;
Branch: 1 branch
BranchTrueFalseTotal
if $main::VERBOSE 2 1 3
60  
61 3 ▶unless (-e "$DIR/config.yml" or $CONFIG ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (-e "$main::DIR/config.yml" or $main::CONFIG) 1 2 3
Condition66%2/3
-e "$main::DIR/config.yml" or $main::CONFIG
l!l&&r!l&&!r
021
MC/DC50%1/2
-e "$main::DIR/config.yml" or $main::CONFIG
-e "$main::DIR/config.yml" $main::CONFIG
Truth table66%2/3
A or B
A= -e "$main::DIR/config.yml"B= $main::CONFIG
ABresult
1X1
011
000
62 1 croak "ERROR: Need either explicit config file or ".
63 "it has to be found the working directory\n"
64 }
65  
66 2 my $p = App::Pipeline::Simple->new(%args);
67 2 ▶print $p->graphviz and exit if $GRAPHVIZ;
Branch: 1 branch
BranchTrueFalseTotal
if $main::GRAPHVIZ 0 2 2
Condition20%1/5
$main::GRAPHVIZ && (print($p->graphviz) && exit)
!ll&&!rl&&r
200
print $p->graphviz and exit
!ll
00
MC/DC0%0/2
$main::GRAPHVIZ && (print($p->graphviz) && exit)
$main::GRAPHVIZ print $p->graphviz
Truth table33%1/3
A && B
A= $main::GRAPHVIZB= print $p->graphviz
ABresult
0X0
100
111
68 2 ▶print $p->stringify and exit if $DEBUG;
Branch: 1 branch
BranchTrueFalseTotal
if $main::DEBUG 1 1 2
Condition60%3/5
$main::DEBUG && (print($p->stringify) && exit)
!ll&&!rl&&r
110
print $p->stringify and exit
!ll
01
MC/DC0%0/2
$main::DEBUG && (print($p->stringify) && exit)
$main::DEBUG print $p->stringify
Truth table33%1/3
A && B
A= $main::DEBUGB= print $p->stringify
ABresult
0X0
100
111
69  
70 1 $p->run();
71  
72 __END__
« /usr/local/bin/perldoc ↑ Summary