TT#29909 fix perlcritic RequireUseStrict

by using strict where it wasn't used before
plus fix all bugs that were discovered along the way by enabling strict

Change-Id: I7f9a8bf0cee74014fd7551ec26f2ab3922715efc
changes/87/18887/2
Gerhard Jungwirth 7 years ago
parent 00633d1618
commit 985d433900

@ -1,3 +1,6 @@
use warnings;
use strict;
use lib 'inc';
use Local::Module::Build;

@ -1,5 +1,8 @@
package NGCP::Panel::Block::Block;
use warnings;
use strict;
use Template;
sub new {

@ -1,5 +1,8 @@
package NGCP::Panel::Block::Contract::ProfileMappingsList;
use warnings;
use strict;
use parent ("NGCP::Panel::Block::Block");
sub template {

@ -1,5 +1,8 @@
package NGCP::Panel::Block::Contract::ProfileMappingsTimeline;
use warnings;
use strict;
use parent ("NGCP::Panel::Block::Block");
sub template {

@ -1,5 +1,8 @@
package NGCP::Panel::Block::Contract::ProfileNetworkMappings;
use warnings;
use strict;
use parent ("NGCP::Panel::Block::Block");
sub template {

@ -1,4 +1,8 @@
package NGCP::Panel::Controller::API::MetaConfigDefs;
use warnings;
use strict;
use NGCP::Panel::Utils::Generic qw(:all);
use boolean qw(true);
use Data::HAL qw();

@ -1,4 +1,8 @@
package NGCP::Panel::Form;
use warnings;
use strict;
use Module::Load::Conditional qw/can_load/;
my %forms = ();

@ -1,4 +1,8 @@
package NGCP::Panel::Template::Plugin::DeviceConfig;
use warnings;
use strict;
use parent 'Template::Plugin';
use Crypt::RC4;

@ -1,5 +1,8 @@
package NGCP::Panel::Utils::DeviceFirmware;
use warnings;
use strict;
use English;
sub insert_firmware_data {

@ -1,5 +1,8 @@
package NGCP::Panel::Utils::Fax;
use warnings;
use strict;
use English;
use File::Temp qw/tempfile/;
use File::Slurp;
@ -76,7 +79,7 @@ sub send_fax {
my $client = new NGCP::Fax;
use Data::Dumper;
$c->log->debug('invoke send_fax with args: ' . Dumper(\%sendfax_args));
$client->send_fax(\%sendfax_args);
my $res = $client->send_fax(\%sendfax_args);
$c->log->debug("webfax: res=$res;");
}
@ -120,9 +123,10 @@ sub get_fax {
return unless $filepath;
} else {
if ($format) {
($tmp_fh, $filepath) =
File::Temp::tempfile( DIR => $cfg->{spool_dir}."/tmp")
or $self->error("Cannot create temp file: $ERRNO");
unless ( ($tmp_fh, $filepath) = File::Temp::tempfile( DIR => $c->config->{faxserver}{spool_dir}."/tmp") ) {
$c->log->error("Cannot create temp file: $ERRNO");
return;
}
binmode $tmp_fh;
close $tmp_fh;
print $tmp_fh $item->voip_fax_data->data;
@ -167,7 +171,7 @@ sub process_fax_journal_item {
my $dst_sub = $result->callee_subscriber // undef; #undef, if not local, or if callee is username
#try finding it:
unless ($dst_sub) {
my $dst_src_sub = $c->model('DB')->resultset('provisioning_voip_subscribers')->search({
my $prov_dst_sub = $c->model('DB')->resultset('provisioning_voip_subscribers')->search({
'username' => $result->callee,
})->first();
if ($prov_dst_sub) {

@ -1,5 +1,8 @@
package NGCP::Panel::Utils::Interception;
use warnings;
use strict;
use Data::Dumper;
use LWP::UserAgent;
use TryCatch;

@ -1,5 +1,8 @@
package NGCP::Panel::Utils::MySQL;
use warnings;
use strict;
sub bulk_insert {
my(%params) = @_;
my ($c, $s, $trans, $query, $data, $chunksize) = @params{qw/c schema do_transaction query data chunk_size/};

@ -1,5 +1,8 @@
#!/usr/bin/perl -w
use warnings;
use strict;
my $path = '/tmp/lnp.csv';
my $carrier_base = 'carrier_';

@ -1,5 +1,8 @@
package Parent;
use warnings;
use strict;
our $VERSION = 1.23;
sub VERSION { $VERSION }

@ -1,3 +1,5 @@
## no critic (RequireUseWarnings, RequireUseStrict)
our $old = 0;
BEGIN {
unshift @INC, sub {

@ -1,5 +1,8 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('NGCP::Panel', 'CGI');

@ -1,4 +1,8 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Convert::Ascii85 qw();
use IO::Uncompress::UnXz qw(unxz $UnXzError);

@ -1,5 +1,8 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('NGCP::Panel', 'FastCGI');

@ -1,5 +1,8 @@
#!/usr/bin/env perl
use warnings;
use strict;
BEGIN {
$ENV{CATALYST_SCRIPT_GEN} = 40;
}

@ -1,5 +1,8 @@
#!/usr/bin/env perl
use warnings;
use strict;
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('NGCP::Panel', 'Test');

@ -1,3 +1,6 @@
use warnings;
use strict;
#use Sipwise::Base;
use Net::Domain qw(hostfqdn);
use JSON qw();

@ -1,7 +1,9 @@
use warnings;
use strict;
use threads qw();
#use Sipwise::Base;
use Test::More;
use Test::More;
BEGIN {

Loading…
Cancel
Save