Skip to content

Commit 0cf572b

Browse files
committed
cinder/manila: reduce creation of global variables
This is marked as "blocker code smell" by sonarcloud.io, however we can fix this easily.
1 parent 15b24be commit 0cf572b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

crowbar_framework/app/assets/javascripts/barclamps/cinder/application.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $(document).ready(function($) {
3131
{
3232
//FIXME: right now, there's no good way to localize strings in js :/
3333
if (confirm("All volumes in the backend will be made unavailable; do you really want to delete this backend?")) {
34-
volume_entry = $(this).data("volumeid");
34+
var volume_entry = $(this).data("volumeid");
3535

3636
// delete the backend entry from the attributes JSON
3737
$('#proposal_attributes').removeJsonAttribute('volumes/' + volume_entry);
@@ -66,8 +66,7 @@ $(document).ready(function($) {
6666
$('#backend_entries').html()
6767
);
6868
}
69-
volumes = $('#proposal_attributes').readJsonAttribute('volumes', {});
70-
volume_defaults = $('#proposal_attributes').readJsonAttribute('volume_defaults', {});
69+
var volumes = $('#proposal_attributes').readJsonAttribute('volumes', {});
7170

7271
// Render forms for backend list
7372
$('#cinder_backends').replaceWith(

crowbar_framework/app/assets/javascripts/barclamps/manila/application.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $(document).ready(function($) {
2929
{
3030
//FIXME: right now, there's no good way to localize strings in js :/
3131
if (confirm("All shares in the backend will be made unavailable; do you really want to delete this backend?")) {
32-
share_entry = $(this).data("shareid");
32+
var share_entry = $(this).data("shareid");
3333

3434
// delete the backend entry from the attributes JSON
3535
$('#proposal_attributes').removeJsonAttribute('shares/' + share_entry);
@@ -64,8 +64,7 @@ $(document).ready(function($) {
6464
$('#backend_entries').html()
6565
);
6666
}
67-
shares = $('#proposal_attributes').readJsonAttribute('shares', {});
68-
share_defaults = $('#proposal_attributes').readJsonAttribute('share_defaults', {});
67+
var shares = $('#proposal_attributes').readJsonAttribute('shares', {});
6968

7069
// Render forms for backend list
7170
$('#manila_backends').replaceWith(

0 commit comments

Comments
 (0)