← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/eslint-remove-dead-code into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/eslint-remove-dead-code into lp:launchpad.

Commit message:
Remove lots of dead JavaScript code spotted by ESLint.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/eslint-remove-dead-code/+merge/327892
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/eslint-remove-dead-code into lp:launchpad.
=== modified file 'lib/lp/app/javascript/autocomplete/autocomplete.js'
--- lib/lp/app/javascript/autocomplete/autocomplete.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/autocomplete/autocomplete.js	2017-07-21 16:50:14 +0000
@@ -428,7 +428,6 @@
         // is indexed by the start of the match.
 
         var midx;
-        var match_key;
         var match_string;
         var start_indicies = [];
 

=== modified file 'lib/lp/app/javascript/choiceedit/choiceedit.js'
--- lib/lp/app/javascript/choiceedit/choiceedit.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/choiceedit/choiceedit.js	2017-07-21 16:50:14 +0000
@@ -20,7 +20,6 @@
     C_NULLTEXTLOCATION = 'nulltext',
     C_ADDICON          = 'addicon',
     SAVE               = 'save',
-    LEFT_MOUSE_BUTTON  = 1,
     RENDERUI           = "renderUI",
     BINDUI             = "bindUI",
     SYNCUI             = "syncUI",

=== modified file 'lib/lp/app/javascript/choiceedit/tests/test_choiceedit.js'
--- lib/lp/app/javascript/choiceedit/tests/test_choiceedit.js	2013-04-09 07:20:39 +0000
+++ lib/lp/app/javascript/choiceedit/tests/test_choiceedit.js	2017-07-21 16:50:14 +0000
@@ -5,9 +5,8 @@
     var tests = Y.namespace('lp.choiceedit.test');
     tests.suite = new Y.Test.Suite('choiceedit tests');
 
-    // Local aliases
-    var Assert = Y.Assert,
-        ArrayAssert = Y.ArrayAssert;
+    // Local alias.
+    var Assert = Y.Assert;
 
     /*
      * A wrapper for the Y.Event.simulate() function.  The wrapper accepts
@@ -172,7 +171,6 @@
 
         test_choicelist_html_has_disabled: function() {
             simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
-            var configcount = this.config.items.length;
             var choicelist_lis = Y.one(document).all(".yui3-ichoicelist li");
             // confirm that disabled LIs are disabled
             var that = this;
@@ -193,7 +191,6 @@
 
         test_choicelist_html_has_current: function() {
             simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
-            var configcount = this.config.items.length;
             var choicelist_lis = Y.one(document).all(".yui3-ichoicelist li");
             // confirm that current value has an LI with current style
             var that = this;
@@ -221,7 +218,6 @@
 
         test_clicking_choicelist_item_fires_signal: function() {
             simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
-            var that = this;
             var fired = false;
             this.choice_edit._choice_list.on("valueChosen", function() {
                 fired = true;
@@ -236,7 +232,6 @@
 
         test_clicking_choicelist_item_does_green_flash: function() {
             simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
-            var that = this;
             var green_flash = Y.lp.anim.green_flash;
             var flashed = false;
             Y.lp.anim.green_flash = function() {
@@ -381,7 +376,6 @@
 
         test_choicelist_html_has_current: function() {
             simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
-            var configcount = this.config.items.length;
             var choicelist_lis = Y.one(document)
                 .all(".yui3-ichoicelist li");
 
@@ -481,8 +475,6 @@
         },
 
         test_action_icon: function() {
-            var that = this;
-
             Assert.areEqual(
                 this.null_choice_edit.get('actionicon'),
                 this.null_choice_edit.get('addicon'),

=== modified file 'lib/lp/app/javascript/client.js'
--- lib/lp/app/javascript/client.js	2017-07-20 13:29:41 +0000
+++ lib/lp/app/javascript/client.js	2017-07-21 16:50:14 +0000
@@ -610,7 +610,6 @@
         this.lp_client = client;
         this.uri = uri;
         this.dirty_attributes = [];
-        var entry = this;
 
         // Copy the representation keys into our own set of attributes, and add
         // an attribute-change event listener for caching purposes.
@@ -1106,7 +1105,6 @@
             // widget in a clean state.
             this.doBefore("_saveData", this.doPATCH);
 
-            var self = this;
             this.error_handler = new Y.lp.client.ErrorHandler();
             this.error_handler.clearProgressUI = function () {
                 config.host._uiClearWaiting();

=== modified file 'lib/lp/app/javascript/expander.js'
--- lib/lp/app/javascript/expander.js	2017-07-20 13:29:41 +0000
+++ lib/lp/app/javascript/expander.js	2017-07-21 16:50:14 +0000
@@ -255,7 +255,6 @@
      */
     foldContentNode: function(expand, no_animation) {
         var expander = this;
-        var has_paused = false;
         if (no_animation === true || Y.Lang.isUndefined(this._animation)) {
             // Make the animation have the proper direction set from
             // the start.

=== modified file 'lib/lp/app/javascript/formoverlay/formoverlay.js'
--- lib/lp/app/javascript/formoverlay/formoverlay.js	2014-01-30 15:04:06 +0000
+++ lib/lp/app/javascript/formoverlay/formoverlay.js	2017-07-21 16:50:14 +0000
@@ -18,7 +18,6 @@
 var ns = Y.namespace("lp.ui");
 var getCN = Y.ClassNameManager.getClassName,
     NAME = 'lazr-formoverlay',
-    CONTENT_BOX  = 'contentBox',
     RENDERUI = "renderUI",
     BINDUI = "bindUI";
 
@@ -470,7 +469,6 @@
         var select_idx;
         var num_options;
         var option;
-        var option_value;
 
         // Iterate over the form elements collection to construct the
         // label-value pairs.

=== modified file 'lib/lp/app/javascript/formoverlay/tests/test_formoverlay.js'
--- lib/lp/app/javascript/formoverlay/tests/test_formoverlay.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/formoverlay/tests/test_formoverlay.js	2017-07-21 16:50:14 +0000
@@ -109,7 +109,6 @@
             this.form_overlay.hide();
             first_input.blur();
 
-            var test = this;
             var focused = false;
 
             var onFocus = function(e) {
@@ -366,7 +365,6 @@
             });
 
             var event_was_propagated = false;
-            var test = this;
             var onSubmit = function(e) {
                 event_was_propagated = true;
                 e.preventDefault();
@@ -389,7 +387,6 @@
             });
 
             var event_was_propagated = false;
-            var test = this;
             var onSubmit = function(e) {
                 event_was_propagated = true;
                 e.preventDefault();

=== modified file 'lib/lp/app/javascript/indicator/tests/test_indicator.js'
--- lib/lp/app/javascript/indicator/tests/test_indicator.js	2017-01-13 13:32:06 +0000
+++ lib/lp/app/javascript/indicator/tests/test_indicator.js	2017-07-21 16:50:14 +0000
@@ -66,7 +66,6 @@
             });
             this.indicator.render();
             var content = this.indicator.get('boundingBox');
-            var test = content.getContent();
             var img = content.one('img');
             Assert.areEqual('file:///@@/spinner-big', img.get('src'));
         },

=== modified file 'lib/lp/app/javascript/inlineedit/editor.js'
--- lib/lp/app/javascript/inlineedit/editor.js	2013-12-12 04:47:30 +0000
+++ lib/lp/app/javascript/inlineedit/editor.js	2017-07-21 16:50:14 +0000
@@ -63,11 +63,7 @@
     C_ERROR_HIDDEN = getCN(EDITOR, 'errors', HIDDEN),
 
     SAVE = 'save',
-    CANCEL = 'cancel',
-    SHRINK = 'shrink';
-
-// To strip the 'px' unit suffix off widget sizes.
-var strip_px = /px$/;
+    CANCEL = 'cancel';
 
 var InlineEditor = function() {
     InlineEditor.superclass.constructor.apply(this, arguments);
@@ -723,7 +719,6 @@
 
         // hook up the resizing textarea to handle those changes
         var cfg = this.cfg;
-        var input = this.get(INPUT_EL);
         var that = this;
 
         if (!this.get(MULTILINE)) {

=== modified file 'lib/lp/app/javascript/inlineedit/tests/test_inline_edit.js'
--- lib/lp/app/javascript/inlineedit/tests/test_inline_edit.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/inlineedit/tests/test_inline_edit.js	2017-07-21 16:50:14 +0000
@@ -26,19 +26,6 @@
     ].join('');
 
 
-    /* Helper to stamp a Node with an ID attribute.  Needed for YUI 2.X
-     * testing, which is heavily ID-based.
-     *
-     * Returns the node's 'id' attribute.
-     */
-    function id_for(node) {
-        if (!node.getAttribute('id')) {
-            var id = Y.stamp(node);
-            node.setAttribute('id', id);
-        }
-        return node.getAttribute('id');
-    }
-
     /*
      * A wrapper for the Y.Event.simulate() function.  The wrapper accepts
      * CSS selectors and Node instances instead of raw nodes.
@@ -290,7 +277,6 @@
             this.editor.render();
 
             var input = this.editor.get('input_field'),
-                test = this,
                 focused = false;
 
             Y.on('focus', function() {
@@ -323,7 +309,6 @@
             // empty string.
             input.set('value', '');
 
-            var test = this;
             // Add our focus event listener.
             Y.on('focus', function() {
                 got_focus = true;

=== modified file 'lib/lp/app/javascript/inlinehelp/tests/test_inlinehelp.js'
--- lib/lp/app/javascript/inlinehelp/tests/test_inlinehelp.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/inlinehelp/tests/test_inlinehelp.js	2017-07-21 16:50:14 +0000
@@ -5,7 +5,6 @@
 
     var tests = Y.namespace('lp.app.inlinehelp.test');
     tests.suite = new Y.Test.Suite('InlineHelp Tests');
-    var Assert = Y.Assert;
     tests.suite.add(new Y.Test.Case({
         name: 'inlinehelp.init_help',
 

=== modified file 'lib/lp/app/javascript/listing_navigator.js'
--- lib/lp/app/javascript/listing_navigator.js	2012-09-12 01:45:17 +0000
+++ lib/lp/app/javascript/listing_navigator.js	2017-07-21 16:50:14 +0000
@@ -181,8 +181,6 @@
      */
     default_history_changed: function(e) {
         if (e.newVal.hasOwnProperty('batch_key')) {
-            var batch_key = e.newVal.batch_key;
-            var batch = this.get('batches')[batch_key];
             this.pre_fetch_batches();
             this.render();
             this._bindUI();

=== modified file 'lib/lp/app/javascript/overlay/overlay.js'
--- lib/lp/app/javascript/overlay/overlay.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/overlay/overlay.js	2017-07-21 16:50:14 +0000
@@ -11,8 +11,7 @@
 
 var ns = Y.namespace('lp.ui');
 
-var ESCAPE = 27,
-    TAB = 9,
+var TAB = 9,
     CANCEL = 'cancel',
     BOUNDING_BOX = 'boundingBox',
     CONTENT_BOX = 'contentBox',

=== modified file 'lib/lp/app/javascript/overlay/tests/test_overlay.js'
--- lib/lp/app/javascript/overlay/tests/test_overlay.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/overlay/tests/test_overlay.js	2017-07-21 16:50:14 +0000
@@ -9,9 +9,8 @@
     // KeyCode for escape
     var ESCAPE = 27;
 
-    // Local aliases
-    var Assert = Y.Assert,
-        ArrayAssert = Y.ArrayAssert;
+    // Local alias.
+    var Assert = Y.Assert;
 
     /*
      * A wrapper for the Y.Event.simulate() function.  The wrapper accepts

=== modified file 'lib/lp/app/javascript/picker/tests/test_picker.js'
--- lib/lp/app/javascript/picker/tests/test_picker.js	2014-05-19 11:33:05 +0000
+++ lib/lp/app/javascript/picker/tests/test_picker.js	2017-07-21 16:50:14 +0000
@@ -456,7 +456,6 @@
 
         test_results_updates_display_with_missing_data: function () {
             this.picker.render();
-            var image_url = '../../ui/assets/skins/sam/search.png';
             this.picker.set('results', [
                 { value: 'jschmo', title: 'Joe Schmo' }
             ]);
@@ -942,7 +941,6 @@
                 ]);
             this.picker.render();
 
-            var bb = this.picker.get('boundingBox');
             var event_has_fired = false;
             this.picker.subscribe('search', function(e) {
                 event_has_fired = true;
@@ -965,7 +963,6 @@
                 ]);
             this.picker.render();
 
-            var bb = this.picker.get('boundingBox');
             Assert.areEqual(
                 0, this.picker.get('selected_batch'),
                 "First batch should be selected.");
@@ -1065,7 +1062,6 @@
             this.picker.set('selected_batch', 1);
             this.picker.render();
 
-            var bb = this.picker.get('boundingBox');
             simulate(
                 this.picker.get('boundingBox'), '.lazr-next.lazr-btn', 'click');
             Assert.areEqual(
@@ -1104,7 +1100,6 @@
             this.picker.set('selected_batch', 1);
             this.picker.render();
 
-            var bb = this.picker.get('boundingBox');
             simulate(
                 this.picker.get('boundingBox'), '.lazr-prev.lazr-btn', 'click');
             Assert.areEqual(

=== modified file 'lib/lp/app/javascript/subscribers/tests/test_subscribers_list.js'
--- lib/lp/app/javascript/subscribers/tests/test_subscribers_list.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/subscribers/tests/test_subscribers_list.js	2017-07-21 16:50:14 +0000
@@ -1799,11 +1799,6 @@
         test_loadSubscribers_failure: function() {
             // On failure to load, activity indication is set to an error
             // message received from the server.
-            var details = [
-                { subscriber: { name: "subscriber" },
-                  subscription_level: 'Level3' }
-            ];
-
             var loader = setUpLoader(this.root);
 
             // Mock lp_client for testing erroring out with 'BOOM'.

=== modified file 'lib/lp/app/javascript/testing/tests/test_mockio.js'
--- lib/lp/app/javascript/testing/tests/test_mockio.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/testing/tests/test_mockio.js	2017-07-21 16:50:14 +0000
@@ -121,8 +121,7 @@
             var mockio = this._make_mockio();
             var response = new Y.lp.testing.mockio.MockHttpResponse();
             var expected_header_key = "X-My-Header",
-                expected_header_val = "MyHeaderValue",
-                response_headers = {};
+                expected_header_val = "MyHeaderValue";
             response.setResponseHeader(
                 expected_header_key,
                 expected_header_val);

=== modified file 'lib/lp/app/javascript/tests/test_comment.js'
--- lib/lp/app/javascript/tests/test_comment.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/tests/test_comment.js	2017-07-21 16:50:14 +0000
@@ -52,17 +52,13 @@
             var comment = this._get_mocked_comment();
             var progress_ui_called = false;
             var post_comment_called = false;
-            var extra_call_called = false;
             comment.activateProgressUI = function () {
                 progress_ui_called = true;
             };
             comment.post_comment = function () {
                 post_comment_called = true;
             };
-            comment._add_comment_success = function () {
-                extra_call_called = true;
-            };
-            comment.validate = function () { return true };
+            comment.validate = function () { return true; };
             var mock_event = { halt: function () {} };
 
             comment.add_comment(mock_event);

=== modified file 'lib/lp/app/javascript/tests/test_information_type.js'
--- lib/lp/app/javascript/tests/test_information_type.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/tests/test_information_type.js	2017-07-21 16:50:14 +0000
@@ -130,10 +130,6 @@
         // A successful save updates the subscribers portlet.
         test_save_success_with_subscribers_data: function() {
             this.makeWidget();
-            var flag = false;
-            Y.on('test:banner:hide', function() {
-                flag = true;
-            });
             var summary = Y.one('#information-type-summary');
             summary.replaceClass('public', 'private');
 

=== modified file 'lib/lp/app/javascript/tests/test_listing_navigator.js'
--- lib/lp/app/javascript/tests/test_listing_navigator.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/tests/test_listing_navigator.js	2017-07-21 16:50:14 +0000
@@ -723,7 +723,6 @@
          * batch if Navigator.get('pre_fetch') is false.
          */
         test_pre_fetch_disabled: function() {
-            var last_url;
             var navigator = this.get_pre_fetch_navigator({target: this.target});
             navigator.pre_fetch_batches();
             Y.Assert.areSame(null, navigator.get('io_provider').last_request);

=== modified file 'lib/lp/app/javascript/tests/test_longpoll.js'
--- lib/lp/app/javascript/tests/test_longpoll.js	2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/tests/test_longpoll.js	2017-07-21 16:50:14 +0000
@@ -3,7 +3,6 @@
 YUI.add('lp.longpoll.test', function (Y) {
     var longpoll = Y.lp.app.longpoll;
 
-    var suite = new Y.Test.Suite("longpoll Tests");
     var tests = Y.namespace('lp.longpoll.test');
     tests.suite = new Y.Test.Suite('longpoll Tests');
 

=== modified file 'lib/lp/blueprints/javascript/tests/test_workitems.js'
--- lib/lp/blueprints/javascript/tests/test_workitems.js	2012-10-26 10:00:20 +0000
+++ lib/lp/blueprints/javascript/tests/test_workitems.js	2017-07-21 16:50:14 +0000
@@ -29,7 +29,6 @@
     _all_expanders_are_closed: function(){
         var found_open = false;
         Y.all('.collapsible-body').each(function(e) {
-            found_collapsible_body = true;
             if (!e.hasClass('hidden'))
             {
                 found_open = true;
@@ -42,7 +41,6 @@
     _all_expanders_are_open: function(){
         var found_closed = false;
         Y.all('.collapsible-body').each(function(e) {
-            found_collapsible_body = true;
             if (e.hasClass('hidden'))
             {
                 found_closed = true;

=== modified file 'lib/lp/bugs/javascript/bugtask_index.js'
--- lib/lp/bugs/javascript/bugtask_index.js	2012-11-12 13:45:58 +0000
+++ lib/lp/bugs/javascript/bugtask_index.js	2017-07-21 16:50:14 +0000
@@ -1004,9 +1004,6 @@
 namespace.load_more_comments = function(batched_comments_url,
                                         comments_container,
                                         io_provider) {
-    var spinner = Y.Node.create(
-        '<img src="/@@/spinner" style="text_align: center; ' +
-        'display: none" />');
     var spinner_span = Y.one('#more-comments-spinner');
     spinner_span.setStyle('display', 'inline');
     var handlers = {

=== modified file 'lib/lp/bugs/javascript/bugtracker_overlay.js'
--- lib/lp/bugs/javascript/bugtracker_overlay.js	2012-09-10 18:44:11 +0000
+++ lib/lp/bugs/javascript/bugtracker_overlay.js	2017-07-21 16:50:14 +0000
@@ -38,7 +38,6 @@
             on: {
                 success: finish_new_bugtracker,
                 failure: function (ignore, response, args) {
-                    var error_box = Y.one('#bugtracker-error');
                     var error_message = response.statusText + '\n\n' +
                                         response.responseText;
                     bugtracker_form.showError(error_message);

=== modified file 'lib/lp/bugs/javascript/duplicates.js'
--- lib/lp/bugs/javascript/duplicates.js	2013-04-09 05:05:39 +0000
+++ lib/lp/bugs/javascript/duplicates.js	2017-07-21 16:50:14 +0000
@@ -322,7 +322,6 @@
      * @private
      */
     _submit_bug: function(new_dup_id, new_dupe_title, widget) {
-        var dupe_span = this.get('dupe_span');
         var new_dup_url = null;
 
         var qs;

=== modified file 'lib/lp/bugs/javascript/filebug_dupefinder.js'
--- lib/lp/bugs/javascript/filebug_dupefinder.js	2012-09-10 20:52:27 +0000
+++ lib/lp/bugs/javascript/filebug_dupefinder.js	2017-07-21 16:50:14 +0000
@@ -10,11 +10,8 @@
 
 var BLOCK = 'block',
     DISPLAY = 'display',
-    EXPANDER_COLLAPSED = '/@@/treeCollapsed',
-    EXPANDER_EXPANDED = '/@@/treeExpanded',
     INNER_HTML = 'innerHTML',
     NONE = 'none',
-    SRC = 'src',
     HIDDEN = 'hidden';
 
 var namespace = Y.namespace('lp.bugs.filebug_dupefinder');
@@ -56,25 +53,6 @@
     '<button type="button" name="field.actions.cancel">Choose Again</button>';
 
 /**
- * Return the relevant duplicate-details div for a bug-already-reported
- * expander.
- * @param expander The expander for which to return the relevant div.
- */
-function get_details_div(expander) {
-    var details_div = expander.get(
-        'parentNode').get('parentNode').one('.duplicate-details');
-
-    // Check that the details_div actually exists and raise an error if
-    // we can't find it.
-    if (!Y.Lang.isValue(details_div)) {
-        Y.fail(
-            "Unable to find details div for expander " + expander.get('id'));
-    } else {
-        return details_div;
-    }
-}
-
-/**
  * Show the bug reporting form and collapse all bug details forms.
  */
 function show_bug_reporting_form() {

=== modified file 'lib/lp/bugs/javascript/tests/test_async_comment_loading.js'
--- lib/lp/bugs/javascript/tests/test_async_comment_loading.js	2013-03-20 03:41:40 +0000
+++ lib/lp/bugs/javascript/tests/test_async_comment_loading.js	2017-07-21 16:50:14 +0000
@@ -4,10 +4,8 @@
 YUI.add('lp.bugs.async_comments.test', function (Y) {
 
     // Local aliases.
-    var Assert = Y.Assert,
-        ArrayAssert = Y.ArrayAssert;
+    var Assert = Y.Assert;
     var module = Y.lp.bugs.bugtask_index;
-    var suite = new Y.Test.Suite("Async comment loading tests");
 
     var comments_markup =
         "<div>This is a comment</div>" +

=== modified file 'lib/lp/bugs/javascript/tests/test_duplicates.js'
--- lib/lp/bugs/javascript/tests/test_duplicates.js	2013-03-20 03:41:40 +0000
+++ lib/lp/bugs/javascript/tests/test_duplicates.js	2017-07-21 16:50:14 +0000
@@ -187,7 +187,6 @@
         test_picker_form_submission_failure: function() {
             this.widget = this._createWidget(false);
             this._assert_dupe_submission(3);
-            var failure_called = false;
             this.mockio.respond({
                 status: 400,
                 responseText:

=== modified file 'lib/lp/bugs/javascript/tests/test_me_too.js'
--- lib/lp/bugs/javascript/tests/test_me_too.js	2013-03-20 03:41:40 +0000
+++ lib/lp/bugs/javascript/tests/test_me_too.js	2017-07-21 16:50:14 +0000
@@ -2,9 +2,8 @@
  * GNU Affero General Public License version 3 (see the file LICENSE). */
 
 YUI.add('lp.bugs.bugtask_index.test_me_too', function (Y) {
-    // Local aliases
-    var Assert = Y.Assert,
-        ArrayAssert = Y.ArrayAssert;
+    // Local alias.
+    var Assert = Y.Assert;
 
     /*
      * A wrapper for the Y.Event.simulate() function.  The wrapper accepts

=== modified file 'lib/lp/bugs/javascript/tests/test_official_bug_tags.js'
--- lib/lp/bugs/javascript/tests/test_official_bug_tags.js	2013-03-20 03:41:40 +0000
+++ lib/lp/bugs/javascript/tests/test_official_bug_tags.js	2017-07-21 16:50:14 +0000
@@ -42,7 +42,6 @@
             new_tag_button.simulate('click');
             var message_overlay = Y.one('.official-tag-error-message');
             Y.Assert.isNotNull(message_overlay);
-            var tag = message_overlay.one(".official-tag-error-message-value");
             Y.Assert.isTrue(message_overlay.get('text').indexOf('me!') !== -1);
         }
     }));

=== modified file 'lib/lp/bugs/javascript/tests/test_subscription.js'
--- lib/lp/bugs/javascript/tests/test_subscription.js	2013-03-20 03:41:40 +0000
+++ lib/lp/bugs/javascript/tests/test_subscription.js	2017-07-21 16:50:14 +0000
@@ -2680,14 +2680,6 @@
                               };
             module.show_subscription_description(this.config);
             // Simulated return values from the named_post call.
-            var sub = {
-                bug: {
-                    'private': false,
-                    security_related: false
-                },
-                principal_is_reporter: false,
-                subscription: {bug_notification_level: 'Details'}
-            };
             module._lp_client.named_post.args = [];
             // Before clicking on the link the direct
             // subscription count is 3.
@@ -2713,14 +2705,6 @@
                               };
             module.show_subscription_description(this.config);
             // Simulated return values from the named_post call.
-            var sub = {
-                bug: {
-                    'private': false,
-                    security_related: false
-                },
-                principal_is_reporter: false,
-                subscription: {bug_notification_level: 'Details'}
-            };
             module._lp_client.named_post.args = [];
             // Before clicking on the link the direct subscription count
             // is 3.

=== modified file 'lib/lp/code/javascript/branch.information_type_choice.js'
--- lib/lp/code/javascript/branch.information_type_choice.js	2015-06-04 17:13:54 +0000
+++ lib/lp/code/javascript/branch.information_type_choice.js	2017-07-21 16:50:14 +0000
@@ -8,7 +8,6 @@
 
 var namespace = Y.namespace('lp.code.branch.information_type_choice');
 var information_type = Y.namespace('lp.app.information_type');
-var superclass = Y.Widget;
 
 namespace.BranchInformationTypeWidget = Y.Base.create(
     "branchInformationTypeWidget", Y.Widget, [], {

=== modified file 'lib/lp/code/javascript/productseries-setbranch.js'
--- lib/lp/code/javascript/productseries-setbranch.js	2016-11-11 14:22:40 +0000
+++ lib/lp/code/javascript/productseries-setbranch.js	2017-07-21 16:50:14 +0000
@@ -79,7 +79,6 @@
     module.onclick_rcs_type = function(e) {
         /* Which rcs type radio button has been selected? */
         // CVS
-        var rcs_types = module._rcs_types();
         var selectedRCS = module._get_selected_rcs();
         module.set_enabled('field.cvs_module', selectedRCS === 'CVS');
     };

=== modified file 'lib/lp/code/javascript/tests/test_bugspeclinks.js'
--- lib/lp/code/javascript/tests/test_bugspeclinks.js	2017-04-24 14:23:36 +0000
+++ lib/lp/code/javascript/tests/test_bugspeclinks.js	2017-07-21 16:50:14 +0000
@@ -224,10 +224,6 @@
         // The link bug success function works as expected.
         test_link_bug_success: function() {
             this.widget = this._createWidget();
-            var data = {
-                self_link: 'api/devel/bugs/1'};
-            var new_bug_entry = new Y.lp.client.Entry(
-                this.lp_client, data, data.self_link);
             var link_html = '<div id="buglink-3"></div>';
             this.widget._link_bug_success(3, link_html);
             Y.Assert.areEqual(

=== modified file 'lib/lp/registry/javascript/distroseries/differences.js'
--- lib/lp/registry/javascript/distroseries/differences.js	2012-09-10 18:44:11 +0000
+++ lib/lp/registry/javascript/distroseries/differences.js	2017-07-21 16:50:14 +0000
@@ -14,7 +14,6 @@
 
 var namespace = Y.namespace('lp.registry.distroseries.differences'),
     testspace = Y.namespace('lp.registry.distroseries.differences.test'),
-    formwidgets = Y.lp.app.formwidgets,
     widgets = Y.lp.registry.distroseries.widgets;
 
 var PACKAGESET_FIELD = "field.packageset",
@@ -287,6 +286,6 @@
 
 
 }, "0.1", {"requires": [
-               "lp.ui.formoverlay", "lp.app.formwidgets",
+               "lp.ui.formoverlay",
                "lp.app.picker", "lp.registry.distroseries.widgets",
                "node", "querystring-parse"]});

=== modified file 'lib/lp/registry/javascript/distroseries/tests/test_initseries.js'
--- lib/lp/registry/javascript/distroseries/tests/test_initseries.js	2014-07-21 22:45:01 +0000
+++ lib/lp/registry/javascript/distroseries/tests/test_initseries.js	2017-07-21 16:50:14 +0000
@@ -18,7 +18,6 @@
 
     var suite = new Y.Test.Suite("distroseries.initseries Tests");
     var initseries = Y.lp.registry.distroseries.initseries;
-    var widgets = Y.lp.registry.distroseries.widgets;
 
     var testDeriveDistroSeriesActionsWidget = {
         name: 'TestDeriveDistroSeriesActionsWidget',

=== modified file 'lib/lp/registry/javascript/product_views.js'
--- lib/lp/registry/javascript/product_views.js	2015-10-01 17:32:41 +0000
+++ lib/lp/registry/javascript/product_views.js	2017-07-21 16:50:14 +0000
@@ -168,7 +168,6 @@
                 // Additional spice for the insanity stew is given by the
                 // rhino book, page 428.  This code is basically a rip and
                 // remix of those two texts.
-                var event = e || window.event;
                 var code = e.charCode || e.keyCode;
 
                 if (/* Check for special characters. */

=== modified file 'lib/lp/registry/javascript/sharing/granteetable.js'
--- lib/lp/registry/javascript/sharing/granteetable.js	2013-04-19 02:35:16 +0000
+++ lib/lp/registry/javascript/sharing/granteetable.js	2017-07-21 16:50:14 +0000
@@ -408,7 +408,6 @@
             return false;
         }
         Y.some(right, function(sharing_value, info_type) {
-            var _value = left[info_type];
             if (!Y.Lang.isValue(left[info_type])) {
                 result = false;
                 return true;

=== modified file 'lib/lp/registry/javascript/sharing/tests/test_pillarsharingview.js'
--- lib/lp/registry/javascript/sharing/tests/test_pillarsharingview.js	2015-10-22 00:13:43 +0000
+++ lib/lp/registry/javascript/sharing/tests/test_pillarsharingview.js	2017-07-21 16:50:14 +0000
@@ -252,7 +252,6 @@
             this.view = this._create_Widget();
             this.view.render();
             var remove_grantee_success_called = false;
-            var self = this;
             this.view.remove_grantee_success = function(person_uri) {
                 Y.Assert.areEqual('~fred', person_uri);
                 remove_grantee_success_called = true;

=== modified file 'lib/lp/registry/javascript/sharing/tests/test_sharingdetailsview.js'
--- lib/lp/registry/javascript/sharing/tests/test_sharingdetailsview.js	2015-10-22 00:13:43 +0000
+++ lib/lp/registry/javascript/sharing/tests/test_sharingdetailsview.js	2017-07-21 16:50:14 +0000
@@ -239,7 +239,6 @@
             });
             this.view.render();
             var remove_grant_success_called = false;
-            var self = this;
             this.view.remove_grant_success = function(artifact_uri) {
                 Y.Assert.areEqual('api/devel/bugs/2', artifact_uri);
                 remove_grant_success_called = true;
@@ -277,7 +276,6 @@
             });
             this.view.render();
             var remove_grant_success_called = false;
-            var self = this;
             this.view.remove_grant_success = function(artifact_uri) {
                 Y.Assert.areEqual(
                     'api/devel/~someone/+junk/somebranch', artifact_uri);
@@ -316,7 +314,6 @@
             });
             this.view.render();
             var remove_grant_success_called = false;
-            var self = this;
             this.view.remove_grant_success = function(artifact_uri) {
                 Y.Assert.areEqual(
                     'api/devel/~someone/+git/somerepo', artifact_uri);

=== modified file 'lib/lp/registry/javascript/structural-subscription.js'
--- lib/lp/registry/javascript/structural-subscription.js	2012-12-13 17:16:39 +0000
+++ lib/lp/registry/javascript/structural-subscription.js	2017-07-21 16:50:14 +0000
@@ -311,7 +311,6 @@
 function edit_subscription_handler(context, form_data) {
     var has_errors = check_for_errors_in_overlay(
         namespace._add_subscription_overlay);
-    var filter_id = '#filter-description-'+context.filter_id.toString();
     var filter_node = Y.one(
         '#subscription-filter-'+context.filter_id.toString());
     var submit_button = namespace._add_subscription_overlay.bodyNode.one(
@@ -321,7 +320,6 @@
     }
     var on = {success: function (new_data) {
         submit_button.replaceClass('spinner', 'lazr-pos');
-        var description_node = Y.one(filter_id);
         var filter = new_data.getAttrs();
         fill_filter_description(
             filter_node, context.filter_info, filter);
@@ -1336,7 +1334,6 @@
  * Attach activation (click) handlers to all of the edit links on the page.
  */
 function wire_up_edit_links(config) {
-    var listing = Y.one(config.content_box);
     var subscription_info = LP.cache.subscription_info;
     var filter_id = 0;
     var i;

=== modified file 'lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js'
--- lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js	2013-04-09 05:05:39 +0000
+++ lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js	2017-07-21 16:50:14 +0000
@@ -657,7 +657,6 @@
         },
 
         test_clean: function() {
-            var that = this;
             var comment_text = 'Content';
             this.widget.get('srcNode').one('textarea').set('value', comment_text);
             var comment_entry = new Comment();
@@ -779,10 +778,8 @@
 
         test_add_comment_handler_empty: function() {
             // An empty comment is treated as a mistake.
-            var that = this;
             var comment_text = '';
             this.widget.get('srcNode').one('textarea').set('value', comment_text);
-            var comment_entry = new Comment();
             var post_called = false;
             module.lp_client.named_post = function(url, method, config) {
                 post_called = true;
@@ -840,9 +837,7 @@
                         .addClass('FAILED');
             module.setup_packages_diff_states(
                 placeholder.one('.diff-extra-container'), dsd_uri);
-            var func_req;
             module.lp_client.named_post = function(url, func, config) {
-                func_req = func;
                 config.on.success();
             };
             var wrong_button = placeholder.one('.package-diff-placeholder');

=== modified file 'lib/lp/registry/javascript/tests/test_milestone_creation.js'
--- lib/lp/registry/javascript/tests/test_milestone_creation.js	2013-04-08 08:06:09 +0000
+++ lib/lp/registry/javascript/tests/test_milestone_creation.js	2017-07-21 16:50:14 +0000
@@ -44,7 +44,6 @@
     test_configure: function() {
         // Ensure configuring the module works as it will be needed in
         // subsequent tests.
-        var client = new Y.lp.client.Launchpad({sync: true});
         var config = {
             milestone_form_uri: 'a',
             series_uri: 'b',
@@ -68,7 +67,6 @@
         var data = serverfixture.setup(this, 'setup');
 
         // Initialize the milestoneoverlay module.
-        var milestone_table = Y.lp.registry.milestonetable;
         var client = new Y.lp.client.Launchpad({sync: true});
         var config = {
             milestone_form_uri: data.milestone_form_uri,
@@ -119,7 +117,6 @@
         var data = serverfixture.setup(this, 'setup');
 
         // Initialize the milestoneoverlay module.
-        var milestone_table = Y.lp.registry.milestonetable;
         var client = new Y.lp.client.Launchpad({sync: true});
         var config = {
             milestone_form_uri: data.milestone_form_uri,
@@ -170,6 +167,6 @@
 }, '0.1', {
     requires: [
         'test', 'lp.client', 'lp.testing.serverfixture',
-        'lp.registry.milestonetable', 'lp.registry.milestoneoverlay']
+        'lp.registry.milestoneoverlay']
 });
 

=== modified file 'lib/lp/registry/javascript/tests/test_structural_subscription.js'
--- lib/lp/registry/javascript/tests/test_structural_subscription.js	2013-03-20 03:41:40 +0000
+++ lib/lp/registry/javascript/tests/test_structural_subscription.js	2017-07-21 16:50:14 +0000
@@ -17,23 +17,6 @@
     var content_box_name = 'ss-content-box';
     var content_box_id = '#' + content_box_name;
 
-    var target_link_class = '.menu-link-subscribe_to_bug_mail';
-
-    function array_compare(a,b) {
-        if (a.length !== b.length) {
-            return false;
-        }
-        a.sort();
-        b.sort();
-        var i;
-        for (i=0; i<a.length; i++) {
-            if (a[i] !== b[i]) {
-                return false;
-            }
-        }
-        return true;
-    }
-
     function create_test_node() {
         var test_node = Y.Node.create('<div id="test-content">')
             .append(Y.Node.create('<div></div>')
@@ -386,7 +369,6 @@
             // Long titles are cut down.
             module.setup(this.configuration);
             module._show_add_overlay(this.configuration);
-            overlay = Y.one('#accordion-overlay');
             // This is the title we would expect if there were no shortening.
             var header = Y.one(content_box_id).one('h2').get('text');
             // The actual title is a prefix of the unabridged title.

=== modified file 'lib/lp/registry/javascript/tests/test_team_mailinglists.js'
--- lib/lp/registry/javascript/tests/test_team_mailinglists.js	2013-03-20 03:41:40 +0000
+++ lib/lp/registry/javascript/tests/test_team_mailinglists.js	2017-07-21 16:50:14 +0000
@@ -2,10 +2,8 @@
  * GNU Affero General Public License version 3 (see the file LICENSE). */
 
 YUI.add('lp.registry.team.mailinglists.test', function (Y) {
-    // Local aliases.
-    var Assert = Y.Assert,
-        ArrayAssert = Y.ArrayAssert;
-    var team_mailinglists = Y.lp.registry.team.mailinglists;
+    // Local alias.
+    var Assert = Y.Assert;
 
     var tests = Y.namespace('lp.registry.team.mailinglists.test');
     tests.suite = new Y.Test.Suite('lp.registry.team.mailinglists Tests');

=== modified file 'lib/lp/registry/javascript/timeline.js'
--- lib/lp/registry/javascript/timeline.js	2012-05-12 02:36:41 +0000
+++ lib/lp/registry/javascript/timeline.js	2017-07-21 16:50:14 +0000
@@ -576,7 +576,6 @@
         var series_line = this.project_line.series_lines[0];
         var landmark = series_line.series.landmarks[0];
         if (landmark) {
-            var landmark_label = series_line.labels[landmark.name];
             var date_label_width = 0;
             if (series_line.series_date_label !== null) {
                 date_label_width =
@@ -648,7 +647,6 @@
         // Resizing the canvas requires destroying the old canvas and
         // creating a new one due to rendering issues in WebKit.
         this.calculate_landmark_spacing();
-        var contentBox = this.get('contentBox');
         this.recreate_canvas();
         var dom_canvas = Y.Node.getDOMNode(this.canvas);
         this.canvas_context = dom_canvas.getContext('2d');

=== modified file 'lib/lp/soyuz/javascript/tests/test_archive-packages.html'
--- lib/lp/soyuz/javascript/tests/test_archive-packages.html	2012-10-26 09:54:28 +0000
+++ lib/lp/soyuz/javascript/tests/test_archive-packages.html	2017-07-21 16:50:14 +0000
@@ -59,7 +59,7 @@
             <a class="remove-notification">Remove notification</a>
           </div>
         </script>
-        <script type="text/x-template" id="pending-job-template-no-link">
+        <script type="text/x-template">
           <div class="pending-job" job_id="3">
           </div>
         </script>

=== modified file 'lib/lp/soyuz/javascript/tests/test_archive-packages.js'
--- lib/lp/soyuz/javascript/tests/test_archive-packages.js	2012-01-06 10:15:37 +0000
+++ lib/lp/soyuz/javascript/tests/test_archive-packages.js	2017-07-21 16:50:14 +0000
@@ -16,8 +16,6 @@
     var module = Y.lp.soyuz.archive_packages;
 
     var pending_job = Y.one('#pending-job-template').getContent();
-    var pending_job_no_link = Y.one(
-        '#pending-job-template-no-link').getContent();
 
     var TestPendingCopyJobWidgetNoLink = {
         name: "TestPendingCopyJobWidgetNoLink",
@@ -28,8 +26,8 @@
                 .append(Y.Node.create(pending_job));
         },
 
-        test_instanciation: function() {
-            // The widget is instanciated even without a link to delete the
+        test_instantiation: function() {
+            // The widget is instantiated even without a link to delete the
             // widget's html.
             var area = Y.one('.pending-job-no-link');
             this.widget = new module.PendingCopyJobWidget(

=== modified file 'lib/lp/translations/javascript/sourcepackage_sharing_details.js'
--- lib/lp/translations/javascript/sourcepackage_sharing_details.js	2012-09-10 18:44:11 +0000
+++ lib/lp/translations/javascript/sourcepackage_sharing_details.js	2017-07-21 16:50:14 +0000
@@ -217,7 +217,6 @@
 
 
 function IOHandler(controller, check, error_handler) {
-    that = this;
     this.check = check;
     this.controller = controller;
     if (!Y.Lang.isValue(error_handler)){
@@ -420,7 +419,6 @@
     select_productseries: function(productseries_summary) {
         var that = this;
         var productseries_check = that.get('tsconfig').get('product_series');
-        var lp_client = new Y.lp.client.Launchpad();
         function save_productseries(config) {
             productseries_check.set('pending', true);
             that.update_check(productseries_check);
@@ -435,7 +433,6 @@
     remove_productseries: function(productseries_summary) {
         var that = this;
         var productseries_check = that.get('tsconfig').get('product_series');
-        var lp_client = new Y.lp.client.Launchpad();
         function delete_packaging(config) {
             productseries_check.set('pending', true);
             var source_package = that.get('source_package');
@@ -452,7 +449,6 @@
     },
     select_branch: function(branch_summary) {
         var that = this;
-        var lp_client = new Y.lp.client.Launchpad();
         var branch_check = that.get('tsconfig').get('branch');
         var productseries = that.get('productseries');
 


Follow ups