App-PerlCriticUtils
view release on metacpan or search on metacpan
script/pcplist view on Meta::CPAN
Variables::ProhibitUnusedVariables
Variables::ProtectPrivateVars
Variables::RequireInitializationForLocalVars
Variables::RequireLexicalLoopIterators
Variables::RequireLocalizedPunctuationVars
Variables::RequireNegativeIndices
=head2 List installed policies (show details)
% pcplist -l
+--------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------------------+------------------+---------...
| name | abstract | applies_to | default_severity | default_...
+--------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------------------+------------------+---------...
| BuiltinFunctions::GrepWithSimpleValue | Warn grep with simple value | PPI::Token::Word | 3 | core, bu...
| BuiltinFunctions::ProhibitBooleanGrep | Use C<List::MoreUtils::any> instead of C<grep> in boolean context. | PPI::Token::Word | 2 | core, pb...
| BuiltinFunctions::ProhibitComplexMappings | Map blocks should have a single statement. | PPI::Token::Word | 3 | core, pb...
| BuiltinFunctions::ProhibitLvalueSubstr | Use 4-argument C<substr> instead of writing C<substr($foo, 2, 6) = $bar>. | PPI::Token::Word | 3 | core, ma...
| BuiltinFunctions::ProhibitReverseSortBlock | Forbid $b before $a in sort blocks. | PPI::Token::Word | 1 | core, pb...
| BuiltinFunctions::ProhibitShiftRef | Prohibit C<\shift> in code | PPI::Token::Word | 3 | core, bu...
| BuiltinFunctions::ProhibitSleepViaSelect | Use L<Time::HiRes|Time::HiRes> instead of something like C<select(undef, undef, undef, .05)>. | PPI::Token::Word | 5 | core, pb...
| BuiltinFunctions::ProhibitStringyEval | Write C<eval { my $foo; bar($foo) }> instead of C<eval "my $foo; bar($foo);">. | PPI::Token::Word | 5 | core, pb...
| BuiltinFunctions::ProhibitStringySplit | Write C<split /-/, $string> instead of C<split '-', $string>. | PPI::Token::Word | 2 | core, pb...
| BuiltinFunctions::ProhibitUniversalCan | Write C<< eval { $foo->can($name) } >> instead of C<UNIVERSAL::can($foo, $name)>. | PPI::Token::Word | 3 | core, ma...
| BuiltinFunctions::ProhibitUniversalIsa | Write C<< eval { $foo->isa($pkg) } >> instead of C<UNIVERSAL::isa($foo, $pkg)>. | PPI::Token::Word | 3 | core, ma...
| BuiltinFunctions::ProhibitUselessTopic | Don't pass $_ to built-in functions that assume it, or to most filetest operators. | PPI::Token::Word | 2 | core ...
| BuiltinFunctions::ProhibitVoidGrep | Don't use C<grep> in void contexts. | PPI::Token::Word | 3 | core, ma...
| BuiltinFunctions::ProhibitVoidMap | Don't use C<map> in void contexts. | PPI::Token::Word | 3 | core, ma...
| BuiltinFunctions::RequireBlockGrep | Write C<grep { /$pattern/ } @list> instead of C<grep /$pattern/, @list>. | PPI::Token::Word | 4 | core, bu...
| BuiltinFunctions::RequireBlockMap | Write C<map { /$pattern/ } @list> instead of C<map /$pattern/, @list>. | PPI::Token::Word | 4 | core, bu...
| BuiltinFunctions::RequireGlobFunction | Use C<glob q{*}> instead of <*>. | PPI::Token::QuoteLike::Readline | 5 | core, pb...
| BuiltinFunctions::RequireSimpleSortBlock | Sort blocks should have a single statement. | PPI::Token::Word | 3 | core, pb...
| ClassHierarchies::ProhibitAutoloading | AUTOLOAD methods should be avoided. | PPI::Statement::Sub | 3 | core, ma...
| ClassHierarchies::ProhibitExplicitISA | Employ C<use base> instead of C<@ISA>. | PPI::Token::Symbol | 3 | core, ma...
| ClassHierarchies::ProhibitOneArgBless | Write C<bless {}, $class;> instead of just C<bless {};>. | PPI::Token::Word | 5 | core, pb...
| CodeLayout::ProhibitHardTabs | Use spaces instead of tabs. | PPI::Token | 3 | core, co...
| CodeLayout::ProhibitParensWithBuiltins | Write C<open $handle, $path> instead of C<open($handle, $path)>. | PPI::Token::Word | 1 | core, pb...
| CodeLayout::ProhibitQuotedWordLists | Write C<qw(foo bar baz)> instead of C<('foo', 'bar', 'baz')>. | PPI::Structure::List | 2 | core, co...
| CodeLayout::ProhibitTrailingWhitespace | Don't use whitespace at the end of lines. | PPI::Token::Whitespace | 1 | core, ma...
| CodeLayout::RequireConsistentNewlines | Use the same newline through the source. | PPI::Document | 4 | core, bu...
| CodeLayout::RequireTidyCode | Must run code through L<perltidy|perltidy>. | PPI::Document | 1 | core, pb...
| CodeLayout::RequireTrailingCommas | Put a comma at the end of every multi-line list declaration, including the last one. | PPI::Structure::List | 1 | core, pb...
| ControlStructures::ProhibitCStyleForLoops | Write C<for(0..20)> instead of C<for($i=0; $i<=20; $i++)>. | PPI::Structure::For | 2 | core, pb...
| ControlStructures::ProhibitCascadingIfElse | Don't write long "if-elsif-elsif-elsif-elsif...else" chains. | PPI::Statement::Compound | 3 | core, pb...
| ControlStructures::ProhibitDeepNests | Don't write deeply nested loops and conditionals. | PPI::Statement::Compound | 3 | core, ma...
| ControlStructures::ProhibitLabelsWithSpecialBlockNames | Don't use labels that are the same as the special block names. | PPI::Token::Label | 4 | core, bu...
| ControlStructures::ProhibitMutatingListFunctions | Don't modify C<$_> in list functions. | PPI::Token::Word | 5 | core, bu...
| ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions | Don't use operators like C<not>, C<!~>, and C<le> within C<until> and C<unless>. | PPI::Token::Word | 3 | core, ma...
| ControlStructures::ProhibitPostfixControls | Write C<if($condition){ do_something() }> instead of C<do_something() if $condition>. | PPI::Token::Word | 2 | core, pb...
| ControlStructures::ProhibitUnlessBlocks | Write C<if(! $condition)> instead of C<unless($condition)>. | PPI::Statement::Compound | 2 | core, pb...
| ControlStructures::ProhibitUnreachableCode | Don't write code after an unconditional C<die, exit, or next>. | PPI::Token::Word | 4 | core, bu...
| ControlStructures::ProhibitUntilBlocks | Write C<while(! $condition)> instead of C<until($condition)>. | PPI::Statement | 2 | core, pb...
| ControlStructures::ProhibitYadaOperator | Never use C<...> in production code. | PPI::Token::Operator | 4 | core, pb...
| Documentation::PodSpelling | Check your spelling. | PPI::Document | 1 | core, co...
| Documentation::RequirePackageMatchesPodName | The C<=head1 NAME> section should match the package. | PPI::Document | 1 | core, co...
| Documentation::RequirePodAtEnd | All POD should be after C<__END__>. | PPI::Document | 1 | core, co...
| Documentation::RequirePodSections | Organize your POD into the customary sections. | PPI::Document | 2 | core, pb...
| ErrorHandling::RequireCarping | Use functions from L<Carp|Carp> instead of C<warn> or C<die>. | PPI::Token::Word | 3 | core, pb...
| ErrorHandling::RequireCheckingReturnValueOfEval | You can't depend upon the value of C<$@>/C<$EVAL_ERROR> to tell whether an C<eval> failed. | PPI::Token::Word | 3 | core, bu...
| InputOutput::ProhibitBacktickOperators | Discourage stuff like C<@files = `ls $directory`>. | PPI::Token::QuoteLike::Command | 3 | core, ma...
| InputOutput::ProhibitBarewordFileHandles | Write C<open my $fh, q{<}, $filename;> instead of C<open FH, q{<}, $filename;>. | PPI::Token::Word | 5 | core, pb...
| InputOutput::ProhibitExplicitStdin | Use "<>" or "<ARGV>" or a prompting module instead of "<STDIN>". | PPI::Token::QuoteLike::Readline | 4 | core, pb...
| InputOutput::ProhibitInteractiveTest | Use prompt() instead of -t. | PPI::Token::Operator | 5 | core, pb...
| InputOutput::ProhibitJoinedReadline | Use C<local $/ = undef> or L<Path::Tiny|Path::Tiny> instead of joined readline. | PPI::Token::Word | 3 | core, pb...
| InputOutput::ProhibitOneArgSelect | Never write C<select($fh)>. | PPI::Token::Word | 4 | core, bu...
| InputOutput::ProhibitReadlineInForLoop | Write C<< while( $line = <> ){...} >> instead of C<< for(<>){...} >>. | PPI::Statement::Compound | 4 | core, bu...
| InputOutput::ProhibitTwoArgOpen | Write C<< open $fh, q{<}, $filename; >> instead of C<< open $fh, "<$filename"; >>. | PPI::Token::Word | 5 | core, pb...
| InputOutput::RequireBracedFileHandleWithPrint | Write C<print {$FH} $foo, $bar;> instead of C<print $FH $foo, $bar;>. | PPI::Token::Word | 1 | core, pb...
| InputOutput::RequireBriefOpen | Close filehandles as soon as possible after opening them. | PPI::Token::Word | 4 | core, pb...
| InputOutput::RequireCheckedClose | Write C<< my $error = close $fh; >> instead of C<< close $fh; >>. | PPI::Token::Word | 2 | core, ma...
| InputOutput::RequireCheckedOpen | Write C<< my $error = open $fh, $mode, $filename; >> instead of C<< open $fh, $mode, $filename; >>. | PPI::Token::Word | 3 | core, ma...
| InputOutput::RequireCheckedSyscalls | Return value of flagged function ignored. | PPI::Token::Word | 1 | core, ma...
| InputOutput::RequireEncodingWithUTF8Layer | Write C<< open $fh, q{<:encoding(UTF-8)}, $filename; >> instead of C<< open $fh, q{<:utf8}, $filename; >>. | PPI::Token::Word | 5 | core, bu...
| Miscellanea::ProhibitFormats | Do not use C<format>. | PPI::Token::Word | 3 | core, ma...
| Miscellanea::ProhibitTies | Do not use C<tie>. | PPI::Token::Word | 2 | core, pb...
| Miscellanea::ProhibitUnrestrictedNoCritic | Forbid a bare C<## no critic> | PPI::Document | 3 | core, ma...
| Miscellanea::ProhibitUselessNoCritic | Remove ineffective "## no critic" annotations. | PPI::Document | 2 | core, ma...
| Modules::ProhibitAutomaticExportation | Export symbols via C<@EXPORT_OK> or C<%EXPORT_TAGS> instead of C<@EXPORT>. | PPI::Document | 4 | core, bu...
| Modules::ProhibitConditionalUseStatements | Avoid putting conditional logic around compile-time includes. | PPI::Statement::Include | 3 | core, bu...
| Modules::ProhibitEvilModules | Ban modules that aren't blessed by your shop. | PPI::Statement::Include | 5 | core, bu...
| Modules::ProhibitExcessMainComplexity | Minimize complexity in code that is B<outside> of subroutines. | PPI::Document | 3 | core, co...
| Modules::ProhibitMultiplePackages | Put packages (especially subclasses) in separate files. | PPI::Document | 4 | core, bu...
| Modules::RequireBarewordIncludes | Write C<require Module> instead of C<require 'Module.pm'>. | PPI::Statement::Include | 5 | core, po...
| Modules::RequireEndWithOne | End each module with an explicitly C<1;> instead of some funky expression. | PPI::Document | 4 | core, bu...
| Modules::RequireExplicitPackage | Always make the C<package> explicit. | PPI::Document | 4 | core, bu...
| Modules::RequireFilenameMatchesPackage | Package declaration must match filename. | PPI::Document | 5 | core, bu...
| Modules::RequireNoMatchVarsWithUseEnglish | C<use English> must be passed a C<-no_match_vars> argument. | PPI::Statement::Include | 2 | core, pe...
| Modules::RequireVersionVar | Give every module a C<$VERSION> number. | PPI::Document | 2 | core, pb...
| NamingConventions::Capitalization | Distinguish different program components by case. | PPI::Token::Label | 1 | core, pb...
| NamingConventions::ProhibitAmbiguousNames | Don't use vague variable or subroutine names like 'last' or 'record'. | PPI::Statement::Variable | 3 | core, pb...
| Objects::ProhibitIndirectSyntax | Prohibit indirect object call syntax. | PPI::Token::Word | 4 | core, pb...
| References::ProhibitDoubleSigils | Write C<@{ $array_ref }> instead of C<@$array_ref>. | PPI::Token::Cast | 2 | core, pb...
| RegularExpressions::ProhibitCaptureWithoutTest | Capture variable used outside conditional. | PPI::Token::Magic | 3 | core, pb...
| RegularExpressions::ProhibitComplexRegexes | Split long regexps into smaller C<qr//> chunks. | PPI::Token::QuoteLike::Regexp | 3 | core, pb...
| RegularExpressions::ProhibitEnumeratedClasses | Use named character classes instead of explicit character lists. | PPI::Token::QuoteLike::Regexp | 1 | core, pb...
| RegularExpressions::ProhibitEscapedMetacharacters | Use character classes for literal meta-characters instead of escapes. | PPI::Token::QuoteLike::Regexp | 1 | core, pb...
| RegularExpressions::ProhibitFixedStringMatches | Use C<eq> or hash instead of fixed-pattern regexps. | PPI::Token::QuoteLike::Regexp | 2 | core, pb...
| RegularExpressions::ProhibitSingleCharAlternation | Use C<[abc]> instead of C<a|b|c>. | PPI::Token::QuoteLike::Regexp | 1 | core, pb...
| RegularExpressions::ProhibitUnusedCapture | Only use a capturing group if you plan to use the captured value. | PPI::Token::Regexp::Substitute | 3 | core, pb...
| RegularExpressions::ProhibitUnusualDelimiters | Use only C<//> or C<{}> to delimit regexps. | PPI::Token::QuoteLike::Regexp | 1 | core, pb...
| RegularExpressions::ProhibitUselessTopic | Don't use $_ to match against regexes. | PPI::Token::Magic | 2 | core ...
| RegularExpressions::RequireBracesForMultiline | Use C<{> and C<}> to delimit multi-line regexps. | PPI::Token::QuoteLike::Regexp | 1 | core, pb...
| RegularExpressions::RequireDotMatchAnything | Always use the C</s> modifier with regular expressions. | PPI::Token::QuoteLike::Regexp | 2 | core, pb...
| RegularExpressions::RequireExtendedFormatting | Always use the C</x> modifier with regular expressions. | PPI::Token::QuoteLike::Regexp | 3 | core, pb...
| RegularExpressions::RequireLineBoundaryMatching | Always use the C</m> modifier with regular expressions. | PPI::Token::QuoteLike::Regexp | 2 | core, pb...
| Subroutines::ProhibitAmpersandSigils | Don't call functions with a leading ampersand sigil. | PPI::Token::Symbol | 2 | core, pb...
| Subroutines::ProhibitBuiltinHomonyms | Don't declare your own C<open> function. | PPI::Statement::Sub | 4 | core, bu...
| Subroutines::ProhibitExcessComplexity | Minimize complexity by factoring code into smaller subroutines. | PPI::Statement::Sub | 3 | core, co...
| Subroutines::ProhibitExplicitReturnUndef | Return failure with bare C<return> instead of C<return undef>. | PPI::Token::Word | 5 | core, pb...
| Subroutines::ProhibitManyArgs | Too many arguments. | PPI::Statement::Sub | 3 | core, pb...
| Subroutines::ProhibitNestedSubs | C<sub never { sub correct {} }>. | PPI::Statement::Sub | 5 | core, bu...
| Subroutines::ProhibitReturnSort | Behavior of C<sort> is not defined if called in scalar context. | PPI::Token::Word | 5 | core, bu...
| Subroutines::ProhibitSubroutinePrototypes | Don't write C<sub my_function (@@) {}>. | PPI::Statement::Sub | 5 | core, pb...
| Subroutines::ProhibitUnusedPrivateSubroutines | Prevent unused private subroutines. | PPI::Statement::Sub | 3 | core, ma...
| Subroutines::ProtectPrivateSubs | Prevent access to private subs in other packages. | PPI::Token::Word | 3 | core, ma...
| Subroutines::RequireArgUnpacking | Always unpack C<@_> first. | PPI::Statement::Sub | 4 | core, pb...
| Subroutines::RequireFinalReturn | End every path through a subroutine with an explicit C<return> statement. | PPI::Statement::Sub | 4 | core, bu...
| TestingAndDebugging::ProhibitNoStrict | Prohibit various flavors of C<no strict>. | PPI::Statement::Include | 5 | core, pb...
| TestingAndDebugging::ProhibitNoWarnings | Prohibit various flavors of C<no warnings>. | PPI::Statement::Include | 4 | core, bu...
| TestingAndDebugging::ProhibitProlongedStrictureOverride | Don't turn off strict for large blocks of code. | PPI::Statement::Include | 4 | core, pb...
| TestingAndDebugging::RequireTestLabels | Tests should all have labels. | PPI::Token::Word | 3 | core, ma...
| TestingAndDebugging::RequireUseStrict | Always C<use strict>. | PPI::Document | 5 | core, pb...
| TestingAndDebugging::RequireUseWarnings | Always C<use warnings>. | PPI::Document | 4 | core, pb...
script/pcplist view on Meta::CPAN
| ValuesAndExpressions::ProhibitEmptyQuotes | Write C<q{}> instead of C<''>. | PPI::Token::Quote | 2 | core, pb...
| ValuesAndExpressions::ProhibitEscapedCharacters | Write C<"\N{DELETE}"> instead of C<"\x7F">, etc. | PPI::Token::Quote::Interpolate | 2 | core, pb...
| ValuesAndExpressions::ProhibitImplicitNewlines | Use concatenation or HEREDOCs instead of literal line breaks in strings. | PPI::Token::Quote | 3 | core, pb...
| ValuesAndExpressions::ProhibitInterpolationOfLiterals | Always use single quotes for literal strings. | PPI::Token::Quote::Interpolate | 1 | core, pb...
| ValuesAndExpressions::ProhibitLeadingZeros | Write C<oct(755)> instead of C<0755>. | PPI::Token::Number::Octal | 5 | core, pb...
| ValuesAndExpressions::ProhibitLongChainsOfMethodCalls | Long chains of method calls indicate tightly coupled code. | PPI::Statement | 2 | core, ma...
| ValuesAndExpressions::ProhibitMagicNumbers | Don't use values that don't explain themselves. | PPI::Token::Number | 2 | core, ma...
| ValuesAndExpressions::ProhibitMismatchedOperators | Don't mix numeric operators with string operands, or vice-versa. | PPI::Token::Operator | 3 | core, bu...
| ValuesAndExpressions::ProhibitMixedBooleanOperators | Write C< !$foo && $bar || $baz > instead of C< not $foo && $bar or $baz>. | PPI::Statement | 4 | core, bu...
| ValuesAndExpressions::ProhibitNoisyQuotes | Use C<q{}> or C<qq{}> instead of quotes for awkward-looking strings. | PPI::Token::Quote::Single | 2 | core, pb...
| ValuesAndExpressions::ProhibitQuotesAsQuotelikeOperatorDelimiters | Don't use quotes (C<'>, C<">, C<`>) as delimiters for the quote-like operators. | PPI::Token::Regexp::Transliterate | 3 | core, ma...
| ValuesAndExpressions::ProhibitSpecialLiteralHeredocTerminator | Don't write C< print <<'__END__' >. | PPI::Token::HereDoc | 3 | core, ma...
| ValuesAndExpressions::ProhibitVersionStrings | Don't use strings like C<v1.4> or C<1.4.5> when including other modules. | PPI::Statement::Include | 3 | core, pb...
| ValuesAndExpressions::RequireConstantVersion | Require $VERSION to be a constant rather than a computed value. | PPI::Token::Symbol | 2 | core, ma...
| ValuesAndExpressions::RequireInterpolationOfMetachars | Warns that you might have used single quotes when you really wanted double-quotes. | PPI::Token::Quote::Literal | 1 | core, pb...
| ValuesAndExpressions::RequireNumberSeparators | Write C< 141_234_397.0145 > instead of C< 141234397.0145 >. | PPI::Token::Number | 2 | core, pb...
| ValuesAndExpressions::RequireQuotedHeredocTerminator | Write C< print <<'THE_END' > or C< print <<"THE_END" >. | PPI::Token::HereDoc | 3 | core, pb...
| ValuesAndExpressions::RequireUpperCaseHeredocTerminator | Write C< <<'THE_END'; > instead of C< <<'theEnd'; >. | PPI::Token::HereDoc | 2 | core, pb...
| Variables::ProhibitAugmentedAssignmentInDeclaration | Do not write C< my $foo .= 'bar'; >. | PPI::Statement::Variable | 4 | core, bu...
| Variables::ProhibitConditionalDeclarations | Do not write C< my $foo = $bar if $baz; >. | PPI::Statement::Variable | 5 | core, bu...
| Variables::ProhibitEvilVariables | Ban variables that aren't blessed by your shop. | PPI::Token::Symbol | 5 | core, bu...
| Variables::ProhibitFatCommaInDeclaration | Prohibit fat comma in declaration | PPI::Statement::Variable | 4 | core, bu...
| Variables::ProhibitLocalVars | Use C<my> instead of C<local>, except when you have to. | PPI::Statement::Variable | 2 | core, pb...
| Variables::ProhibitMatchVars | Avoid C<$`>, C<$&>, C<$'> and their English equivalents. | PPI::Statement::Include | 4 | core, pe...
| Variables::ProhibitPackageVars | Eliminate globals declared with C<our> or C<use vars>. | PPI::Statement::Include | 3 | core, pb...
| Variables::ProhibitPerl4PackageNames | Use double colon (::) to separate package name components instead of single quotes ('). | PPI::Token::Symbol | 2 | core, ma...
| Variables::ProhibitPunctuationVars | Write C<$EVAL_ERROR> instead of C<$@>. | PPI::Token::HereDoc | 2 | core, pb...
| Variables::ProhibitReusedNames | Do not reuse a variable name in a lexical scope | PPI::Statement::Variable | 3 | core, bu...
| Variables::ProhibitUnusedVariables | Don't ask for storage you don't need. | PPI::Document | 3 | core, ma...
| Variables::ProtectPrivateVars | Prevent access to private vars in other packages. | PPI::Token::Symbol | 3 | core, ma...
| Variables::RequireInitializationForLocalVars | Write C<local $foo = $bar;> instead of just C<local $foo;>. | PPI::Statement::Variable | 3 | core, pb...
| Variables::RequireLexicalLoopIterators | Write C<for my $element (@list) {...}> instead of C<for $element (@list) {...}>. | PPI::Statement::Compound | 5 | core, pb...
| Variables::RequireLocalizedPunctuationVars | Magic variables should be assigned as "local". | PPI::Token::Operator | 4 | core, pb...
| Variables::RequireNegativeIndices | Negative array index should be used. | PPI::Structure::Subscript | 4 | core, ma...
+--------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+-----------------------------------+------------------+---------...
=head2 What's that policy that prohibits returning undef explicitly?
% pcplist undef
BuiltinFunctions::ProhibitSleepViaSelect
InputOutput::ProhibitJoinedReadline
Subroutines::ProhibitExplicitReturnUndef
=head2 What's that policy that requires using strict?
% pcplist req strict
TestingAndDebugging::RequireUseStrict
=head2 List policies which have default severity of 5
% pcplist '--default-severity=5' -l
+--------------------------------------------------+------------------------------------------------------------------------------------------------------------+---------------------------------+------------------+-----------------------------------...
| name | abstract | applies_to | default_severity | default_themes ...
+--------------------------------------------------+------------------------------------------------------------------------------------------------------------+---------------------------------+------------------+-----------------------------------...
| BuiltinFunctions::ProhibitSleepViaSelect | Use L<Time::HiRes|Time::HiRes> instead of something like C<select(undef, undef, undef, .05)>. | PPI::Token::Word | 5 | core, pbp, bugs ...
| BuiltinFunctions::ProhibitStringyEval | Write C<eval { my $foo; bar($foo) }> instead of C<eval "my $foo; bar($foo);">. | PPI::Token::Word | 5 | core, pbp, bugs, certrule ...
| BuiltinFunctions::RequireGlobFunction | Use C<glob q{*}> instead of <*>. | PPI::Token::QuoteLike::Readline | 5 | core, pbp, bugs ...
| ClassHierarchies::ProhibitOneArgBless | Write C<bless {}, $class;> instead of just C<bless {};>. | PPI::Token::Word | 5 | core, pbp, bugs ...
| ControlStructures::ProhibitMutatingListFunctions | Don't modify C<$_> in list functions. | PPI::Token::Word | 5 | core, bugs, pbp, certrule ...
| InputOutput::ProhibitBarewordFileHandles | Write C<open my $fh, q{<}, $filename;> instead of C<open FH, q{<}, $filename;>. | PPI::Token::Word | 5 | core, pbp, bugs, certrec ...
| InputOutput::ProhibitInteractiveTest | Use prompt() instead of -t. | PPI::Token::Operator | 5 | core, pbp, bugs, certrule ...
| InputOutput::ProhibitTwoArgOpen | Write C<< open $fh, q{<}, $filename; >> instead of C<< open $fh, "<$filename"; >>. | PPI::Token::Word | 5 | core, pbp, bugs, security, certrul...
| InputOutput::RequireEncodingWithUTF8Layer | Write C<< open $fh, q{<:encoding(UTF-8)}, $filename; >> instead of C<< open $fh, q{<:utf8}, $filename; >>. | PPI::Token::Word | 5 | core, bugs, security ...
| Modules::ProhibitEvilModules | Ban modules that aren't blessed by your shop. | PPI::Statement::Include | 5 | core, bugs, certrule ...
| Modules::RequireBarewordIncludes | Write C<require Module> instead of C<require 'Module.pm'>. | PPI::Statement::Include | 5 | core, portability ...
| Modules::RequireFilenameMatchesPackage | Package declaration must match filename. | PPI::Document | 5 | core, bugs ...
| Subroutines::ProhibitExplicitReturnUndef | Return failure with bare C<return> instead of C<return undef>. | PPI::Token::Word | 5 | core, pbp, bugs, certrec ...
| Subroutines::ProhibitNestedSubs | C<sub never { sub correct {} }>. | PPI::Statement::Sub | 5 | core, bugs ...
| Subroutines::ProhibitReturnSort | Behavior of C<sort> is not defined if called in scalar context. | PPI::Token::Word | 5 | core, bugs, certrule ...
| Subroutines::ProhibitSubroutinePrototypes | Don't write C<sub my_function (@@) {}>. | PPI::Statement::Sub | 5 | core, pbp, bugs, certrec ...
| TestingAndDebugging::ProhibitNoStrict | Prohibit various flavors of C<no strict>. | PPI::Statement::Include | 5 | core, pbp, bugs, certrec ...
| TestingAndDebugging::RequireUseStrict | Always C<use strict>. | PPI::Document | 5 | core, pbp, bugs, certrule, certrec...
| ValuesAndExpressions::ProhibitLeadingZeros | Write C<oct(755)> instead of C<0755>. | PPI::Token::Number::Octal | 5 | core, pbp, bugs, certrec ...
| Variables::ProhibitConditionalDeclarations | Do not write C< my $foo = $bar if $baz; >. | PPI::Statement::Variable | 5 | core, bugs ...
| Variables::ProhibitEvilVariables | Ban variables that aren't blessed by your shop. | PPI::Token::Symbol | 5 | core, bugs ...
| Variables::RequireLexicalLoopIterators | Write C<for my $element (@list) {...}> instead of C<for $element (@list) {...}>. | PPI::Statement::Compound | 5 | core, pbp, bugs, certrec ...
+--------------------------------------------------+------------------------------------------------------------------------------------------------------------+---------------------------------+------------------+-----------------------------------...
=head2 List policies which have default severity between 4 and 5
% pcplist '--min-default-severity=4' '--max-default-severity=5' -l
+---------------------------------------------------------+------------------------------------------------------------------------------------------------------------+---------------------------------+------------------+----------------------------...
| name | abstract | applies_to | default_severity | default_themes ...
+---------------------------------------------------------+------------------------------------------------------------------------------------------------------------+---------------------------------+------------------+----------------------------...
| BuiltinFunctions::ProhibitSleepViaSelect | Use L<Time::HiRes|Time::HiRes> instead of something like C<select(undef, undef, undef, .05)>. | PPI::Token::Word | 5 | core, pbp, bugs ...
| BuiltinFunctions::ProhibitStringyEval | Write C<eval { my $foo; bar($foo) }> instead of C<eval "my $foo; bar($foo);">. | PPI::Token::Word | 5 | core, pbp, bugs, certrule ...
| BuiltinFunctions::RequireBlockGrep | Write C<grep { /$pattern/ } @list> instead of C<grep /$pattern/, @list>. | PPI::Token::Word | 4 | core, bugs, pbp ...
| BuiltinFunctions::RequireBlockMap | Write C<map { /$pattern/ } @list> instead of C<map /$pattern/, @list>. | PPI::Token::Word | 4 | core, bugs, pbp ...
| BuiltinFunctions::RequireGlobFunction | Use C<glob q{*}> instead of <*>. | PPI::Token::QuoteLike::Readline | 5 | core, pbp, bugs ...
| ClassHierarchies::ProhibitOneArgBless | Write C<bless {}, $class;> instead of just C<bless {};>. | PPI::Token::Word | 5 | core, pbp, bugs ...
| CodeLayout::RequireConsistentNewlines | Use the same newline through the source. | PPI::Document | 4 | core, bugs ...
| ControlStructures::ProhibitLabelsWithSpecialBlockNames | Don't use labels that are the same as the special block names. | PPI::Token::Label | 4 | core, bugs ...
| ControlStructures::ProhibitMutatingListFunctions | Don't modify C<$_> in list functions. | PPI::Token::Word | 5 | core, bugs, pbp, certrule ...
| ControlStructures::ProhibitUnreachableCode | Don't write code after an unconditional C<die, exit, or next>. | PPI::Token::Word | 4 | core, bugs, certrec ...
| ControlStructures::ProhibitYadaOperator | Never use C<...> in production code. | PPI::Token::Operator | 4 | core, pbp, maintenance ...
| InputOutput::ProhibitBarewordFileHandles | Write C<open my $fh, q{<}, $filename;> instead of C<open FH, q{<}, $filename;>. | PPI::Token::Word | 5 | core, pbp, bugs, certrec ...
| InputOutput::ProhibitExplicitStdin | Use "<>" or "<ARGV>" or a prompting module instead of "<STDIN>". | PPI::Token::QuoteLike::Readline | 4 | core, pbp, maintenance ...
| InputOutput::ProhibitInteractiveTest | Use prompt() instead of -t. | PPI::Token::Operator | 5 | core, pbp, bugs, certrule ...
| InputOutput::ProhibitOneArgSelect | Never write C<select($fh)>. | PPI::Token::Word | 4 | core, bugs, pbp, certrule ...
| InputOutput::ProhibitReadlineInForLoop | Write C<< while( $line = <> ){...} >> instead of C<< for(<>){...} >>. | PPI::Statement::Compound | 4 | core, bugs, pbp ...
| InputOutput::ProhibitTwoArgOpen | Write C<< open $fh, q{<}, $filename; >> instead of C<< open $fh, "<$filename"; >>. | PPI::Token::Word | 5 | core, pbp, bugs, security, ...
| InputOutput::RequireBriefOpen | Close filehandles as soon as possible after opening them. | PPI::Token::Word | 4 | core, pbp, maintenance ...
| InputOutput::RequireEncodingWithUTF8Layer | Write C<< open $fh, q{<:encoding(UTF-8)}, $filename; >> instead of C<< open $fh, q{<:utf8}, $filename; >>. | PPI::Token::Word | 5 | core, bugs, security ...
| Modules::ProhibitAutomaticExportation | Export symbols via C<@EXPORT_OK> or C<%EXPORT_TAGS> instead of C<@EXPORT>. | PPI::Document | 4 | core, bugs ...
| Modules::ProhibitEvilModules | Ban modules that aren't blessed by your shop. | PPI::Statement::Include | 5 | core, bugs, certrule ...
| Modules::ProhibitMultiplePackages | Put packages (especially subclasses) in separate files. | PPI::Document | 4 | core, bugs ...
| Modules::RequireBarewordIncludes | Write C<require Module> instead of C<require 'Module.pm'>. | PPI::Statement::Include | 5 | core, portability ...
| Modules::RequireEndWithOne | End each module with an explicitly C<1;> instead of some funky expression. | PPI::Document | 4 | core, bugs, pbp, certrule ...
| Modules::RequireExplicitPackage | Always make the C<package> explicit. | PPI::Document | 4 | core, bugs ...
| Modules::RequireFilenameMatchesPackage | Package declaration must match filename. | PPI::Document | 5 | core, bugs ...
| Objects::ProhibitIndirectSyntax | Prohibit indirect object call syntax. | PPI::Token::Word | 4 | core, pbp, maintenance, cer...
| Subroutines::ProhibitBuiltinHomonyms | Don't declare your own C<open> function. | PPI::Statement::Sub | 4 | core, bugs, pbp, certrule ...
| Subroutines::ProhibitExplicitReturnUndef | Return failure with bare C<return> instead of C<return undef>. | PPI::Token::Word | 5 | core, pbp, bugs, certrec ...
| Subroutines::ProhibitNestedSubs | C<sub never { sub correct {} }>. | PPI::Statement::Sub | 5 | core, bugs ...
| Subroutines::ProhibitReturnSort | Behavior of C<sort> is not defined if called in scalar context. | PPI::Token::Word | 5 | core, bugs, certrule ...
| Subroutines::ProhibitSubroutinePrototypes | Don't write C<sub my_function (@@) {}>. | PPI::Statement::Sub | 5 | core, pbp, bugs, certrec ...
| Subroutines::RequireArgUnpacking | Always unpack C<@_> first. | PPI::Statement::Sub | 4 | core, pbp, maintenance ...
| Subroutines::RequireFinalReturn | End every path through a subroutine with an explicit C<return> statement. | PPI::Statement::Sub | 4 | core, bugs, pbp, certrec ...
| TestingAndDebugging::ProhibitNoStrict | Prohibit various flavors of C<no strict>. | PPI::Statement::Include | 5 | core, pbp, bugs, certrec ...
| TestingAndDebugging::ProhibitNoWarnings | Prohibit various flavors of C<no warnings>. | PPI::Statement::Include | 4 | core, bugs, pbp, certrec ...
| TestingAndDebugging::ProhibitProlongedStrictureOverride | Don't turn off strict for large blocks of code. | PPI::Statement::Include | 4 | core, pbp, bugs, certrec ...
| TestingAndDebugging::RequireUseStrict | Always C<use strict>. | PPI::Document | 5 | core, pbp, bugs, certrule, ...
| TestingAndDebugging::RequireUseWarnings | Always C<use warnings>. | PPI::Document | 4 | core, pbp, bugs, certrule ...
| ValuesAndExpressions::ProhibitCommaSeparatedStatements | Don't use the comma operator as a statement separator. | PPI::Statement | 4 | core, bugs, pbp, certrule ...
| ValuesAndExpressions::ProhibitConstantPragma | Don't C<< use constant FOO => 15 >>. | PPI::Statement::Include | 4 | core, bugs, pbp ...
| ValuesAndExpressions::ProhibitLeadingZeros | Write C<oct(755)> instead of C<0755>. | PPI::Token::Number::Octal | 5 | core, pbp, bugs, certrec ...
| ValuesAndExpressions::ProhibitMixedBooleanOperators | Write C< !$foo && $bar || $baz > instead of C< not $foo && $bar or $baz>. | PPI::Statement | 4 | core, bugs, pbp, certrec ...
| Variables::ProhibitAugmentedAssignmentInDeclaration | Do not write C< my $foo .= 'bar'; >. | PPI::Statement::Variable | 4 | core, bugs ...
| Variables::ProhibitConditionalDeclarations | Do not write C< my $foo = $bar if $baz; >. | PPI::Statement::Variable | 5 | core, bugs ...
| Variables::ProhibitEvilVariables | Ban variables that aren't blessed by your shop. | PPI::Token::Symbol | 5 | core, bugs ...
| Variables::ProhibitFatCommaInDeclaration | Prohibit fat comma in declaration | PPI::Statement::Variable | 4 | core, bugs ...
| Variables::ProhibitMatchVars | Avoid C<$`>, C<$&>, C<$'> and their English equivalents. | PPI::Statement::Include | 4 | core, performance, pbp ...
| Variables::RequireLexicalLoopIterators | Write C<for my $element (@list) {...}> instead of C<for $element (@list) {...}>. | PPI::Statement::Compound | 5 | core, pbp, bugs, certrec ...
| Variables::RequireLocalizedPunctuationVars | Magic variables should be assigned as "local". | PPI::Token::Operator | 4 | core, pbp, bugs, certrec ...
| Variables::RequireNegativeIndices | Negative array index should be used. | PPI::Structure::Subscript | 4 | core, maintenance, pbp ...
+---------------------------------------------------------+------------------------------------------------------------------------------------------------------------+---------------------------------+------------------+----------------------------...
=head1 HOMEPAGE
Please visit the project's homepage at L<https://metacpan.org/release/App-PerlCriticUtils>.
=head1 SOURCE
Source repository is at L<https://github.com/perlancar/perl-App-PerlCriticUtils>.
=head1 AUTHOR
perlancar <perlancar@cpan.org>
=head1 CONTRIBUTING
To contribute, you can send patches by email/via RT, or send pull requests on
GitHub.
Most of the time, you don't need to build the distribution yourself. You can
simply modify the code, then test via:
( run in 0.539 second using v1.01-cache-2.11-cpan-6aa56a78535 )