Summary: | $stemmed_operand in C4::Search _build_stemmed_operand is not initialized. | ||
---|---|---|---|
Product: | Koha | Reporter: | Mark Tompsett <mtompset> |
Component: | Searching | Assignee: | Mark Tompsett <mtompset> |
Status: | CLOSED FIXED | QA Contact: | Mason James <mtj> |
Severity: | normal | ||
Priority: | P5 - low | CC: | chris, kyle, mtj, paul.poulain |
Version: | 3.8 | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
Initialized $stemmed_operand to q{} (perl critic friendly empty string)
Bug 8458 - $stemmed_operand in C4::Search _build_stemmed_operand is not initialized. Added =q{} to initialize it to the empty string at declaration time. |
Description
Mark Tompsett
2012-07-17 12:42:56 UTC
Created attachment 10890 [details] [review] Initialized $stemmed_operand to q{} (perl critic friendly empty string) perlcritic does not report this as a PBP violation. Running perlcritic on C4/Search.pm in master results in: C4/Search.pm source OK PBP does recommend using my $string = q{}; instead of my $string = ""; or my $string = ''; but does not make a judgement on my $string; I believe this rule applies to re-initializing a previously used variable to an empty string, no initializing it to begin with. This is a valid bug. The perlcritic friendly bit is using q{} instead of ''. I'm guessing that the point of this bug is that the variable is concatenated with itself, even though it is undef, which will result in a warning. In that case, I see how this is a valid bug, but the description of the bug did not describe that. Created attachment 10910 [details] [review] Bug 8458 - $stemmed_operand in C4::Search _build_stemmed_operand is not initialized. Added =q{} to initialize it to the empty string at declaration time. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> (In reply to comment #5) > Created attachment 10910 [details] [review] > Bug 8458 - $stemmed_operand in C4::Search _build_stemmed_operand is not > initialized. Added =q{} to initialize it to the empty string at declaration > time. > > Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> passing QA, nice spotting! ------------ $ koha-qa.pl - d0ec5cf Bug 8458 - $stemmed_operand in C4::Search _build_stemmed_operand is not initialized. Added =q{} to initialize it to the empty string at declaration time. C4/Search.pm - perlcritic-progressive tests... OK - perl -c syntax tests... OK Pushed to 3.8.x will be in 3.8.4 |