I saw a very ugly Perl code, and I think that is possible because no code review exist in project. But always we have a very little time for human code review. I search CPAN modules for basic level code review by machine. I hope that these modules help Perl people to avoid writing ugly code and help team leaders minimize time to code review. I try to collect founded modules in github repository and now want to describe what we know if all these test passed:
- Module have valid syntax and have strict and warnings pragmas - thanks to Test::Strict
- Module have only unix line endings and not have whitespaces in the end of line - thanks to Test::EOL
- Module have no FIXME notes - thanks to Test::Fixme
- Module have no soft breakpoints for perl debugger - thanks to Test::NoBreakpoints
- Module have no tabs - thanks to Test::NoTabs
- Module distribution looks good to upload to cpan - thanks to Test::Kwalitee
- Code units in module have required cyclomatic complexity and required lines of code - thanks to Perl::Metrics::Simple. I try to use Test::Perl::Metrics::Simple, but got problem with installing and write my own test.
- Module code is conform to Perl Best Practice recommendation from Perl::Critic - thanks to Test::Perl::Critic
- Module has POD and it is valid - thanks to Test::Pod
- POD cover all methods - thanks to Test::Pod::Coverage
- POD is written on valid human language - thanks Test::Spelling
- The tests written for module cover needed percent of code - thanks to Test::Strict and Devel::Cover
- Module has no memory leaks - thanks to Test::Weaken - this test is non functional, but because it is not universal (if we add method we must add test) I move it to 't' directory with functional tests
That I not found:
- Test for depth of conditional nesting code metric
- Test for code style - I found Test::PerlTidy, but it have some bugs, I wrote to author, he said than plan fix it
I try to collect maximum non-functional test collection - you can use that you need only. I hope that it post will be useful for somebody and I will be glad any comments.
Sorry, if my English is not good.