[Koha-bugs] [Bug 30110] New: Potential bug source: plenty of "my" declarations with conditional assignments

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Feb 15 14:48:06 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30110

            Bug ID: 30110
           Summary: Potential bug source: plenty of "my" declarations with
                    conditional assignments
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: nugged at gmail.com
        QA Contact: testopia at bugs.koha-community.org
                CC: jonathan.druart+koha at gmail.com

We have a lot of these things like "my $var .= ...", what is shouldn't be (if
no var before "my" so why conditional assignments?) - this looks like
refactoring remnants since old times, here I found some to analyze (and fix):


C4/Circulation.pm:
  859:         my $guarantors_non_issues_charges +=
$patron->relationships_debt({ include_guarantors => 1, only_this_guarantor =>
0, include_this_patron => 1 });

C4/Message.pm:
  165:     my $format ||= sub { $_[0] || "" };

C4/Search.pm:
  891:     my $weighted_query .= "(rk=(";    # Specifies that we're applying
rank

C4/Utils/DataTables/VirtualShelves.pm:
   47:         my $join_vs .= q|

circ/circulation.pl:
  477:         my $guarantors_non_issues_charges +=
$patron->relationships_debt({ include_guarantors => 1, only_this_guarantor =>
0, include_this_patron => 1 });

Koha/DateUtils.pm:
  146:     my $time_re .= qr|

t/Labels_split_ccn.t:
   41:         my $split_num += scalar(@{$ccns->{$_}});

t/Labels_split_ddcn.t:
   40:         my $split_num += scalar(@{$ddcns->{$_}});

t/Labels_split_lccn.t:
   43:         my $split_num += scalar(@{$lccns->{$_}});

t/db_dependent/SIP/Message.t:
  127:     my $resp .= C4::SIP::Sip::maybe_add( FID_CALL_NUMBER,
$sip_item->hold_patron_name, $server );
  840:     my $resp .= C4::SIP::Sip::maybe_add( FID_CALL_NUMBER,
$sip_item->hold_patron_bcode, $server );

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list