Bugzilla – Attachment 45270 Details for
Bug 15258
Prevent unused declared variables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15258: Fix Perl scripts declaring unused variables
Bug-15258-Fix-Perl-scripts-declaring-unused-variab.patch (text/plain), 19.79 KB, created by
Jonathan Druart
on 2015-12-01 14:47:25 UTC
(
hide
)
Description:
Bug 15258: Fix Perl scripts declaring unused variables
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-12-01 14:47:25 UTC
Size:
19.79 KB
patch
obsolete
>From a059d4901d4113367b13f669c01db7debea230ef Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Thu, 26 Nov 2015 08:26:34 +0100 >Subject: [PATCH] Bug 15258: Fix Perl scripts declaring unused variables > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/SIP/Sip/MsgType.pm | 4 ++-- > Koha/MetaSearcher.pm | 1 - > Koha/QueryParser/Driver/PQF/Util.pm | 1 - > Koha/QueryParser/Driver/PQF/query_plan/modifier.pm | 1 - > Koha/Template/Plugin/Price.pm | 1 - > acqui/basketheader.pl | 1 - > acqui/invoice.pl | 1 - > acqui/spent.pl | 1 - > admin/aqplan.pl | 5 ----- > admin/auth_subfields_structure.pl | 1 - > admin/koha2marclinks.pl | 1 - > admin/transport-cost-matrix.pl | 2 +- > basket/basket.pl | 1 - > catalogue/MARCdetail.pl | 1 - > catalogue/search.pl | 2 -- > cataloguing/addbiblio.pl | 3 --- > cataloguing/merge.pl | 1 - > cataloguing/value_builder/macles.pl | 4 +--- > cataloguing/value_builder/marc21_linking_section.pl | 1 - > cataloguing/value_builder/unimarc_field_4XX.pl | 1 - > circ/branchtransfers.pl | 1 - > circ/pendingreserves.pl | 13 ------------- > circ/waitingreserves.pl | 2 -- > labels/label-item-search.pl | 4 ++-- > members/moremember.pl | 2 -- > reserve/placerequest.pl | 1 - > reserve/request.pl | 3 --- > serials/checkexpiration.pl | 1 - > serials/subscription-add.pl | 2 -- > sms/sms_listen.pl | 2 -- > 30 files changed, 6 insertions(+), 59 deletions(-) > >diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm >index 1e06a19..dd799a8 100644 >--- a/C4/SIP/Sip/MsgType.pm >+++ b/C4/SIP/Sip/MsgType.pm >@@ -310,7 +310,7 @@ sub new { > > sub _initialize { > my ($self, $msg, $control_block) = @_; >- my ($fs, $fn, $fe); >+ my $fn; > my $proto = $control_block->{protocol}->{$protocol_version}; > > $self->{name} = $control_block->{name}; >@@ -931,7 +931,7 @@ sub handle_patron_info { > my ($lang, $trans_date, $summary) = @{$self->{fixed_fields}}; > my $fields = $self->{fields}; > my ($inst_id, $patron_id, $terminal_pwd, $patron_pwd, $start, $end); >- my ($resp, $patron, $count); >+ my ($resp, $patron); > > $inst_id = $fields->{(FID_INST_ID)}; > $patron_id = $fields->{(FID_PATRON_ID)}; >diff --git a/Koha/MetaSearcher.pm b/Koha/MetaSearcher.pm >index 7c4c87a..e38b15d 100644 >--- a/Koha/MetaSearcher.pm >+++ b/Koha/MetaSearcher.pm >@@ -106,7 +106,6 @@ sub search { > }; > my $start = clock_gettime( CLOCK_MONOTONIC ); > my $select = IO::Select->new; >- my @worker_fhs; > > my @cached_sets; > my @servers; >diff --git a/Koha/QueryParser/Driver/PQF/Util.pm b/Koha/QueryParser/Driver/PQF/Util.pm >index af3c81b..99e36f0 100644 >--- a/Koha/QueryParser/Driver/PQF/Util.pm >+++ b/Koha/QueryParser/Driver/PQF/Util.pm >@@ -41,7 +41,6 @@ Convert a hashref with a Bib-1 mapping into its PQF string representation. > sub attributes_to_attr_string { > my ($attributes) = @_; > my $attr_string = ''; >- my $value; > foreach my $key ( sort keys %{$attributes} ) { > next unless looks_like_number($key); > $attr_string .= ' @attr ' . $key . '=' . $attributes->{ $key } . ' '; >diff --git a/Koha/QueryParser/Driver/PQF/query_plan/modifier.pm b/Koha/QueryParser/Driver/PQF/query_plan/modifier.pm >index 7577bc4..bf34e72 100644 >--- a/Koha/QueryParser/Driver/PQF/query_plan/modifier.pm >+++ b/Koha/QueryParser/Driver/PQF/query_plan/modifier.pm >@@ -41,7 +41,6 @@ not have a reference to their parent query_plan. > sub target_syntax { > my ($self, $server, $query_plan) = @_; > my $pqf = ''; >- my @fields; > > my $attributes = $query_plan->QueryParser->bib1_mapping_by_name('modifier', $self->name, $server); > $pqf = ($attributes->{'op'} ? $attributes->{'op'} . ' ' : '') . ($self->negate ? '@not @attr 1=_ALLRECORDS @attr 2=103 "" ' : '') . $attributes->{'attr_string'}; >diff --git a/Koha/Template/Plugin/Price.pm b/Koha/Template/Plugin/Price.pm >index 807f301..44f7cd8 100644 >--- a/Koha/Template/Plugin/Price.pm >+++ b/Koha/Template/Plugin/Price.pm >@@ -29,7 +29,6 @@ sub filter { > my ( $self, $value, $args, $config ) = @_; > $value ||= 0; > $config->{on_editing} //= 0; >- my $formatted_price; > return $config->{on_editing} > ? Koha::Number::Price->new( $value )->format_for_editing > : Koha::Number::Price->new( $value )->format; >diff --git a/acqui/basketheader.pl b/acqui/basketheader.pl >index 18090c4..a4ef0b9 100755 >--- a/acqui/basketheader.pl >+++ b/acqui/basketheader.pl >@@ -129,7 +129,6 @@ if ( $op eq 'add_form' ) { > my $deliveryplace = $basket->{'deliveryplace'} || C4::Context->userenv->{"branch"}; > > # Build the combobox to select the billing place >- my @billingplaceloop; > > my $branches = C4::Branch::GetBranchesLoop( $billingplace ); > $template->param( billingplaceloop => $branches ); >diff --git a/acqui/invoice.pl b/acqui/invoice.pl >index f56afcc..d2f649d 100755 >--- a/acqui/invoice.pl >+++ b/acqui/invoice.pl >@@ -112,7 +112,6 @@ my $details = GetInvoiceDetails($invoiceid); > my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $details->{booksellerid} }); > my @orders_loop = (); > my $orders = $details->{'orders'}; >-my $qty_total; > my @foot_loop; > my %foot; > my $total_quantity = 0; >diff --git a/acqui/spent.pl b/acqui/spent.pl >index 4d60029..d32f0c9 100755 >--- a/acqui/spent.pl >+++ b/acqui/spent.pl >@@ -89,7 +89,6 @@ if ( $sth->err ) { > die "An error occurred fetching records: " . $sth->errstr; > } > my $subtotal = 0; >-my $toggle; > my @spent; > while ( my $data = $sth->fetchrow_hashref ) { > my $recv = $data->{'quantityreceived'}; >diff --git a/admin/aqplan.pl b/admin/aqplan.pl >index d0b11a2..74060e8 100755 >--- a/admin/aqplan.pl >+++ b/admin/aqplan.pl >@@ -85,7 +85,6 @@ $template->param( > my $borrower_id = $template->{VARS}->{'USER_INFO'}[0]->{'borrowernumber'}; > my $borrower_branchcode = $template->{VARS}->{'USER_INFO'}[0]->{'branchcode'}; > >-my $periods; > my $authcat = $input->param('authcat'); > my $show_active = $input->param('show_active'); > my $show_actual = $input->param('show_actual'); >@@ -107,8 +106,6 @@ $authcat = 'Asort1' if not defined $authcat; # defaults to Asort if no authcat > my $budget_id = $input->param('budget_id'); > my $op = $input->param("op"); > >-my $budget_branchcode; >- > my $budgets_ref = GetBudgetHierarchy( $budget_period_id, $show_mine?$template->{VARS}->{'USER_INFO'}[0]->{'branchcode'}:'', $show_mine?$template->{VARS}->{'USER_INFO'}[0]->{'borrowernumber'}:'' ); > > # build categories list >@@ -140,7 +137,6 @@ $template->param( authcat_dropbox => { > }); > > my @budgets = @$budgets_ref; >-my $CGISort; > my @authvals; > my %labels; > >@@ -160,7 +156,6 @@ if ( $op eq 'save' ) { > my %seen; > @buds = grep { !$seen{$_}++ } @buds; > @auth_values = grep { !$seen{$_}++ } @auth_values; >- my @budget_ids; > my @budget_lines; > > foreach my $budget (@buds) { >diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl >index 6a960f2..321a337 100755 >--- a/admin/auth_subfields_structure.pl >+++ b/admin/auth_subfields_structure.pl >@@ -273,7 +273,6 @@ if ($op eq 'add_form') { > my @kohafield = ''.$input->param('kohafield'); > my @tab = $input->param('tab'); > my @seealso = $input->param('seealso'); >- my @hidden; > my @ohidden = $input->param('ohidden'); > #my @ihidden = $input->param('ihidden'); > #my @ehidden = $input->param('ehidden'); >diff --git a/admin/koha2marclinks.pl b/admin/koha2marclinks.pl >index 8ba6b1c..9ccca37 100755 >--- a/admin/koha2marclinks.pl >+++ b/admin/koha2marclinks.pl >@@ -64,7 +64,6 @@ my $cache = Koha::Cache->get_instance(); > ################## ADD_FORM ################################## > # called by default. Used to create form to add or modify a record > if ( $op eq 'add_form' ) { >- my $data; > my $sth = > $dbh->prepare( > "select tagfield,tagsubfield,liblibrarian as lib,tab from marc_subfield_structure where kohafield=? AND frameworkcode=''" >diff --git a/admin/transport-cost-matrix.pl b/admin/transport-cost-matrix.pl >index 3197306..a041e78 100755 >--- a/admin/transport-cost-matrix.pl >+++ b/admin/transport-cost-matrix.pl >@@ -55,7 +55,7 @@ my @branchloop = map { code => $_, > name => $branches->{$_}->{'branchname'} }, > sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } > keys %$branches; >-my (@branchfromloop, @cost, @errors); >+my (@branchfromloop, @errors); > foreach my $branchfrom ( @branchloop ) { > my $fromcode = $branchfrom->{code}; > >diff --git a/basket/basket.pl b/basket/basket.pl >index d7662dd..1dfbdb8 100755 >--- a/basket/basket.pl >+++ b/basket/basket.pl >@@ -84,7 +84,6 @@ foreach my $biblionumber ( @bibs ) { > } > } > # COinS format FIXME: for books Only >- my $coins_format; > my $fmt = substr $record->leader(), 6,2; > my $fmts; > $fmts->{'am'} = 'book'; >diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl >index 3462b7d..0aff184 100755 >--- a/catalogue/MARCdetail.pl >+++ b/catalogue/MARCdetail.pl >@@ -130,7 +130,6 @@ foreach my $thisframeworkcode ( keys %$frameworks ) { > $template->param( frameworkcodeloop => \@frameworkcodeloop, ); > # fill arrays > my @loop_data = (); >-my $tag; > > # loop through each tab 0 through 9 > for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { >diff --git a/catalogue/search.pl b/catalogue/search.pl >index e74ceca..9597ad7 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -484,7 +484,6 @@ my $expanded_facet = $params->{'expand'}; > # Define some global variables > my ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type); > >-my @results; > > ## I. BUILD THE QUERY > ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by,$scan,$lang); >@@ -526,7 +525,6 @@ $template->param ( LIMIT_INPUTS => \@limit_inputs ); > ## II. DO THE SEARCH AND GET THE RESULTS > my $total; # the total results for the whole set > my $facets; # this object stores the faceted results that display on the left-hand of the results page >-my @results_array; > my $results_hashref; > > eval { >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index b4784ed..b6805c9 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -178,7 +178,6 @@ sub build_authorized_values_list { > && !C4::Context->IsSuperLibrarian() > && C4::Context->userenv->{branch}; > my $branches = GetBranches($onlymine); >- my @branchloop; > foreach my $thisbranch ( sort keys %$branches ) { > push @authorised_values, $thisbranch; > $authorised_lib{$thisbranch} = $branches->{$thisbranch}->{'branchname'}; >@@ -777,7 +776,6 @@ my ( > $biblionumbertagsubfield, > $biblioitemnumtagfield, > $biblioitemnumtagsubfield, >- $bibitem, > $biblioitemnumber > ); > >@@ -845,7 +843,6 @@ if ( $op eq "addbiblio" ) { > my $confirm_not_duplicate = $input->param('confirm_not_duplicate'); > # it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate) > if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { >- my $oldbibnum; > my $oldbibitemnum; > if (C4::Context->preference("BiblioAddsAuthorities")){ > BiblioAutoLink( $record, $frameworkcode ); >diff --git a/cataloguing/merge.pl b/cataloguing/merge.pl >index a1e56be..490eaa1 100755 >--- a/cataloguing/merge.pl >+++ b/cataloguing/merge.pl >@@ -121,7 +121,6 @@ if ($merge) { > my @marcfields = $marcrecord->field($field->{tag}); > foreach my $marcfield (@marcfields) { > my $tag = $marcfield->tag(); >- my %subfields; > if (scalar @{$field->{subfields}}) { > foreach my $subfield (@{$field->{subfields}}) { > my @values = $marcfield->subfield($subfield); >diff --git a/cataloguing/value_builder/macles.pl b/cataloguing/value_builder/macles.pl >index bab687b..c37b6a0 100755 >--- a/cataloguing/value_builder/macles.pl >+++ b/cataloguing/value_builder/macles.pl >@@ -51,7 +51,6 @@ return ($function_name,$res); > > sub plugin { > my ($input) = @_; >- my %env; > > # my $input = new CGI; > my $index= $input->param('index'); >@@ -62,8 +61,7 @@ my ($input) = @_; > #tabs > $rq->execute; > my @BIGLOOP; >- my @innerloop; >- my (%numbers,%cells,@colhdr,@rowhdr,@multiplelines,@lists,$table); >+ my (%numbers,@lists,$table); > while (my $tab = $rq->fetchrow_hashref){ > my $number=substr($tab->{authorised_value},0,1); > if ($tab->{authorised_value}=~/[0-9]XX/){ >diff --git a/cataloguing/value_builder/marc21_linking_section.pl b/cataloguing/value_builder/marc21_linking_section.pl >index 13f3a64..bcb9624 100644 >--- a/cataloguing/value_builder/marc21_linking_section.pl >+++ b/cataloguing/value_builder/marc21_linking_section.pl >@@ -64,7 +64,6 @@ my $launcher = sub { > $startfrom = 0 if ( !defined $startfrom ); > my ( $template, $loggedinuser, $cookie ); > my $resultsperpage; >- my $searchdesc; > > if ( $op eq "fillinput" ) { > my $biblionumber = $query->param('biblionumber'); >diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl >index a378618..3fba406 100755 >--- a/cataloguing/value_builder/unimarc_field_4XX.pl >+++ b/cataloguing/value_builder/unimarc_field_4XX.pl >@@ -68,7 +68,6 @@ sub plugin { > $startfrom = 0 if ( !defined $startfrom ); > my ( $template, $loggedinuser, $cookie ); > my $resultsperpage; >- my $searchdesc; > > if ( $op eq "fillinput" ) { > my $biblionumber = $query->param('biblionumber'); >diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl >index 4caca05..9d761cd 100755 >--- a/circ/branchtransfers.pl >+++ b/circ/branchtransfers.pl >@@ -106,7 +106,6 @@ elsif ( $request eq 'KillReserved' ) { > > # collect the stack of books already transfered so they can printed... > my @trsfitemloop; >-my %transfereditems; > my $transfered; > my $barcode = $query->param('barcode'); > # strip whitespace >diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl >index 4d6ec05..9e811da 100755 >--- a/circ/pendingreserves.pl >+++ b/circ/pendingreserves.pl >@@ -53,19 +53,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >-my $duedate; >-my $borrowernumber; >-my $itemnum; >-my $data1; >-my $data2; >-my $data3; >-my $name; >-my $phone; >-my $email; >-my $biblionumber; >-my $title; >-my $author; >- > my $today = dt_from_string; > $startdate =~ s/^\s+//; > $startdate =~ s/\s+$//; >diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl >index 3e1b5c2..aff5df7 100755 >--- a/circ/waitingreserves.pl >+++ b/circ/waitingreserves.pl >@@ -47,8 +47,6 @@ my $tbr = $input->param('tbr') || ''; > my $all_branches = $input->param('allbranches') || ''; > my $cancelall = $input->param('cancelall'); > >-my $cancel; >- > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { > template_name => "circ/waitingreserves.tt", >diff --git a/labels/label-item-search.pl b/labels/label-item-search.pl >index 9bbfa60..8b72cb4 100755 >--- a/labels/label-item-search.pl >+++ b/labels/label-item-search.pl >@@ -53,7 +53,7 @@ my $ccl_query = $query->param('ccl_query'); > my $startfrom = $query->param('startfrom') || 1; > my ($template, $loggedinuser, $cookie) = (undef, undef, undef); > my ( >- $total_hits, $orderby, $results, $total, $error, >+ $total_hits, $total, $error, > $marcresults, $idx, $datefrom, $dateto, $ccl_textbox > ); > my $resultsperpage = C4::Context->preference('numSearchResults') || '20'; >@@ -174,7 +174,7 @@ if ($show_results) { > ); > > # build page nav stuff. >- my ( @field_data, @numbers ); >+ my @numbers; > $total = $total_hits; > > my ( $from, $to, $startfromnext, $startfromprev, $displaynext, >diff --git a/members/moremember.pl b/members/moremember.pl >index 688215b..6198d87 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -154,7 +154,6 @@ if ( IsDebarred($borrowernumber) ) { > > $data->{ "sex_".$data->{'sex'}."_p" } = 1 if defined $data->{sex}; > >-my $catcode; > if ( $category_type eq 'C') { > my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); > my $cnt = scalar(@$catcodes); >@@ -252,7 +251,6 @@ my $relatives_issues_count = > my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ); > my $today = DateTime->now( time_zone => C4::Context->tz); > $today->truncate(to => 'day'); >-my @borrowers_with_issues; > my $overdues_exist = 0; > my $totalprice = 0; > >diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl >index 6cbaa7b..80dcfdc 100755 >--- a/reserve/placerequest.pl >+++ b/reserve/placerequest.pl >@@ -92,7 +92,6 @@ if ($type eq 'str8' && $borrower){ > $i2++; > } > } >- my $const; > > if (defined $checkitem && $checkitem ne ''){ > my $item = GetItem($checkitem); >diff --git a/reserve/request.pl b/reserve/request.pl >index 80cf0d6..14715f5 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -47,7 +47,6 @@ use Koha::DateUtils; > use Koha::Borrower::Debarments qw(IsDebarred); > > my $dbh = C4::Context->dbh; >-my $sth; > my $input = new CGI; > my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( > { >@@ -140,7 +139,6 @@ if ($multihold) { > if ($borrowernumber_hold && !$action) { > my $borrowerinfo = GetMember( borrowernumber => $borrowernumber_hold ); > my $diffbranch; >- my @getreservloop; > > # we check the reserves of the borrower, and if he can reserv a document > # FIXME At this time we have a simple count of reservs, but, later, we could improve the infos "title" ... >@@ -283,7 +281,6 @@ foreach my $biblionumber (@biblionumbers) { > # adding a fixed value for priority options > my $fixedRank = $count+1; > >- my @branchcodes; > my %itemnumbers_of_biblioitem; > my @itemnumbers; > >diff --git a/serials/checkexpiration.pl b/serials/checkexpiration.pl >index 3222e22..9f1ff14 100755 >--- a/serials/checkexpiration.pl >+++ b/serials/checkexpiration.pl >@@ -113,7 +113,6 @@ if ($date) { > ); > } > >-my $branchname; > my $branches_loop; > if ( !C4::Context->preference("IndependentBranches") > or C4::Context->IsSuperLibrarian() >diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl >index 1790866..7525b59 100755 >--- a/serials/subscription-add.pl >+++ b/serials/subscription-add.pl >@@ -42,7 +42,6 @@ my $op = $query->param('op') || ''; > my $dbh = C4::Context->dbh; > my $sub_length; > >-my @budgets; > > # Permission needed if it is a modification : edit_subscription > # Permission needed otherwise (nothing or dup) : create_subscription >@@ -437,7 +436,6 @@ sub redirect_mod_subscription { > > sub insert_additional_fields { > my ( $additional_fields, $biblionumber, $subscriptionid ) = @_; >- my @additional_field_values; > my $record = GetMarcBiblio( $biblionumber, 1 ); > for my $field ( @$additional_fields ) { > my $af = Koha::AdditionalField->new({ id => $field->{id} })->fetch; >diff --git a/sms/sms_listen.pl b/sms/sms_listen.pl >index a7420d9..0ee3f53 100755 >--- a/sms/sms_listen.pl >+++ b/sms/sms_listen.pl >@@ -10,9 +10,7 @@ use C4::Members; > use C4::Circulation; > > my ($res,$ua); >-my %commands; > my $message; >-my $phone; > my $result; > my $errorcode; > my $smsid; >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15258
:
45177
|
45178
|
45179
|
45232
|
45233
|
45234
|
45235
|
45236
| 45270 |
45271