7721a7b8d2
perlcritic -5 failed. Attempt to clean up to a higher level: -- use English to address use of $@ variable -- perltidy on the code -- substitute q{} for '' -- expand out single line hacky goodness (... s/\.pm$//) to more code -- remove parenthesis on functions that don't need it -- add x, s, and m as needed to regexps -- change double quotes to single quotes where no variable involved -- tweaked eval destroy test to check return value and use $EVAL_ERROR -- renamed $processor to $record_processor in the subtest to avoid lexical warnings TEST PLAN --------- $ perlcritic -5 t/RecordProcessor.t Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) $ perlcritic -2 t/RecordProcessor.t No package-scoped "$VERSION" variable found at line 1, column 1. See page 404 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 36. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 34, column 39. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 33. See page 53 of PBP. (Severity: 2) Quotes used with a string containing no non-whitespace characters at line 36, column 36. See page 53 of PBP. (Severity: 2) Don't modify $_ in list functions at line 43, column 25. See page 114 of PBP. (Severity: 5) Regular expression without "/s" flag at line 43, column 33. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 33. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 33. See page 237 of PBP. (Severity: 2) Regular expression without "/s" flag at line 43, column 66. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/x" flag at line 43, column 66. See page 236 of PBP. (Severity: 3) Regular expression without "/m" flag at line 43, column 66. See page 237 of PBP. (Severity: 2) Expression form of "grep" at line 47, column 8. See page 169 of PBP. (Severity: 4) Expression form of "grep" at line 50, column 20. See page 169 of PBP. (Severity: 4) Regular expression without "/s" flag at line 50, column 26. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/m" flag at line 50, column 26. See page 237 of PBP. (Severity: 2) Return value of eval not tested at line 73, column 1. You can't depend upon the value of $@/$EVAL_ERROR to tell whether an eval failed. (Severity: 3) Magic punctuation variable $@ used at line 78, column 5. See page 79 of PBP. (Severity: 2) Reused variable name in lexical scope: $processor at line 84, column 5. Invent unique variable names. (Severity: 3) Subroutine "new" called using indirect syntax at line 87, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 93, column 18. See page 349 of PBP. (Severity: 4) Quotes used with a string containing no non-whitespace characters at line 96, column 40. See page 53 of PBP. (Severity: 2) Subroutine "new" called using indirect syntax at line 99, column 18. See page 349 of PBP. (Severity: 4) Subroutine "new" called using indirect syntax at line 106, column 18. See page 349 of PBP. (Severity: 4) $ prove -v t/RecordProcessor.t t/RecordProcessor.t .. ok All tests successful. Files=1, Tests=13, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.22 cusr 0.02 csys = 0.25 CPU) Result: PASS $ prove -v t/RecordProcessor.t ... $ git bz apply 15871 Repeat perlcritic level 2, and only $VERSION warning should exist. Retest with the prove. Run koha qa test tools. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar> I don't really care about perlcritic as long as it involves changing '' into qw{} (WTF?) Anyway, I'd do this kind of things as we go, for example, if we were adding more tests. In that case it would just be a followup for this, after you provided a patch for an enh/bugfix. Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com> |
||
---|---|---|
.. | ||
Acquisition | ||
Biblio | ||
Budgets | ||
Circulation | ||
DataTables | ||
db_dependent | ||
External | ||
Koha/Plugin | ||
lib | ||
Members | ||
Number | ||
Search | ||
Serials | ||
00-checkdatabase-version.t | ||
00-deprecated.t | ||
00-load.t | ||
00-merge-conflict-markers.t | ||
00-testcritic.t | ||
00-valid-xml.t | ||
Auth_with_shibboleth.t | ||
AuthoritiesMarc_MARC21.t | ||
AuthoritiesMarc_UNIMARC.t | ||
AuthUtils.t | ||
Barcodes_annual.t | ||
Barcodes_EAN13.t | ||
Barcodes_hbyymmincr.t | ||
Barcodes_incremental.t | ||
Biblio.t | ||
Bookseller.t | ||
Boolean.t | ||
Branch.t | ||
Breeding.t | ||
Budgets.t | ||
Cache.t | ||
Calendar.t | ||
Charset.t | ||
Circulation_barcodedecode.t | ||
ClassSortRoutine.t | ||
ClassSortRoutine_Dewey.t | ||
ClassSortRoutine_Generic.t | ||
ClassSortRoutine_LCC.t | ||
ClassSource.t | ||
Context.t | ||
Contract.t | ||
Creators.t | ||
DateUtils.t | ||
Debug.t | ||
dummy.t | ||
External_Syndetics.t | ||
Form_MessagingPreferences.t | ||
Heading.t | ||
Images.t | ||
ImportBatch.t | ||
Installer_PerlDependencies.t | ||
Installer_PerlModules.t | ||
Installer_pm.t | ||
ItemCirculationAlertPreference.t | ||
Koha.t | ||
Koha_Email.t | ||
Koha_MetadataRecord.t | ||
Koha_Template_Plugin_Cache.t | ||
Koha_Template_Plugin_Koha.t | ||
Koha_Util_FrameworkPlugin.t | ||
Koha_Util_MARC.t | ||
Labels.t | ||
Labels_split_ccn.t | ||
Labels_split_ddcn.t | ||
Labels_split_lccn.t | ||
Languages.t | ||
Letters.t | ||
Log.t | ||
Logger.t | ||
Matcher.t | ||
Members_Attributes.t | ||
Members_AttributeTypes.t | ||
Members_Messaging.t | ||
Message.t | ||
NorwegianPatronDB.t | ||
OpenLibrarySearch.t | ||
Output.t | ||
Output_JSONStream.t | ||
Overdues.t | ||
Patron.t | ||
Patroncards.t | ||
Patroncards_Batch.t | ||
Patroncards_Layout.t | ||
Patroncards_Lib.t | ||
Patroncards_Patroncard.t | ||
Patroncards_Profile.t | ||
Patroncards_Template.t | ||
perlcriticrc | ||
Prices.t | ||
Print.t | ||
QueryParser.t | ||
RecordProcessor.t | ||
Review.t | ||
Ris.t | ||
RotatingCollections.t | ||
Scheduler.t | ||
Scrubber.t | ||
Search.t | ||
Search_PazPar2.t | ||
SimpleMARC.t | ||
SIP_Sip.t | ||
smolder_smoke_signal | ||
SMS.t | ||
SocialData.t | ||
Stats.t | ||
SuggestionEngine.t | ||
SuggestionEngine_AuthorityFile.t | ||
TmplToken.t | ||
XSLT.t |