| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition100%6/6
$checker->num_errors > 0 or $self->warnings and $checker->num_warnings > 0
$self->warnings and $checker->num_warnings > 0
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
| |||||||||||||||||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||||||||||||||||