<commit_before>#!/usr/bin/perl -w
#
# Copyright (C) 2009  NZ Registry Services
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the Artistic License 2.0 or later.  You should
# have received a copy of the Artistic License the file COPYING.txt.
# If not, see <http://www.perlfoundation.org/artistic_license_2_0>

use strict;
use warnings;
use Test::More;

BEGIN {

       # the below are all dependencies of Test::Pod::Coverage so should be OK
	eval <<USE;
use Test::Pod::Coverage 1.04;
require Pod::Coverage;
use Pod::Find qw(pod_where);
USE
	plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
}
plan skip_all => 'set TEST_POD or TEST_ALL to enable this test'
	unless $ENV{TEST_POD}
		or $ENV{TEST_ALL};

my @modules = all_modules;

plan tests => scalar @modules;

for my $module (@modules) {
	my $pc = Pod::Coverage->new(
		package      => $module,
		also_private => [qr/^((meta|BUILD)$|_)/],
	);

	my @naked  = $pc->naked;
	my $rating = $pc->coverage;

	if (@naked) {

		# if 'naked' subroutines appear in the SYNOPSIS,
		# that's OK
		my $location = pod_where( { -inc => 1 }, $module );
		my %naked = map { $_ => 1 } @naked;
		open POD, $location;
		while (<POD>) {
			if ( m{^=head1 SYNOPSIS$} .. m{^=\w+} ) {
				next if m{^=};
				delete $naked{$_} for m{(\w+)}g;
			}
		}
	} ## end if (@naked)
	if ( defined $rating ) {
		is( $rating * 100, 100, "POD Coverage of $module complete" );
	}
	else {
		my $why = $pc->why_unrated;
		my $nopublics = ( $why =~ "no public symbols defined" );
		ok( $nopublics, "POD coverage of $module complete" );
		my $verbose = $ENV{HARNESS_VERBOSE} || 0;
		diag("$module: $why") unless ( $nopublics && !$verbose );
	}

	my $s = @naked == 1 ? "" : "s";
	if (@naked) {<commit_msg>IS that not adequate documentation?!?<commit_after>#!/usr/bin/perl -w
#
# Copyright (C) 2009  NZ Registry Services
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the Artistic License 2.0 or later.  You should
# have received a copy of the Artistic License the file COPYING.txt.
# If not, see <http://www.perlfoundation.org/artistic_license_2_0>

use strict;
use warnings;
use Test::More;

BEGIN {

       # the below are all dependencies of Test::Pod::Coverage so should be OK
	eval <<USE;
use Test::Pod::Coverage 1.04;
require Pod::Coverage;
use Pod::Find qw(pod_where);
USE
	plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
}
plan skip_all => 'set TEST_POD or TEST_ALL to enable this test'
	unless $ENV{TEST_POD}
		or $ENV{TEST_ALL};

my @modules = all_modules;

plan tests => scalar @modules;

for my $module (@modules) {
	my $pc = Pod::Coverage->new(
		package      => $module,
		also_private => [qr/^((meta|BUILD)$|_)/],
	);

	my @naked  = $pc->naked;
	my $rating = $pc->coverage;

	if (@naked) {

		# if 'naked' subroutines appear in the SYNOPSIS,
		# that's OK
		my $location = pod_where( { -inc => 1 }, $module );
		my %naked = map { $_ => 1 } @naked;
		open POD, $location;
		while (<POD>) {
			if ( m{^=head1 SYNOPSIS$} ..
				m{^=(?!head1 SYNOPSIS)\w+} )
			{
				next if m{^=};
				delete $naked{$_} for m{(\w+)}g;
			}
		}
		$rating = 1 - (
			( scalar keys %naked ) / (
				$pc->covered + ( @naked - scalar keys %naked )
			)
		);
		@naked = keys %naked;
	} ## end if (@naked)
	if ( defined $rating ) {
		is( $rating * 100, 100, "POD Coverage of $module complete" );
	}
	else {
		my $why = $pc->why_unrated;
		my $nopublics = ( $why =~ "no public symbols defined" );
		ok( $nopublics, "POD coverage of $module complete" );
		my $verbose = $ENV{HARNESS_VERBOSE} || 0;
		diag("$module: $why") unless ( $nopublics && !$verbose );
	}

	my $s = @naked == 1 ? "" : "s";
	if (@naked) {
{'fraction_non_alphanumeric': 0.16756176154672395, 'fraction_numerical': 0.013963480128893663, 'mean_word_length': 3.4557416267942584, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4850847', 'n_tokens_mistral': 1563, 'n_tokens_neox': 1402, 'n_words': 432}