blib/lib/Code/TidyAll/Plugin/PodChecker.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 4 / 4 Conditioncond 100% 6 / 6 MC/DCmcdc 100% 3 / 3 Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 100% 47 / 47 CC 5 SCAR 11.0
CC
5
Cov
100%
validate_file
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« blib/lib/Code/TidyAll/Plugin/JSON.pm ↑ Summary blib/lib/Code/TidyAll/Plugin/PerlCritic.pm »
1 package Code::TidyAll::Plugin::PodChecker;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Pod::Checker;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Specio::Library::Numeric;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 extends 'Code::TidyAll::Plugin';
12  
13 1 our $VERSION = '0.85';
14  
15 1 has warnings => (
16 is => 'ro',
17 isa => t('PositiveInt'),
18 );
19  
20 6 ▶sub validate_file {
Subroutine validate_file: called CC=5 SCAR=16.1
Pod documented
21 6 my ( $self, $file ) = @_;
22  
23 6 my $result;
24 6 ▶ my %options = ( $self->warnings ? ( '-warnings' => $self->warnings ) : () );
Branch: 1 branch
BranchTrueFalseTotal
$self->warnings ? : 3 3 6
25 6 my $checker = Pod::Checker->new(%options);
26 6 my $output;
27 6 open my $fh, '>', \$output;
28 6 $checker->parse_from_file( $file->stringify, $fh );
29 6 ▶ die $output
Branch: 1 branch
BranchTrueFalseTotal
if $checker->num_errors > 0 or $self->warnings and $checker->num_warnings > 0 3 3 6
Condition100%6/6
$checker->num_errors > 0 or $self->warnings and $checker->num_warnings > 0
l!l&&r!l&&!r
123
$self->warnings and $checker->num_warnings > 0
!ll&&!rl&&r
212
MC/DC100%3/3
$checker->num_errors > 0 or $self->warnings and $checker->num_warnings > 0
$checker->num_errors > 0 $self->warnings $checker->num_warnings > 0
Truth table100%4/4
A or B and C
A= $checker->num_errors > 0B= $self->warningsC= $checker->num_warnings > 0
ABCresult
1XX1
0111
00X0
0100
30 if $checker->num_errors > 0
31 || ( $self->warnings && $checker->num_warnings > 0 );
32 }
33  
34 1 1;
35  
36 # ABSTRACT: Use podchecker with tidyall
37  
38 __END__
« blib/lib/Code/TidyAll/Plugin/JSON.pm ↑ Summary blib/lib/Code/TidyAll/Plugin/PerlCritic.pm »