TT#37105 fix perlcritic errors related to variables

these are to fix sipwise TAP tests. The following policies were
violated and have been fixed (or ignored where apppropriate):
- Variables::ProhibitAugmentedAssignmentInDeclaration
- Variables::ProhibitConditionalDeclarations
- Variables::RequireLocalizedPunctuationVars

Change-Id: Ifee93d537cd6e33d9e6e6ef8026be4b2b9fd0ee5
changes/98/21498/3
Gerhard Jungwirth 8 years ago
parent f916bdcf3f
commit e5fccbf98e

@ -29,6 +29,7 @@ sub _test_preconditions {
if ($opt{'wd-server'}) {
my ($wd_host, $wd_port) = $opt{'wd-server'} =~ m{([^/:]+):([0-9]+)};
## no critic (RequireLocalizedPunctuationVars)
$ENV{TWD_HOST} = $wd_host;
$ENV{TWD_PORT} = $wd_port;
}
@ -38,6 +39,7 @@ sub _test_preconditions {
blib->import($opt{'schema-base-dir'});
}
## no critic (RequireLocalizedPunctuationVars)
$SIG{'INT'} = sub { exit(1) }; # for clean stopping of servers
unless ($opt{server} =~ m|^https?://|) {

@ -278,7 +278,7 @@ sub GET :Allow {
contract_id_field => 'contract_id');
my $now = NGCP::Panel::Utils::DateTime::current_local;
my (@embedded, @links, %contract_map);
my ($form) //= $self->get_form($c);
my ($form) = $self->get_form($c);
for my $subscriber (@$subscribers) {
my $contract = $subscriber->contract;
NGCP::Panel::Utils::ProfilePackages::get_contract_balance(c => $c,

@ -274,9 +274,9 @@ sub rules_root :Chained('rules_list') :PathPart('') :Args(0) {
my $param_move = $c->req->params->{move};
my $param_where = $c->req->params->{where};
my $elem = $rules_rs->find($param_move)
if ($param_move && is_int($param_move) && $param_where);
if($elem) {
if ($param_move && is_int($param_move) && $param_where &&
my $elem = $rules_rs->find($param_move)) {
my $use_next = ($param_where eq "down") ? 1 : 0;
my $swap_elem = $rules_rs->search({
field => $elem->field,

@ -401,7 +401,7 @@ sub switch_prepaid {
my %params = @_;
my ($c,$profile_id,$old_prepaid,$new_prepaid,$contract_rs) = @params{qw/c profile_id old_prepaid new_prepaid contract_rs/};
my $schema //= $c->model('DB');
my $schema = $c->model('DB');
# if prepaid flag changed, update all subscribers for customers
# who currently have the billing profile active
my $rs = $schema->resultset('billing_mappings')->search({

@ -1,6 +1,6 @@
package NGCP::Panel::Utils::GD::Simple;
## no critic (RequireUseWarnings, RequirePodSections)
## no critic (RequireUseWarnings, RequirePodSections, RequireLocalizedPunctuationVars, ProhibitStringySplit, ProhibitStringyEval)
# disable perlcritic because it's upstream code
=head1 NAME

@ -11,7 +11,7 @@ use Exporter qw(import);
our @EXPORT = qw();
our @EXPORT_OK = qw(typed);
our %EXPORT_TAGS = qw();
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
local $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
sub typed;
sub dotype;

@ -1068,7 +1068,8 @@ sub update_subadmin_sub_aliases {
domain_id => $subscriber->provisioning_voip_subscriber->domain_id,
});
$sub = $sub->subscriber if($sub);
my $acli_pref_tmpsub = NGCP::Panel::Utils::Preferences::get_usr_preference_rs(
my $acli_pref_tmpsub;
$acli_pref_tmpsub = NGCP::Panel::Utils::Preferences::get_usr_preference_rs(
c => $c, attribute => 'allowed_clis', prov_subscriber => $sub)
if($sub && $c->config->{numbermanagement}->{auto_allow_cli});
if(defined $acli_pref_tmpsub) {

@ -4,6 +4,7 @@ use warnings;
use strict;
BEGIN {
## no critic (RequireLocalizedPunctuationVars)
$ENV{CATALYST_SCRIPT_GEN} = 40;
}
@ -12,6 +13,8 @@ Catalyst::ScriptRunner->run('NGCP::Panel', 'Server');
1;
__END__
=head1 NAME
ngcp_panel_server.pl - Catalyst Test Server

Loading…
Cancel
Save