[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Perl::Critic Tests



On 2017-04-15 03:27, David G wrote:
> Personally, I'd start with the Policies with the highest count, and
> work down through the list from there.

I follow your logic, but argue for the reverse.

To my mind we should aim to get as many policies in place as soon as 
possible. Fixing the policies with fewest violations first allows us to 
add policies to the tests sooner, meaning new code is better tested.

A rough check suggests we can add 18 or so of the CERT policies now, 
without failing tests, so I will prepare a patch to do so.


On 2017-04-14 20:09, Erik Huelsmann wrote:
> For old code, I'm definitely interested to see the violations as well.
> However, we may not be able to fix all of them.

Here's stats for the "old" code. Fixable I'd say, but I think getting 
"new" code up to standard should be the first priority.

"old" code:
Total Violations: 3013
Perl::Critic::Policy::Subroutines::RequireFinalReturn: 799
Perl::Critic::Policy::InputOutput::RequireCheckedSyscalls: 677
Perl::Critic::Policy::ValuesAndExpressions::ProhibitMagicNumbers: 304
Perl::Critic::Policy::Variables::RequireLexicalLoopIterators: 213
Perl::Critic::Policy::Modules::RequireVersionVar: 205
Perl::Critic::Policy::ErrorHandling::RequireCarping: 142
Perl::Critic::Policy::Variables::RequireLocalizedPunctuationVars: 104
Perl::Critic::Policy::Modules::RequireBarewordIncludes: 72
Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms: 46
Perl::Critic::Policy::ValuesAndExpressions::ProhibitMixedBooleanOperators: 
43
Perl::Critic::Policy::Subroutines::ProhibitUnusedPrivateSubroutines: 36
Perl::Critic::Policy::TestingAndDebugging::RequireUseWarnings: 35
Perl::Critic::Policy::Objects::ProhibitIndirectSyntax: 35
Perl::Critic::Policy::TestingAndDebugging::RequireUseStrict: 34
Perl::Critic::Policy::RegularExpressions::ProhibitCaptureWithoutTest: 34
Perl::Critic::Policy::Modules::RequireFilenameMatchesPackage: 31
Perl::Critic::Policy::Variables::RequireInitializationForLocalVars: 26
Perl::Critic::Policy::Modules::RequireEndWithOne: 22
Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef: 21
Perl::Critic::Policy::InputOutput::ProhibitBarewordFileHandles: 14
Perl::Critic::Policy::InputOutput::RequireCheckedClose: 12
Perl::Critic::Policy::Subroutines::ProtectPrivateSubs: 12
Perl::Critic::Policy::Variables::ProhibitUnusedVariables: 12
Perl::Critic::Policy::InputOutput::RequireCheckedOpen: 11
Perl::Critic::Policy::InputOutput::RequireEncodingWithUTF8Layer: 10
Perl::Critic::Policy::TestingAndDebugging::ProhibitNoWarnings: 10
Perl::Critic::Policy::ValuesAndExpressions::ProhibitMismatchedOperators: 
9
Perl::Critic::Policy::BuiltinFunctions::ProhibitStringyEval: 7
Perl::Critic::Policy::Modules::ProhibitEvilModules: 6
Perl::Critic::Policy::BuiltinFunctions::ProhibitBooleanGrep: 5
Perl::Critic::Policy::ValuesAndExpressions::ProhibitCommaSeparatedStatements: 
4
Perl::Critic::Policy::BuiltinFunctions::ProhibitStringySplit: 4
Perl::Critic::Policy::BuiltinFunctions::ProhibitUniversalIsa: 3
Perl::Critic::Policy::TestingAndDebugging::ProhibitNoStrict: 3
Perl::Critic::Policy::Variables::ProhibitConditionalDeclarations: 3
Perl::Critic::Policy::ControlStructures::ProhibitUnreachableCode: 3
Perl::Critic::Policy::Modules::ProhibitConditionalUseStatements: 2
Perl::Critic::Policy::Modules::ProhibitExcessMainComplexity: 2
Perl::Critic::Policy::Modules::ProhibitMultiplePackages: 2


On 2017-04-14 21:47, R. Ransbottom wrote:
> I can help silence the P::C beast.  Let me know.

Fabulous! Maybe we can share out the policies between us and anyone else 
who is willing to help?



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel