TT#37222 fix perlcritic errors ProhibitCommaSeparatedStatements

one was actually a true positive. the others were false positives
and are going to be silenced for the time being, while we try to find
an upstream solution. more details can be found in the ticket.

Change-Id: Iae8df7606774a9d26e4d44dbba557c9fe62d2252
changes/28/21828/2
Gerhard Jungwirth 7 years ago
parent 4feeb76a93
commit 0b39b6e8b9

@ -477,11 +477,11 @@ sub create_defaults :Path('create_defaults') :Args(0) :Does(ACL) :ACLDetachTo('/
$billing->txn_do(sub {
$r{contacts} = $billing->resultset('contacts')->create({ %{ $defaults{contacts} } });
$r{contracts} = $billing->resultset('contracts')->create({
%{ $defaults{contracts} },
%{ $defaults{contracts} }, ## no critic (ProhibitCommaSeparatedStatements)
contact_id => $r{contacts}->id,
});
$r{resellers} = $billing->resultset('resellers')->create({
%{ $defaults{resellers} },
%{ $defaults{resellers} }, ## no critic (ProhibitCommaSeparatedStatements)
contract_id => $r{contracts}->id,
});
my $mappings_to_create = [];
@ -505,7 +505,7 @@ sub create_defaults :Path('create_defaults') :Args(0) :Does(ACL) :ACLDetachTo('/
$r{billing_mappings} = $r{contracts}->billing_mappings;
$r{admins} = $billing->resultset('admins')->create({
%{ $defaults{admins} },
%{ $defaults{admins} }, ## no critic (ProhibitCommaSeparatedStatements)
reseller_id => $r{resellers}->id,
});
NGCP::Panel::Utils::ProfilePackages::create_initial_contract_balances(c => $c,

@ -167,7 +167,7 @@ sub set_clone :Chained('set_base') :PathPart('clone') {
my $schema = $c->model('DB');
$schema->txn_do(sub {
my $new_set = $c->stash->{sets_rs}->create({
%{ $form->values },
%{ $form->values }, ## no critic (ProhibitCommaSeparatedStatements)
reseller_id => $c->stash->{set_result}->reseller_id,
});
my @old_rules = $c->stash->{set_result}->voip_rewrite_rules->all;

@ -283,7 +283,7 @@ sub set_clone :Chained('set_base') :PathPart('clone') :Does(ACL) :ACLDetachTo('/
}
delete $form->values->{reseller};
my $new_set = $schema->resultset('voip_subscriber_profile_sets')->create({
%{ $form->values },
%{ $form->values }, ## no critic (ProhibitCommaSeparatedStatements)
reseller_id => $c->stash->{set}->reseller_id,
});
foreach my $prof($c->stash->{set}->voip_subscriber_profiles->all) {

@ -501,7 +501,7 @@ sub get_billingmappings_timeline_data {
$c->log->debug("timeline range $start - $end");
#the max start date (of mappings with NULL end date) less than
#the visible range end will become the range start:
my $max_start_date = $contract->billing_mappings->search({
my $max_start_date = $contract->billing_mappings->search({ ## no critic (ProhibitCommaSeparatedStatements)
($end ? (start_date => [ -or =>
{ '<=' => $end },
{ '=' => undef },
@ -518,7 +518,7 @@ sub get_billingmappings_timeline_data {
$start = $max_start_date->start_date;
}
}
my $res = $contract->billing_mappings->search({
my $res = $contract->billing_mappings->search({ ## no critic (ProhibitCommaSeparatedStatements)
($end ? (start_date => ($start ? [ -and => {
'<=' => $end },{ #hide mappings beginning after range end
'>=' => $start #and beginning before range start (max_start_date).

@ -113,7 +113,7 @@ sub get_contract_rs {
my ($c,$schema,$include_terminated) = @params{qw/c schema include_terminated/};
$schema //= $c->model('DB');
my $rs = $schema->resultset('contracts')->search({
$include_terminated ? () : ('me.status' => { '!=' => 'terminated' }),
$include_terminated ? () : ('me.status' => { '!=' => 'terminated' }), ## no critic (ProhibitCommaSeparatedStatements)
},{
join => 'product',
});

@ -945,7 +945,7 @@ sub get_preferences_rs {
'contract_location' => [qw/voip_contract_preferences contract_location_pref location_id/],
);
my $pref_rs = $schema->resultset($config{$preferences_type}->[0])->search({
'attribute.'.$config{$preferences_type}->[1] => 1,
'attribute.'.$config{$preferences_type}->[1] => 1, ## no critic (ProhibitCommaSeparatedStatements)
$attribute ? ( 'attribute.attribute' => (('ARRAY' eq ref $attribute) ? { '-in' => $attribute } : $attribute ) ) : () ,
$item_id ? ('me.'.$config{$preferences_type}->[2] => $item_id) : (),
},{

@ -399,7 +399,7 @@ sub _update_customer {
$req->header('Content-Type' => 'application/json');
$req->header('Prefer' => 'return=representation');
$req->content(JSON::to_json({
%$customer,
%$customer, ## no critic (ProhibitCommaSeparatedStatements)
@further_opts,
}));
$res = $ua->request($req);

@ -465,7 +465,7 @@ my %customer_map = ();
pilot_primary_alias_username_after => $cc.$ac.$sn,
);
_check_event_history("start_profile when creating a pbx pilot subscriber w alias: ",$pilot_subscriber->{id},"%profile",[
{ %pilot_event,
{ %pilot_event, ## no critic (ProhibitCommaSeparatedStatements)
type => "start_profile",
old_status => '',
@ -510,7 +510,7 @@ my %customer_map = ();
);
_check_event_history("start_profile when creating a pbx extension subscriber w alias: ",$subscriber->{id},"%profile",[
{ %subscriber_event,
{ %subscriber_event, ## no critic (ProhibitCommaSeparatedStatements)
type => "start_profile",
old_status => '',
@ -921,7 +921,7 @@ sub _update_subscriber {
$req->header('Content-Type' => 'application/json');
$req->header('Prefer' => 'return=representation');
$req->content(JSON::to_json({
%$subscriber,
%$subscriber, ## no critic (ProhibitCommaSeparatedStatements)
@further_opts,
}));
$res = $ua->request($req);

@ -218,7 +218,7 @@ sub _update_lnp_number {
$req->header('X-Fake-Clienttime' => _get_fake_clienttime_now());
$req->header('Prefer' => 'return=representation');
$req->content(JSON::to_json({
%$number,
%$number, ## no critic (ProhibitCommaSeparatedStatements)
%further_opts,
}));
$res = $ua->request($req);

@ -170,7 +170,7 @@ sub _update_subscriber {
$req->header('Content-Type' => 'application/json');
$req->header('Prefer' => 'return=representation');
$req->content(JSON::to_json({
%$subscriber,
%$subscriber, ## no critic (ProhibitCommaSeparatedStatements)
@further_opts,
}));
$res = $ua->request($req);

@ -345,7 +345,7 @@ sub _update_contract {
$req->header('Content-Type' => 'application/json');
$req->header('Prefer' => 'return=representation');
$req->content(JSON::to_json({
%$contract,
%$contract, ## no critic (ProhibitCommaSeparatedStatements)
@further_opts,
}));
$res = $ua->request($req);

@ -99,7 +99,7 @@ if(ok($soxi_output =~/GSM/, "Check that we converted wav to GSM encoding:".$soxi
diag("Check empty file:");
#btw - other vriant of tha put data - closer to stored. will be changed by Collection::encode_content
my ($res_put_empty,$content_put_empty) = $test_machine->request_put( {
%{$test_machine->DATA_ITEM_STORE},
%{$test_machine->DATA_ITEM_STORE}, ## no critic (ProhibitCommaSeparatedStatements)
greetingfile => [ dirname($0).'/resources/empty.wav' ],
} );
$test_machine->http_code_msg(422, "check response code on put empty file", $res_put_empty, $content_put_empty);

@ -472,7 +472,7 @@ sub process_data{
$collections_slice //= [keys %$data];
foreach my $collection_name( @$collections_slice ){
if($self->FLAVOUR && exists $data->{$collection_name}->{flavour} && exists $data->{$collection_name}->{flavour}->{$self->FLAVOUR}){
$data = {%$data, %{$data->{$collection_name}->{flavour}->{$self->FLAVOUR}}},
$data = {%$data, %{$data->{$collection_name}->{flavour}->{$self->FLAVOUR}}};
}
}
#$self->clear_db($data);

Loading…
Cancel
Save