examples/dolines.pl

filter: Statementstmt 89.6% 26 / 29 Branchbran 40.0% 4 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 79.5% 35 / 44 CC 1 SCAR 0.0
CC
1
Cov
77%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/B/CodeLines.pm ↑ Summary
1 #!/usr/bin/env perl
2 1 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use English;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use File::Basename;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 my $dir = dirname(__FILE__);
7 1 my $libdir = File::Spec->catfile($dir, '..', 'lib');
8 # Something to make sure we are recursing subroutines.
9 sub five() {
10 5
11 }
12 1 my $file;
13 1 ▶if (scalar @ARGV) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @ARGV) { } 0 1 1
14 0 $file = shift @ARGV;
15 0 ▶ die "Can't find file $file" unless -f $file;
Branch: 1 branch
BranchTrueFalseTotal
unless -f $file 0 0 0
16 } else {
17 1 $file = __FILE__;
18 }
19 1 ▶open FH, '<', $file or die $!;
Branch: 1 branch
BranchTrueFalseTotal
open FH, "<", $file or die $! 1 0 1
20 1 local $INPUT_RECORD_SEPARATOR; # enable localized slurp mode
21 1 my $content = <FH>;
22 1 ▶open STDERR, '>', '/dev/null' or die $!;
Branch: 1 branch
BranchTrueFalseTotal
open STDERR, ">", "/dev/null" or die $! 1 0 1
23 1 my $rc = system ($EXECUTABLE_NAME, "-I$libdir", '-MO=CodeLines,-exec', '-e',
24 $content);
25 1 ▶unless (0 == $rc) {
Branch: 1 branch
BranchTrueFalseTotal
unless (0 == $rc) 0 1 1
26 0 die "$file didn't parse\n";
27 }
« blib/lib/B/CodeLines.pm ↑ Summary