bin/pod2advent

filter: Statementstmt 86.4% 32 / 37 Branchbran 71.4% 10 / 14 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 80.3% 49 / 61 CC 1 SCAR 0.0
CC
1
Cov
81%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Pod/Advent.pm ↑ Summary
1 #!perl
2  
3 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 8 ▶use Pod::Advent;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 8 ▶use Getopt::Long;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 8 ▶my $pod = shift @ARGV or die "need pod filename, or - for file on stdin, or + for snippet on stdin";
Branch: 1 branch
BranchTrueFalseTotal
my $pod = shift @ARGV or die "need pod filename, or - for file on stdin, or + for snippet on stdin" 7 1 8
9  
10  
11 7 my $css;
12 7 my $isadvent = 1;
13 7 my $spellcheck = 1;
14 7 GetOptions(
15 'css=s' => \$css,
16 'advent!' => \$isadvent,
17 'spellcheck!' => \$spellcheck,
18 );
19  
20 7 my $advent = Pod::Advent->new;
21  
22 7 ▶if( !$spellcheck && $advent->spellcheck_enabled ){
Branch: 1 branch
BranchTrueFalseTotal
if (not $spellcheck and $advent->spellcheck_enabled) 0 7 7
Condition66%2/3
not $spellcheck and $advent->spellcheck_enabled
!ll&&!rl&&r
610
MC/DC0%0/2
not $spellcheck and $advent->spellcheck_enabled
not $spellcheck $advent->spellcheck_enabled
Truth table66%2/3
not(A) and B
A= not $spellcheckB= $advent->spellcheck_enabled
ABresult
0X0
100
111
23 # user wants the (available) spellcheck turned off
24  
25 # HACK. This should be an accessor to an attribute.
26 0 $Pod::Advent::speller = undef;
27 }
28  
29 7 ▶$advent->css_url($css) if $css;
Branch: 1 branch
BranchTrueFalseTotal
if $css 1 6 7
30  
31 7 $Pod::Advent::data{isAdvent} = $isadvent; # HACK. This should be an accessor to an attribute.
32  
33 7 ▶if( $pod eq '-' ){
Branch: 2 branches
BranchTrueFalseTotal
if ($pod eq '-') { } 1 6 7
elsif ($pod eq '+') { } 2 4 6
34 1 $advent->parse_file( \*STDIN );
35 }elsif( $pod eq '+' ){
36 2 local $/ = undef;
37 2 my $s = "=pod\n\n" . <STDIN> . "\n\n=cut";
38 2 $Pod::Advent::BODY_ONLY = 1;
39 2 $advent->parse_string_document( $s );
40 }else{
41 4 $advent->parse_file( $pod );
42 }
43  
44 7 ▶if( $advent->num_spelling_errors ){
Branch: 1 branch
BranchTrueFalseTotal
if ($advent->num_spelling_errors) 0 7 7
45 0 print STDERR "Possible SPELLING ERRORS:\n";
46 0 my %seen;
47 0 foreach my $word ( $advent->spelling_errors ){
48 0 ▶ print STDERR "\t$word\n" unless $seen{$word}++;
Branch: 1 branch
BranchTrueFalseTotal
unless $seen{$word}++ 0 0 0
49 }
50 }
51  
52 __END__
« blib/lib/Pod/Advent.pm ↑ Summary