diff options
22 files changed, 34 insertions, 40 deletions
@@ -28,7 +28,6 @@ rules: valid-jsdoc: 1 no-undefined: 1 brace-style: 1 - no-unused-vars: 1 strict: 1 no-extra-parens: 1 eqeqeq: 1 diff --git a/horizon/static/framework/widgets/action-list/actions.service.js b/horizon/static/framework/widgets/action-list/actions.service.js index 8e5556a80..6c16a10dc 100644 --- a/horizon/static/framework/widgets/action-list/actions.service.js +++ b/horizon/static/framework/widgets/action-list/actions.service.js @@ -164,7 +164,7 @@ /** * Get the HTML for a `menu` */ - function getMenu(actionList, scope) { + function getMenu(actionList) { var menuElem = angular.element('<menu>'); menuElem.append(actionList); return menuElem; diff --git a/horizon/static/framework/widgets/charts/pie-chart.spec.js b/horizon/static/framework/widgets/charts/pie-chart.spec.js index 8932c4320..6861000b4 100644 --- a/horizon/static/framework/widgets/charts/pie-chart.spec.js +++ b/horizon/static/framework/widgets/charts/pie-chart.spec.js @@ -26,7 +26,7 @@ describe('pie chart directive', function () { var $scope, $elementMax, $elementTotal, $elementOverMax, - $elementNoQuota, donutChartSettings, quotaChartDefaults; + $elementNoQuota, quotaChartDefaults; beforeEach(module('templates')); beforeEach(module('horizon.framework')); @@ -38,7 +38,6 @@ beforeEach(inject(function ($injector) { var $compile = $injector.get('$compile'); $scope = $injector.get('$rootScope').$new(); - donutChartSettings = $injector.get('horizon.framework.widgets.charts.donutChartSettings'); quotaChartDefaults = $injector.get('horizon.framework.widgets.charts.quotaChartDefaults'); $scope.testDataTotal = { diff --git a/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.directive.js b/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.directive.js index e058d62b8..4839963c6 100644 --- a/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.directive.js +++ b/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.directive.js @@ -100,7 +100,7 @@ scope.filterStrings = scope.filterStrings ? scope.filterStrings : defaultFilterStrings; } - function compile(element, attrs) { + function compile(element) { /** * Need to set template here since MagicSearch template * attribute is not interpolated. Can't hardcode the diff --git a/horizon/static/framework/widgets/magic-search/magic-overrides.directive.spec.js b/horizon/static/framework/widgets/magic-search/magic-overrides.directive.spec.js index 8e9e9e070..762a03b80 100644 --- a/horizon/static/framework/widgets/magic-search/magic-overrides.directive.spec.js +++ b/horizon/static/framework/widgets/magic-search/magic-overrides.directive.spec.js @@ -27,7 +27,7 @@ }); describe('magic-overrides directive', function () { - var $window, $scope, $magicScope, $element, $timeout; + var $window, $scope, $magicScope, $timeout; beforeEach(module('templates')); beforeEach(module('MagicSearch')); @@ -88,7 +88,7 @@ '</magic-search>'; /* eslint-enable angular/ng_window_service */ - $element = $compile(angular.element(markup))($scope); + $compile(angular.element(markup))($scope); $scope.$apply(); diff --git a/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.spec.js b/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.spec.js index d2706da75..2ed6d5b96 100644 --- a/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.spec.js +++ b/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.spec.js @@ -21,7 +21,7 @@ var ctrl; beforeEach(module('horizon.framework.widgets.metadata.tree')); - beforeEach(inject(function ($controller, $injector) { + beforeEach(inject(function ($controller) { ctrl = $controller('MetadataTreeItemController'); })); diff --git a/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.spec.js b/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.spec.js index baefe6b7e..3401343a7 100644 --- a/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.spec.js +++ b/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.spec.js @@ -18,13 +18,12 @@ describe('Wait Spinner Tests', function() { - var service, modal; + var service; beforeEach(module('ui.bootstrap')); beforeEach(module('horizon.framework')); - beforeEach(inject(function($injector, $modal) { + beforeEach(inject(function($injector) { service = $injector.get('horizon.framework.widgets.modal-wait-spinner.service'); - modal = $modal; })); it('returns the service', function() { @@ -71,7 +70,7 @@ }); describe('Wait Spinner Directive', function() { - var $scope, $element, $timeout; + var $scope, $element; beforeEach(module('ui.bootstrap')); beforeEach(module('horizon.framework')); @@ -79,7 +78,6 @@ beforeEach(inject(function($injector) { var $compile = $injector.get('$compile'); $scope = $injector.get('$rootScope').$new(); - $timeout = $injector.get('$timeout'); var markup = '<div wait-spinner text="hello!"></div>'; $element = angular.element(markup); diff --git a/horizon/static/framework/widgets/modal/delete-modal.service.spec.js b/horizon/static/framework/widgets/modal/delete-modal.service.spec.js index c00cd22d8..b660b53a7 100644 --- a/horizon/static/framework/widgets/modal/delete-modal.service.spec.js +++ b/horizon/static/framework/widgets/modal/delete-modal.service.spec.js @@ -54,7 +54,7 @@ add: function() {} }; - var $scope, $q, service, events; + var $scope, $q, service; function getContext() { return { @@ -84,7 +84,7 @@ it('should open the modal with correct message', function() { var fakeModalService = { result: { - then: function (callback) {} + then: function () {} } }; diff --git a/horizon/static/framework/widgets/modal/simple-modal.spec.js b/horizon/static/framework/widgets/modal/simple-modal.spec.js index 30a73523b..2b4794abd 100644 --- a/horizon/static/framework/widgets/modal/simple-modal.spec.js +++ b/horizon/static/framework/widgets/modal/simple-modal.spec.js @@ -93,13 +93,13 @@ describe('Maximal Values Passed to the Modal', function() { - var returned, passed, passedContext; + var passed, passedContext; beforeEach(function() { var opts = { title: 'my title', body: 'my body', submit: 'Yes', cancel: 'No' }; spyOn(modal, 'open'); - returned = service.modal(opts); + service.modal(opts); passed = modal.open.calls.argsFor(0)[0]; passedContext = passed.resolve.context(); }); @@ -132,12 +132,12 @@ describe('Minimal Values Passed to the Modal', function() { - var returned, passed, passedContext; + var passed, passedContext; beforeEach(function() { var opts = { title: 'my title', body: 'my body' }; spyOn(modal, 'open'); - returned = service.modal(opts); + service.modal(opts); passed = modal.open.calls.argsFor(0)[0]; passedContext = passed.resolve.context(); }); diff --git a/horizon/static/framework/widgets/toast/toast.spec.js b/horizon/static/framework/widgets/toast/toast.spec.js index 9c5aff85d..edadaff20 100644 --- a/horizon/static/framework/widgets/toast/toast.spec.js +++ b/horizon/static/framework/widgets/toast/toast.spec.js @@ -24,7 +24,7 @@ describe('toast factory', function() { - var $compile, $scope, $timeout, service; + var $timeout, service; var successMsg = "I am success."; var dangerMsg = "I am danger."; @@ -34,8 +34,6 @@ beforeEach(module('horizon.framework')); beforeEach(inject(function ($injector) { service = $injector.get('horizon.framework.widgets.toast.service'); - $scope = $injector.get('$rootScope').$new(); - $compile = $injector.get('$compile'); $timeout = $injector.get('$timeout'); })); diff --git a/horizon/static/framework/widgets/transfer-table/transfer-table.controller.spec.js b/horizon/static/framework/widgets/transfer-table/transfer-table.controller.spec.js index dd6a99497..a63e5bde0 100644 --- a/horizon/static/framework/widgets/transfer-table/transfer-table.controller.spec.js +++ b/horizon/static/framework/widgets/transfer-table/transfer-table.controller.spec.js @@ -36,7 +36,7 @@ log = { error: function() {} }; var attrs = angular.noop; var parse = function(attr) { - return function(scope) { + return function() { return attr ? attr : {}; }; }; diff --git a/horizon/static/framework/widgets/transfer-table/transfer-table.directive.spec.js b/horizon/static/framework/widgets/transfer-table/transfer-table.directive.spec.js index 55484994c..40a961465 100644 --- a/horizon/static/framework/widgets/transfer-table/transfer-table.directive.spec.js +++ b/horizon/static/framework/widgets/transfer-table/transfer-table.directive.spec.js @@ -47,7 +47,7 @@ describe('render with allocated and available tags', function() { var $element; - beforeEach(inject(function($injector) { + beforeEach(inject(function() { var path = 'transfer-table/transfer-table.basic.mock.html'; var markup = $templateCache.get(basePath + path); $element = angular.element(markup); @@ -80,7 +80,7 @@ describe('clone content', function() { var $element; - beforeEach(inject(function($injector) { + beforeEach(inject(function() { var path = 'transfer-table/transfer-table.clone.mock.html'; var markup = $templateCache.get(basePath + path); $element = angular.element(markup); diff --git a/horizon/static/horizon/js/horizon.forms.js b/horizon/static/horizon/js/horizon.forms.js index ce0cdda29..e76017594 100644 --- a/horizon/static/horizon/js/horizon.forms.js +++ b/horizon/static/horizon/js/horizon.forms.js @@ -57,7 +57,7 @@ horizon.forms = { }, handle_subnet_address_source: function() { - $("div.table_wrapper, #modal_wrapper").on("change", "select#id_address_source", function(evt) { + $("div.table_wrapper, #modal_wrapper").on("change", "select#id_address_source", function() { var $option = $(this).find("option:selected"); var $form = $(this).closest("form"); var $ipVersion = $form.find("select#id_ip_version"); @@ -79,12 +79,11 @@ horizon.forms = { }, handle_subnet_subnetpool: function() { - $("div.table_wrapper, #modal_wrapper").on("change", "select#id_subnetpool", function(evt) { + $("div.table_wrapper, #modal_wrapper").on("change", "select#id_subnetpool", function() { var $option = $(this).find("option:selected"); var $form = $(this).closest("form"); var $ipVersion = $form.find("select#id_ip_version"); var $prefixLength = $form.find("select#id_prefixlen"); - var $ipv6Modes = $form.find("select#id_ipv6_modes"); var subnetpoolIpVersion = parseInt($option.data("ip_version"), 10) || 4; var minPrefixLen = parseInt($option.data("min_prefixlen"), 10) || 1; var maxPrefixLen = parseInt($option.data("max_prefixlen"), 10); diff --git a/horizon/static/horizon/js/horizon.js b/horizon/static/horizon/js/horizon.js index 8edd37c07..d5a171f78 100644 --- a/horizon/static/horizon/js/horizon.js +++ b/horizon/static/horizon/js/horizon.js @@ -47,4 +47,6 @@ var Horizon = function () { }; // Create the one and only horizon object. +/*eslint-disable no-unused-vars */ var horizon = new Horizon(); +/*eslint-enable no-unused-vars */ diff --git a/horizon/static/horizon/js/horizon.membership.js b/horizon/static/horizon/js/horizon.membership.js index aa3baf881..8bebdc6b6 100644 --- a/horizon/static/horizon/js/horizon.membership.js +++ b/horizon/static/horizon/js/horizon.membership.js @@ -72,10 +72,9 @@ horizon.membership = { init_current_membership: function(step_slug) { horizon.membership.current_membership[step_slug] = []; var members_list = []; - var role_name, role_id, selected_members; + var role_id, selected_members; angular.forEach(this.get_role_element(step_slug, ''), function(value) { role_id = horizon.membership.get_field_id($(value).attr('id')); - role_name = $('label[for="id_' + step_slug + '_role_' + role_id + '"]').text(); // get the array of members who are selected in this list selected_members = $(value).find("option:selected"); diff --git a/horizon/static/horizon/js/horizon.networktopology.js b/horizon/static/horizon/js/horizon.networktopology.js index 39a0c3aa8..76a8fb134 100644 --- a/horizon/static/horizon/js/horizon.networktopology.js +++ b/horizon/static/horizon/js/horizon.networktopology.js @@ -242,7 +242,7 @@ horizon.network_topology = { .attr('width', '100%') .attr('height', '100%') .attr('fill', 'white') - .on('click', function(d) { + .on('click', function() { self.delete_balloon(); }); diff --git a/horizon/static/horizon/tests/jasmine/messages.legacy-spec.js b/horizon/static/horizon/tests/jasmine/messages.legacy-spec.js index 41a7f5736..8011ffbc1 100644 --- a/horizon/static/horizon/tests/jasmine/messages.legacy-spec.js +++ b/horizon/static/horizon/tests/jasmine/messages.legacy-spec.js @@ -1,5 +1,5 @@ describe("Messages (horizon.messages.js)", function () { - var message, message2; + var message; it("Basic Alert", function () { message = horizon.alert("success", "A message!"); @@ -14,7 +14,7 @@ describe("Messages (horizon.messages.js)", function () { message = horizon.alert("error", "An error!"); expect(message.hasClass("alert-danger")).toBe(true); - message2 = horizon.alert("success", "Another message"); + horizon.alert("success", "Another message"); expect($('#main_content .messages .alert').length).toEqual(2); horizon.clearErrorMessages(); diff --git a/openstack_dashboard/dashboards/admin/static/dashboard/admin/flavors/filters/has-extras.filter.js b/openstack_dashboard/dashboards/admin/static/dashboard/admin/flavors/filters/has-extras.filter.js index ca20ba6fb..80017bb6e 100644 --- a/openstack_dashboard/dashboards/admin/static/dashboard/admin/flavors/filters/has-extras.filter.js +++ b/openstack_dashboard/dashboards/admin/static/dashboard/admin/flavors/filters/has-extras.filter.js @@ -28,7 +28,7 @@ * If input is defined and has more than one property return 'Yes' else return 'No' * */ - function hasExtrasFilter(gettext) { + function hasExtrasFilter() { return function check(input) { if (input && angular.isObject(input) && diff --git a/openstack_dashboard/dashboards/admin/static/dashboard/admin/flavors/table/flavors-table.controller.spec.js b/openstack_dashboard/dashboards/admin/static/dashboard/admin/flavors/table/flavors-table.controller.spec.js index 6cda2da8a..17be0fc3c 100644 --- a/openstack_dashboard/dashboards/admin/static/dashboard/admin/flavors/table/flavors-table.controller.spec.js +++ b/openstack_dashboard/dashboards/admin/static/dashboard/admin/flavors/table/flavors-table.controller.spec.js @@ -20,7 +20,7 @@ var flavors = [{id: '1'}, {id: '2'}]; var novaAPI = { - getFlavors: function(params) { + getFlavors: function() { var deferred = $q.defer(); deferred.resolve({data: {items: flavors}}); return deferred.promise; diff --git a/openstack_dashboard/static/app/core/cloud-services/hz-if-policies.directive.spec.js b/openstack_dashboard/static/app/core/cloud-services/hz-if-policies.directive.spec.js index a58170b05..eb8cced4f 100644 --- a/openstack_dashboard/static/app/core/cloud-services/hz-if-policies.directive.spec.js +++ b/openstack_dashboard/static/app/core/cloud-services/hz-if-policies.directive.spec.js @@ -21,7 +21,7 @@ var $scope, deferred, element; var policyService = { - ifAllowed: function(policyRules) { + ifAllowed: function() { return deferred.promise; } }; diff --git a/openstack_dashboard/static/app/core/metadata/metadata.service.spec.js b/openstack_dashboard/static/app/core/metadata/metadata.service.spec.js index 850f922d1..53c004ab4 100644 --- a/openstack_dashboard/static/app/core/metadata/metadata.service.spec.js +++ b/openstack_dashboard/static/app/core/metadata/metadata.service.spec.js @@ -57,7 +57,7 @@ it('should get aggregate namespace', function() { spyOn(glance, 'getNamespaces'); - var actual = metadataService.getNamespaces('aggregate'); + metadataService.getNamespaces('aggregate'); expect(glance.getNamespaces) .toHaveBeenCalledWith({ resource_type: 'OS::Nova::Aggregate' }, false); }); @@ -77,7 +77,7 @@ it('should get flavor namespace', function() { spyOn(glance, 'getNamespaces'); - var actual = metadataService.getNamespaces('flavor'); + metadataService.getNamespaces('flavor'); expect(glance.getNamespaces) .toHaveBeenCalledWith({ resource_type: 'OS::Nova::Flavor' }, false); }); @@ -97,7 +97,7 @@ it('should get image namespace', function() { spyOn(glance, 'getNamespaces'); - var actual = metadataService.getNamespaces('image'); + metadataService.getNamespaces('image'); expect(glance.getNamespaces) .toHaveBeenCalledWith({ resource_type: 'OS::Glance::Image' }, false); }); diff --git a/openstack_dashboard/static/app/core/metadata/modal/modal.controller.spec.js b/openstack_dashboard/static/app/core/metadata/modal/modal.controller.spec.js index 86abdb923..4ac32e8c1 100644 --- a/openstack_dashboard/static/app/core/metadata/modal/modal.controller.spec.js +++ b/openstack_dashboard/static/app/core/metadata/modal/modal.controller.spec.js @@ -50,7 +50,7 @@ var controller = createController(modalInstance); metadataService.editMetadata = function() { return { - then: function(success, fail) { + then: function(success) { success(); } }; |