Bug 1280898 - Set up eslint for calendar files - enable id-length rule. r=MakeMyDay
authoreslint <eslint@bugzilla.kewis.ch>
Sat, 16 Jul 2016 02:20:06 +0200
changeset 26016 311e2a727825d2b098d19ff265a9153f0eca1ebe
parent 26015 0f9a99fba7f36da451ca1ccdf13dc9bb66880e80
child 26017 880d5e4d567c33a4424cae66ac72fc523a663efd
push id1771
push userclokep@gmail.com
push dateMon, 14 Nov 2016 17:47:53 +0000
treeherdercomm-beta@399ae9d71595 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMakeMyDay
bugs1280898
Bug 1280898 - Set up eslint for calendar files - enable id-length rule. r=MakeMyDay MozReview-Commit-ID: 1eaufSiw4BF
calendar/.eslintrc
calendar/base/backend/icaljs/calDateTime.js
calendar/base/backend/icaljs/calICSService.js
calendar/base/content/agenda-listbox.js
calendar/base/content/calendar-base-view.xml
calendar/base/content/calendar-invitations-manager.js
calendar/base/content/calendar-month-view.xml
calendar/base/content/calendar-multiday-view.xml
calendar/base/content/calendar-task-editing.js
calendar/base/content/calendar-task-tree.js
calendar/base/content/calendar-task-tree.xml
calendar/base/content/calendar-ui-utils.js
calendar/base/content/calendar-unifinder.js
calendar/base/content/calendar-views.xml
calendar/base/content/dialogs/calendar-creation.js
calendar/base/content/dialogs/calendar-dialog-utils.js
calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
calendar/base/content/dialogs/calendar-event-dialog-recurrence-preview.xml
calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
calendar/base/content/dialogs/calendar-event-dialog-timezone.js
calendar/base/content/dialogs/calendar-subscriptions-dialog.js
calendar/base/content/dialogs/calendar-summary-dialog.js
calendar/base/content/import-export.js
calendar/base/content/preferences/alarms.js
calendar/base/content/preferences/general.js
calendar/base/content/widgets/calendar-alarm-widget.xml
calendar/base/content/widgets/calendar-list-tree.xml
calendar/base/content/widgets/minimonth.xml
calendar/base/modules/calAlarmUtils.jsm
calendar/base/modules/calAuthUtils.jsm
calendar/base/modules/calExtract.jsm
calendar/base/modules/calItipUtils.jsm
calendar/base/modules/calPrintUtils.jsm
calendar/base/modules/calRecurrenceUtils.jsm
calendar/base/modules/calUtils.jsm
calendar/base/src/calAlarm.js
calendar/base/src/calAttachment.js
calendar/base/src/calCachedCalendar.js
calendar/base/src/calCalendarManager.js
calendar/base/src/calDeletedItems.js
calendar/base/src/calEvent.js
calendar/base/src/calFilter.js
calendar/base/src/calIcsParser.js
calendar/base/src/calItemBase.js
calendar/base/src/calRecurrenceInfo.js
calendar/base/src/calTimezoneService.js
calendar/base/src/calTodo.js
calendar/base/src/calUtils.js
calendar/import-export/calOutlookCSVImportExport.js
calendar/itip/calItipEmailTransport.js
calendar/lightning/components/calItipProtocolHandler.js
calendar/lightning/content/html-item-editing/react-code.js
calendar/lightning/content/imip-bar.js
calendar/lightning/content/lightning-item-iframe.js
calendar/lightning/modules/ltnInvitationUtils.jsm
calendar/providers/caldav/calDavCalendar.js
calendar/providers/caldav/calDavRequestHandlers.js
calendar/providers/composite/calCompositeCalendar.js
calendar/providers/ics/calICSCalendar.js
calendar/providers/storage/calStorageCalendar.js
calendar/providers/storage/calStorageHelpers.jsm
calendar/providers/storage/calStorageUpgrade.jsm
calendar/providers/wcap/calWcapCalendar.js
calendar/providers/wcap/calWcapCalendarItems.js
calendar/providers/wcap/calWcapSession.js
calendar/providers/wcap/calWcapUtils.js
calendar/resources/content/calendarCreation.js
calendar/resources/content/datetimepickers/datetimepickers.xml
calendar/test/mozmill/eventDialog/testEventDialog.js
calendar/test/mozmill/eventDialog/testEventDialogModificationPrompt.js
calendar/test/mozmill/recurrence/testLastDayOfMonthRecurrence.js
calendar/test/mozmill/recurrence/testWeeklyNRecurrence.js
calendar/test/mozmill/recurrence/testWeeklyUntilRecurrence.js
calendar/test/mozmill/recurrence/testWeeklyWithExceptionRecurrence.js
calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyNRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyUntilRecurrence.js
calendar/test/mozmill/recurrenceRotated/testWeeklyWithExceptionRecurrence.js
calendar/test/mozmill/shared-modules/calendar-utils.js
calendar/test/mozmill/shared-modules/timezone-utils.js
calendar/test/unit/head_consts.js
calendar/test/unit/test_alarm.js
calendar/test/unit/test_alarmservice.js
calendar/test/unit/test_attendee.js
calendar/test/unit/test_bug1204255.js
calendar/test/unit/test_bug1209399.js
calendar/test/unit/test_bug759324.js
calendar/test/unit/test_calutils.js
calendar/test/unit/test_datetime.js
calendar/test/unit/test_freebusy_service.js
calendar/test/unit/test_gdata_provider.js
calendar/test/unit/test_hashedarray.js
calendar/test/unit/test_ics_service.js
calendar/test/unit/test_items.js
calendar/test/unit/test_ltninvitationutils.js
calendar/test/unit/test_recur.js
calendar/test/unit/test_relation.js
calendar/test/unit/test_search_service.js
calendar/test/unit/test_storage.js
calendar/test/unit/test_timezone.js
calendar/test/unit/test_timezone_definition.js
calendar/test/unit/test_utils.js
--- a/calendar/.eslintrc
+++ b/calendar/.eslintrc
@@ -439,13 +439,28 @@
     "max-statements-per-line": [2, { "max": 2 }],
 
     // Disallow arrow functions where they could be confused with comparisons
     "no-confusing-arrow": 2,
 
     // Disallow Unnecessary Nested Blocks
     "no-lone-blocks": 2,
 
+    // Enforce minimum identifier length
+    "id-length": [2, {
+      "min": 3,
+      "exceptions": [
+        /* sorting */ "a", "b",
+        /* exceptions */ "e", "ex",
+        /* loop indices */ "i", "j", "k", "n",
+        /* coordinates */ "x", "y",
+        /* regexes */ "re",
+        /* known words */ "rc", "rv", "id", "OS", "os", "db",
+        /* mail/calendar words */ "to", "cc",
+        /* Components */ "Ci", "Cc", "Cu", "Cr",
+      ]
+    }],
+
     // The following rules will not be enabled currently, but are kept here for
     // easier updates in the future.
     "no-else-return": 0,
   }
 }
--- a/calendar/base/backend/icaljs/calDateTime.js
+++ b/calendar/base/backend/icaljs/calDateTime.js
@@ -56,26 +56,26 @@ calDateTime.prototype = {
     get timezone() { return new calICALJSTimezone(this.innerObject.zone); },
     set timezone(rawval) {
         unwrapSetter(ICAL.Timezone, rawval, function(val) {
             this.innerObject.zone = val;
             return val;
         }, this);
     },
 
-    resetTo: function(yr, mo, dy, hr, mi, sc, tz) {
+    resetTo: function(year, month, day, hour, minute, second, timezone) {
         this.innerObject.fromData({
-            year: yr,
-            month: mo + 1,
-            day: dy,
-            hour: hr,
-            minute: mi,
-            second: sc,
+            year: year,
+            month: month + 1,
+            day: day,
+            hour: hour,
+            minute: minute,
+            second: second,
         });
-        this.timezone = tz;
+        this.timezone = timezone;
     },
 
     reset: function() { this.innerObject.reset(); },
 
     get timezoneOffset() { return this.innerObject.utcOffset(); },
     get isDate() { return this.innerObject.isDate; },
     set isDate(val) { this.innerObject.isDate = val; },
 
--- a/calendar/base/backend/icaljs/calICSService.js
+++ b/calendar/base/backend/icaljs/calICSService.js
@@ -44,25 +44,25 @@ calIcalProperty.prototype = {
             return val;
         }
         this.valueAsIcalString = val;
         return val;
     },
 
     get valueAsIcalString() {
         let type = this.innerObject.type;
-        return this.innerObject.getValues().map(v => {
+        return this.innerObject.getValues().map(val => {
             if (type == "text") {
-                return ICAL.stringify.value(v, type, ICAL.design.icalendar);
-            } else if (typeof v == "number" || typeof v == "string") {
-                return v;
-            } else if ("toICALString" in v) {
-                return v.toICALString();
+                return ICAL.stringify.value(val, type, ICAL.design.icalendar);
+            } else if (typeof val == "number" || typeof val == "string") {
+                return val;
+            } else if ("toICALString" in val) {
+                return val.toICALString();
             } else {
-                return v.toString();
+                return val.toString();
             }
         }).join(",");
     },
     set valueAsIcalString(val) {
         let mockLine = this.propertyName + ":" + val;
         let prop = ICAL.Property.fromString(mockLine, ICAL.design.icalendar);
 
         if (this.innerObject.isMultiValue) {
@@ -107,72 +107,72 @@ calIcalProperty.prototype = {
                 // Default type doesn't match object type, so we have a VALUE
                 // parameter
                 return this.innerObject.type.toUpperCase();
             }
         }
 
         return this.innerObject.getParameter(name.toLowerCase());
     },
-    setParameter: function(n, v) {
+    setParameter: function(name, value) {
         // Similar problems for setting the value parameter. Lightning code
         // expects setting the value parameter to just change the value type
         // and attempt to use the previous value as the new one. To do this in
         // ICAL.js we need to save the value, reset the type and then try to
         // set the value again.
-        if (n == "VALUE") {
+        if (name == "VALUE") {
             let oldValues;
             let type = this.innerObject.type;
             let designSet = this.innerObject._designSet;
 
             let wasMultiValue = this.innerObject.isMultiValue;
             if (wasMultiValue) {
                 oldValues = this.innerObject.getValues();
             } else {
                 let oldValue = this.innerObject.getFirstValue();
                 oldValues = oldValue ? [oldValue] : [];
             }
 
-            this.innerObject.resetType(v.toLowerCase());
+            this.innerObject.resetType(value.toLowerCase());
             try {
                 oldValues = oldValues.map(oldValue => {
                     let strvalue = ICAL.stringify.value(oldValue.toString(), type, designSet);
-                    return ICAL.parse._parseValue(strvalue, v, designSet);
+                    return ICAL.parse._parseValue(strvalue, value, designSet);
                 });
             } catch (e) {
                 // If there was an error reparsing the value, then just keep it
                 // empty.
                 oldValues = null;
             }
 
             if (oldValues && oldValues.length) {
                 if (wasMultiValue && this.innerObject.isMultiValue) {
                     this.innerObject.setValues(oldValues);
                 } else {
                     this.innerObject.setValue(oldValues.join(","));
                 }
             }
         } else {
-            this.innerObject.setParameter(n.toLowerCase(), v);
+            this.innerObject.setParameter(name.toLowerCase(), value);
         }
     },
-    removeParameter: function(n) {
+    removeParameter: function(name) {
         // Again, VALUE needs special handling. Removing the value parameter is
         // kind of like resetting it to the default type. So find out the
         // default type and then set the value parameter to it.
-        if (n == "VALUE") {
+        if (name == "VALUE") {
             let propname = this.innerObject.name.toLowerCase();
             if (propname in ICAL.design.icalendar.property) {
                 let details = ICAL.design.icalendar.property[propname];
                 if ("defaultType" in details) {
                     this.setParameter("VALUE", details.defaultType);
                 }
             }
         } else {
-            this.innerObject.removeParameter(n.toLowerCase());
+            this.innerObject.removeParameter(name.toLowerCase());
         }
     },
 
     clearXParameters: function() {
         cal.WARN("calIICSService::clearXParameters is no longer implemented, " +
                  "please use removeParameter");
     },
 
@@ -405,45 +405,45 @@ calIcalComponent.prototype = {
         while (vcalendar && vcalendar.componentType != "VCALENDAR") {
             vcalendar = vcalendar.parent;
         }
         return vcalendar || this;
     },
 
     addProperty: function(prop) {
         try {
-            let dt = prop.valueAsDatetime;
-            if (dt && dt.timezone) {
-                this._getNextParentVCalendar().addTimezoneReference(dt.timezone);
+            let datetime = prop.valueAsDatetime;
+            if (datetime && datetime.timezone) {
+                this._getNextParentVCalendar().addTimezoneReference(datetime.timezone);
             }
         } catch (e) {
             // If there is an issue adding the timezone reference, don't make
             // that break adding the property.
         }
 
         let jsprop = unwrapSingle(ICAL.Property, prop);
         this.innerObject.addProperty(jsprop);
     },
 
-    addTimezoneReference: function(tz) {
-        if (tz) {
-            if (!(tz.tzid in this.mReferencedZones) &&
+    addTimezoneReference: function(timezone) {
+        if (timezone) {
+            if (!(timezone.tzid in this.mReferencedZones) &&
                 this.componentType == "VCALENDAR") {
-                let comp = tz.icalComponent;
+                let comp = timezone.icalComponent;
                 if (comp) {
                     this.addSubcomponent(comp);
                 }
             }
 
-            this.mReferencedZones[tz.tzid] = tz;
+            this.mReferencedZones[timezone.tzid] = timezone;
         }
     },
 
     getReferencedTimezones: function(aCount) {
-        let vals = Object.keys(this.mReferencedZones).map(tz => this.mReferencedZones[tz]);
+        let vals = Object.keys(this.mReferencedZones).map(timezone => this.mReferencedZones[timezone]);
         aCount.value = vals.length;
         return vals;
     },
 
     serializeToICSStream: function() {
         let unicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
                                          .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
         unicodeConverter.charset = "UTF-8";
--- a/calendar/base/content/agenda-listbox.js
+++ b/calendar/base/content/agenda-listbox.js
@@ -616,19 +616,19 @@ agendaListbox.refreshCalendarQuery = fun
             }
             for (let item of aItems) {
                 this.agendaListbox.addItem(item);
             }
         },
 
         cancel: function() {
             this.cancelled = true;
-            let op = cal.wrapInstance(this.operation, Components.interfaces.calIOperation);
-            if (op && op.isPending) {
-                op.cancel();
+            let operation = cal.wrapInstance(this.operation, Components.interfaces.calIOperation);
+            if (operation && operation.isPending) {
+                operation.cancel();
                 this.operation = null;
             }
         },
 
         execute: function() {
             if (!(aStart || aEnd || aCalendar)) {
                 this.agendaListbox.removeListItems();
             }
@@ -660,20 +660,20 @@ agendaListbox.refreshCalendarQuery = fun
                     this.agendaListbox.mPendingRefreshJobs.get(this.calId).cancel();
                     this.agendaListbox.mPendingRefreshJobs.delete(this.calId);
                 }
             }
             this.calendar = aCalendar;
 
             let filter = this.calendar.ITEM_FILTER_CLASS_OCCURRENCES |
                          this.calendar.ITEM_FILTER_TYPE_EVENT;
-            let op = this.calendar.getItems(filter, 0, aStart, aEnd, this);
-            op = cal.wrapInstance(op, Components.interfaces.calIOperation);
-            if (op && op.isPending) {
-                this.operation = op;
+            let operation = this.calendar.getItems(filter, 0, aStart, aEnd, this);
+            operation = cal.wrapInstance(operation, Components.interfaces.calIOperation);
+            if (operation && operation.isPending) {
+                this.operation = operation;
                 this.agendaListbox.mPendingRefreshJobs.set(this.calId, this);
             }
         }
     };
 
     refreshJob.execute();
 };
 
--- a/calendar/base/content/calendar-base-view.xml
+++ b/calendar/base/content/calendar-base-view.xml
@@ -415,19 +415,19 @@
           for (let i = 0; i < labeldayboxkids.length; i++) {
               labeldayboxkids[i].shortWeekNames = useShortNames;
           }
         ]]></body>
       </method>
 
       <method name="today">
         <body><![CDATA[
-          let d = cal.jsDateToDateTime(new Date()).getInTimezone(this.mTimezone);
-          d.isDate = true;
-          return d;
+          let date = cal.jsDateToDateTime(new Date()).getInTimezone(this.mTimezone);
+          date.isDate = true;
+          return date;
         ]]></body>
       </method>
 
       <method name="isVisible">
         <body><![CDATA[
             return (this.nodeName == currentView().nodeName);
         ]]></body>
       </method>
@@ -483,19 +483,19 @@
                           this.calView.doAddItem(item);
                       }
                   }
               },
 
               cancel: function() {
                   this.calView.mLog.info("Refresh cancelled for calendar " + this.calId);
                   this.cancelled = true;
-                  let op = cal.wrapInstance(this.operation, Components.interfaces.calIOperation);
-                  if (op && op.isPending) {
-                      op.cancel();
+                  let operation = cal.wrapInstance(this.operation, Components.interfaces.calIOperation);
+                  if (operation && operation.isPending) {
+                      operation.cancel();
                       this.operation = null;
                   }
               },
 
               execute: function() {
                   if (!this.calView.startDate || !this.calView.endDate || !aCalendar) {
                       return;
                   }
@@ -530,24 +530,24 @@
                   }
 
                   if (this.calView.mTasksInView) {
                       filter |= this.calendar.ITEM_FILTER_TYPE_ALL;
                   } else {
                       filter |= this.calendar.ITEM_FILTER_TYPE_EVENT;
                   }
 
-                  let op = this.calendar.getItems(filter,
-                                                  0,
-                                                  this.calView.startDate,
-                                                  this.calView.queryEndDate,
-                                                  this);
-                  op = cal.wrapInstance(op, Components.interfaces.calIOperation);
-                  if (op && op.isPending) {
-                      this.operation = op;
+                  let operation = this.calendar.getItems(filter,
+                                                         0,
+                                                         this.calView.startDate,
+                                                         this.calView.queryEndDate,
+                                                         this);
+                  operation = cal.wrapInstance(operation, Components.interfaces.calIOperation);
+                  if (operation && operation.isPending) {
+                      this.operation = operation;
                       this.calView.mPendingRefreshJobs.set(this.calId, this);
                   }
               }
           };
 
           refreshJob.execute();
         ]]></body>
       </method>
--- a/calendar/base/content/calendar-invitations-manager.js
+++ b/calendar/base/content/calendar-invitations-manager.js
@@ -16,19 +16,19 @@ var gInvitationsRequestManager = {
     mRequestStatusList: {},
 
     /**
      * Add a request to the request manager.
      *
      * @param calendar    The calendar to add for.
      * @param op          The operation to add
      */
-    addRequestStatus: function(calendar, op) {
-        if (op) {
-            this.mRequestStatusList[calendar.id] = op;
+    addRequestStatus: function(calendar, operation) {
+        if (operation) {
+            this.mRequestStatusList[calendar.id] = operation;
         }
     },
 
     /**
      * Cancel all pending requests
      */
     cancelPendingRequests: function() {
         for (let id in this.mRequestStatusList) {
@@ -202,25 +202,25 @@ InvitationsManager.prototype = {
                 opListener.onOperationComplete();
                 continue;
             }
 
             try {
                 calendar = calendar.QueryInterface(Components.interfaces.calICalendar);
                 let endDate = this.mStartDate.clone();
                 endDate.year += 1;
-                let op = calendar.getItems(Components.interfaces.calICalendar.ITEM_FILTER_REQUEST_NEEDS_ACTION |
-                                           Components.interfaces.calICalendar.ITEM_FILTER_TYPE_ALL |
-                                           // we need to retrieve by occurrence to properly filter exceptions,
-                                           // should be fixed with bug 416975
-                                           Components.interfaces.calICalendar.ITEM_FILTER_CLASS_OCCURRENCES,
-                                           0, this.mStartDate,
-                                           endDate /* we currently cannot pass null here, because of bug 416975 */,
-                                           opListener);
-                gInvitationsRequestManager.addRequestStatus(calendar, op);
+                let operation = calendar.getItems(Components.interfaces.calICalendar.ITEM_FILTER_REQUEST_NEEDS_ACTION |
+                                                  Components.interfaces.calICalendar.ITEM_FILTER_TYPE_ALL |
+                                                  // we need to retrieve by occurrence to properly filter exceptions,
+                                                  // should be fixed with bug 416975
+                                                  Components.interfaces.calICalendar.ITEM_FILTER_CLASS_OCCURRENCES,
+                                                  0, this.mStartDate,
+                                                  endDate /* we currently cannot pass null here, because of bug 416975 */,
+                                                  opListener);
+                gInvitationsRequestManager.addRequestStatus(calendar, operation);
             } catch (exc) {
                 opListener.onOperationComplete();
                 ERROR(exc);
             }
         }
     },
 
     /**
--- a/calendar/base/content/calendar-month-view.xml
+++ b/calendar/base/content/calendar-month-view.xml
@@ -77,38 +77,38 @@
             return this.mOccurrence;
         ]]></getter>
         <setter><![CDATA[
           ASSERT(!this.mOccurrence, "Code changes needed to set the occurrence twice", true);
           this.mOccurrence = val;
           if (cal.isEvent(val)) {
             if (!val.startDate.isDate) {
               let label = document.getAnonymousElementByAttribute(this, "anonid", "item-label");
-              let df = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
-                                 .getService(Components.interfaces.calIDateTimeFormatter);
+              let formatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
+                                        .getService(Components.interfaces.calIDateTimeFormatter);
               let timezone = this.calendarView ? this.calendarView.mTimezone
                                                : calendarDefaultTimezone();
               let parentDate = ensureDateTime(this.parentBox.date);
               let startTime = val.startDate.getInTimezone(timezone);
               let endTime = val.endDate.getInTimezone(timezone);
               let nextDay = parentDate.clone();
               nextDay.day++;
               let comp = endTime.compare(nextDay);
               if (startTime.compare(parentDate) == -1) {
                 if (comp == 1) {
                   label.value = "↔";
                 } else if (comp == 0) {
                   label.value = "↤";
                 } else {
-                  label.value = "⇥ " + df.formatTime(endTime);
+                  label.value = "⇥ " + formatter.formatTime(endTime);
                 }
               } else if (comp == 1) {
-                label.value = "⇤ " + df.formatTime(startTime);
+                label.value = "⇤ " + formatter.formatTime(startTime);
               } else {
-                label.value = df.formatTime(startTime);
+                label.value = formatter.formatTime(startTime);
               }
               label.setAttribute("time", "true");
             }
           }
 
           this.setEditableLabel();
           this.setCSSClasses();
           return val;
@@ -783,43 +783,43 @@
             if (finished) {
               row.setAttribute("collapsed", true);
               continue;
             } else {
               row.removeAttribute("collapsed");
             }
             for (let j = 0; j < row.childNodes.length; j++) {
               let daybox = row.childNodes[j];
-              let dt = dateList[dateBoxes.length];
+              let date = dateList[dateBoxes.length];
 
               // Remove the attribute "relation" for all the column headers.
               // Consider only the first row index otherwise it will be
               // removed again afterwards the correct setting.
               if (i == 0) {
                   this.labeldaybox.childNodes[j].removeAttribute("relation");
               }
 
               daybox.setAttribute("context", this.getAttribute("context"));
               daybox.setAttribute("item-context", this.getAttribute("item-context") || this.getAttribute("context"));
 
               // Set the box-class depending on if this box displays a day in
               // the month being currently shown or not.
               let boxClass;
               if (this.showFullMonth) {
                   boxClass = "calendar-month-day-box-" +
-                             (mainMonth == dt.month ? "current-month" : "other-month");
+                             (mainMonth == date.month ? "current-month" : "other-month");
               } else {
                   boxClass = "calendar-month-day-box-current-month";
               }
-              if (this.mDaysOffArray.some(dayOffNum => dayOffNum == dt.weekday)) {
+              if (this.mDaysOffArray.some(dayOffNum => dayOffNum == date.weekday)) {
                 boxClass = "calendar-month-day-box-day-off " + boxClass;
               }
 
               // Set up date relations
-              switch (dt.compare(today)) {
+              switch (date.compare(today)) {
                   case -1:
                       daybox.setAttribute("relation", "past");
                       break;
                   case 0:
                       daybox.setAttribute("relation", "today");
                       this.labeldaybox.childNodes[j].setAttribute("relation", "today");
                       break;
                   case 1:
@@ -834,34 +834,34 @@
                   let isDayOff = this.mDaysOffArray.includes((j + this.mWeekStartOffset) % 7);
                   if (this.mDisplayDaysOff || !isDayOff) {
                     weekLabelColumnPos = j;
                   }
                 }
                 // Build and set the label.
                 if (j == weekLabelColumnPos) {
                   weekLabel.removeAttribute("hidden");
-                  let weekNumber = cal.getWeekInfoService().getWeekTitle(dt);
+                  let weekNumber = cal.getWeekInfoService().getWeekTitle(date);
                   let weekString = cal.calGetString("calendar", "abbreviationOfWeek", [weekNumber]);
                   weekLabel.value = weekString;
                 } else {
                   weekLabel.hidden = true;
                 }
               }
 
               daybox.setAttribute("class", boxClass);
 
-              daybox.setDate(dt);
-              if (dt.day == 1 || dt.day == dt.endOfMonth.day) {
+              daybox.setDate(date);
+              if (date.day == 1 || date.day == date.endOfMonth.day) {
                 daybox.showMonthLabel = true;
               } else {
                 daybox.showMonthLabel = false;
               }
               daybox.calendarView = this;
-              daybox.date = dt;
+              daybox.date = date;
               dateBoxes.push(daybox);
 
               // If we've now assigned all of our dates, set this to true so we
               // know we can just collapse the rest of the rows.
               if (dateBoxes.length == dateList.length) {
                 finished = true;
               }
             }
--- a/calendar/base/content/calendar-multiday-view.xml
+++ b/calendar/base/content/calendar-multiday-view.xml
@@ -958,40 +958,40 @@
               //       |______|      |
               //       |      |      |
               //       |OPEN! |      |<--Our item's start time might be here
               //       |      |______|
               //       |      |      |
               //
               // Remember that any time we're starting a new blob, colEndArray
               // will be empty, but that's ok.
-              for (let ii = 0; ii < colEndArray.length; ++ii) {
-                  let colEnd = colEndArray[ii].layoutEnd;
+              for (let j = 0; j < colEndArray.length; ++j) {
+                  let colEnd = colEndArray[j].layoutEnd;
                   if (colEnd.compare(curItemInfo.layoutStart) != 1) {
                       // Yay, we can jump into this column
-                      colEndArray[ii] = curItemInfo;
+                      colEndArray[j] = curItemInfo;
 
                       // Check and see if there are any adjacent columns we can
                       // jump into as well.
-                      let lastCol = Number(ii) + 1;
+                      let lastCol = Number(j) + 1;
                       while (lastCol < colEndArray.length) {
                           let nextColEnd = colEndArray[lastCol].layoutEnd;
                           // If the next column's item ends after we start, we
                           // can't expand any further
                           if (nextColEnd.compare(curItemInfo.layoutStart) == 1) {
                               break;
                           }
                           colEndArray[lastCol] = curItemInfo;
                           lastCol++;
                       }
                       // Now construct the info we need to push into the blob
                       currentBlob.push({
                           itemInfo: curItemInfo,
-                          startCol: ii,
-                          colSpan: lastCol - ii
+                          startCol: j,
+                          colSpan: lastCol - j
                       });
 
                       // Update latestItemEnd
                       if (latestItemEnd &&
                           curItemInfo.layoutEnd.compare(latestItemEnd) == 1) {
                           latestItemEnd = curItemInfo.layoutEnd;
                       }
                       placedItem = true;
@@ -1015,39 +1015,39 @@
               //       |      |______|      |
               //       |      |      |______|
               //       |      |_____________|
               //       |      |ev2          |
               //       |______|             |<--If our item's start time is
               //       |      |_____________|   here, we can shrink ev2 and jump
               //       |      |      |      |   in column #3
               //
-              for (let jj = 1; jj < colEndArray.length; ++jj) {
-                  if (colEndArray[jj].event.hashId == colEndArray[jj - 1].event.hashId) {
+              for (let j = 1; j < colEndArray.length; ++j) {
+                  if (colEndArray[j].event.hashId == colEndArray[j - 1].event.hashId) {
                       // Good we found a item that spanned multiple columns.
                       // Find it in the blob so we can modify its properties
-                      for (let kk in currentBlob) {
-                          if (currentBlob[kk].itemInfo.event.hashId == colEndArray[jj].event.hashId) {
+                      for (let blobKey in currentBlob) {
+                          if (currentBlob[blobKey].itemInfo.event.hashId == colEndArray[j].event.hashId) {
                               // Take all but the first spot that the item spanned
-                              let spanOfShrunkItem = currentBlob[kk].colSpan;
+                              let spanOfShrunkItem = currentBlob[blobKey].colSpan;
                               currentBlob.push({
                                   itemInfo: curItemInfo,
-                                  startCol: Number(currentBlob[kk].startCol) + 1,
+                                  startCol: Number(currentBlob[blobKey].startCol) + 1,
                                   colSpan: spanOfShrunkItem - 1
                               });
 
                               // Update colEndArray
-                              for (let ll = jj; ll < jj + spanOfShrunkItem - 1; ll++) {
-                                  colEndArray[ll] = curItemInfo;
+                              for (let k = j; k < j + spanOfShrunkItem - 1; k++) {
+                                  colEndArray[k] = curItemInfo;
                               }
 
                               // Modify the data on the old item
-                              currentBlob[kk] = {
-                                  itemInfo: currentBlob[kk].itemInfo,
-                                  startCol: currentBlob[kk].startCol,
+                              currentBlob[blobKey] = {
+                                  itemInfo: currentBlob[blobKey].itemInfo,
+                                  startCol: currentBlob[blobKey].startCol,
                                   colSpan: 1
                               };
                               // Update latestItemEnd
                               if (latestItemEnd &&
                                   curItemInfo.layoutEnd.compare(latestItemEnd) == 1) {
                                   latestItemEnd = curItemInfo.layoutEnd;
                               }
                               break; // Stop iterating through currentBlob
@@ -1070,24 +1070,24 @@
               // All the items in the last column, except for the one* that
               // conflicts with the item we're trying to place, need to have
               // their span extended by 1, since we're adding the new column
               //
               // * Note that there can only be one, because we sorted our
               //   events by start time, so this event must start later than
               //   the start of any possible conflicts.
               let lastColNum = colEndArray.length;
-              for (let mm in currentBlob) {
-                  let mmEnd = currentBlob[mm].itemInfo.layoutEnd;
-                  if (currentBlob[mm].startCol + currentBlob[mm].colSpan == lastColNum &&
-                      mmEnd.compare(curItemInfo.layoutStart) != 1) {
-                      currentBlob[mm] = {
-                          itemInfo: currentBlob[mm].itemInfo,
-                          startCol: currentBlob[mm].startCol,
-                          colSpan: currentBlob[mm].colSpan + 1
+              for (let blobKey in currentBlob) {
+                  let blobKeyEnd = currentBlob[blobKey].itemInfo.layoutEnd;
+                  if (currentBlob[blobKey].startCol + currentBlob[blobKey].colSpan == lastColNum &&
+                      blobKeyEnd.compare(curItemInfo.layoutStart) != 1) {
+                      currentBlob[blobKey] = {
+                          itemInfo: currentBlob[blobKey].itemInfo,
+                          startCol: currentBlob[blobKey].startCol,
+                          colSpan: currentBlob[blobKey].colSpan + 1
                       };
                   }
               }
               currentBlob.push({
                   itemInfo: curItemInfo,
                   startCol: colEndArray.length,
                   colSpan: 1
               });
@@ -2445,20 +2445,20 @@
         }
       ]]></handler>
 
       <handler event="mousemove"><![CDATA[
         if (!this.mInMouseDown) {
             return;
         }
 
-        let dx = Math.abs(event.screenX - this.mMouseX);
-        let dy = Math.abs(event.screenY - this.mMouseY);
+        let deltaX = Math.abs(event.screenX - this.mMouseX);
+        let deltaY = Math.abs(event.screenY - this.mMouseY);
         // more than a 3 pixel move?
-        if ((dx * dx + dy * dy) > 9) {
+        if ((deltaX * deltaX + deltaY * deltaY) > 9) {
             if (this.parentColumn) {
                 if (this.editingTimer) {
                     clearTimeout(this.editingTimer);
                     this.editingTimer = null;
                 }
 
                 this.calendarView.setSelectedItems(1, [this.mOccurrence]);
 
@@ -2835,19 +2835,19 @@
           targetDate.isDate = true;
 
           if (this.mStartDate && this.mEndDate) {
               if (this.mStartDate.compare(targetDate) <= 0 &&
                   this.mEndDate.compare(targetDate) >= 0) {
                   return;
               }
           } else if (this.mDateList) {
-              for (let d of this.mDateList) {
+              for (let date of this.mDateList) {
                   // if date is already visible, nothing to do
-                  if (d.compare(targetDate) == 0) {
+                  if (date.compare(targetDate) == 0) {
                       return;
                   }
               }
           }
 
           // if we're only showing one date, then continue
           // to only show one date; otherwise, show the week.
           if (this.numVisibleDates == 1) {
@@ -2914,24 +2914,24 @@
         ]]></body>
       </method>
 
       <method name="getDateList">
         <parameter name="aCount"/>
         <body><![CDATA[
            let dates = [];
            if (this.mStartDate && this.mEndDate) {
-               let d = this.mStartDate.clone();
-               while (d.compare(this.mEndDate) <= 0) {
+               let date = this.mStartDate.clone();
+               while (date.compare(this.mEndDate) <= 0) {
                    dates.push(d.clone());
-                   d.day += 1;
+                   date.day += 1;
                }
            } else if (this.mDateList) {
-               for (let d of this.mDateList) {
-                   dates.push(d.clone());
+               for (let date of this.mDateList) {
+                   dates.push(date.clone());
                }
            }
 
            aCount.value = dates.length;
            return dates;
         ]]></body>
       </method>
 
@@ -3165,20 +3165,20 @@
 
           let count = 0;
 
           if (!this.mStartDate || !this.mEndDate) {
             // The view has not been initialized, so there are 0 visible dates.
             return count;
           }
 
-          let d = this.mStartDate.clone();
-          while (d.compare(this.mEndDate) <= 0) {
+          let date = this.mStartDate.clone();
+          while (date.compare(this.mEndDate) <= 0) {
             count++;
-            d.day += 1;
+            date.day += 1;
           }
 
           return count;
         ]]></getter>
       </property>
 
       <property name="orient">
         <getter><![CDATA[return this.getAttribute("orient") || "vertical";]]></getter>
@@ -3335,68 +3335,68 @@
           // get today's date
           let today = this.today();
           let counter = 0;
           let dayboxkids = daybox.childNodes;
           let headerboxkids = headerdaybox.childNodes;
           let labelboxkids = this.labeldaybox.childNodes;
           let updateTimeIndicator = false;
 
-          for (let d of computedDateList) {
+          for (let date of computedDateList) {
               let dayEventsBox;
               if (counter < dayboxkids.length) {
                   dayEventsBox = dayboxkids[counter];
                   dayEventsBox.removeAttribute("relation");
                   dayEventsBox.mEventInfos = [];
               } else {
                   dayEventsBox = createXULElement("calendar-event-column");
                   dayEventsBox.setAttribute("flex", "1");
                   daybox.appendChild(dayEventsBox);
               }
-              setUpDayEventsBox(dayEventsBox, d);
+              setUpDayEventsBox(dayEventsBox, date);
 
               let dayHeaderBox;
               if (counter < headerboxkids.length) {
                   dayHeaderBox = headerboxkids[counter];
                   // Delete backwards to make sure we get them all
                   // and delete until no more elements are left.
                   while (dayHeaderBox.mItemBoxes.length != 0) {
                       let num = dayHeaderBox.mItemBoxes.length;
                       dayHeaderBox.deleteEvent(dayHeaderBox.mItemBoxes[num-1].occurrence);
                   }
               } else {
                   dayHeaderBox = createXULElement("calendar-header-container");
                   dayHeaderBox.setAttribute("flex", "1");
                   headerdaybox.appendChild(dayHeaderBox);
               }
-              setUpDayHeaderBox(dayHeaderBox, d);
-
-              if (this.mDaysOffArray.indexOf(d.weekday) >= 0) {
+              setUpDayHeaderBox(dayHeaderBox, date);
+
+              if (this.mDaysOffArray.indexOf(date.weekday) >= 0) {
                   dayEventsBox.dayOff = true;
                   dayHeaderBox.setAttribute("weekend", "true");
               } else {
                   dayEventsBox.dayOff = false;
                   dayHeaderBox.removeAttribute("weekend");
               }
               let labelbox;
               if (counter < labelboxkids.length) {
                   labelbox = labelboxkids[counter];
-                  labelbox.date = d;
+                  labelbox.date = date;
               } else {
                   labelbox = createXULElement("calendar-day-label");
                   labelbox.setAttribute("orient", otherorient);
                   this.labeldaybox.appendChild(labelbox);
-                  labelbox.date = d;
+                  labelbox.date = date;
               }
               // Set attributes for date relations and for the time indicator.
               let headerDayBox = document.getAnonymousElementByAttribute(
                                      this, "anonid", "headerdaybox");
               headerDayBox.removeAttribute("todaylastinview");
               dayEventsBox.timeIndicatorBox.setAttribute("hidden", "true");
-              switch (d.compare(today)) {
+              switch (date.compare(today)) {
                   case -1:
                       dayHeaderBox.setAttribute("relation", "past");
                       dayEventsBox.setAttribute("relation", "past");
                       labelbox.setAttribute("relation", "past");
                       break;
                   case 0:
                       let relation_ = this.numVisibleDates == 1 ? "today1day" : "today";
                       dayHeaderBox.setAttribute("relation", relation_);
@@ -3418,20 +3418,20 @@
                   case 1:
                       dayHeaderBox.setAttribute("relation", "future");
                       dayEventsBox.setAttribute("relation", "future");
                       labelbox.setAttribute("relation", "future");
                       break;
               }
               // We don't want to actually mess with our original dates, plus
               // they're likely to be immutable.
-              let d2 = d.clone();
-              d2.isDate = true;
-              d2.makeImmutable();
-              this.mDateColumns.push({ date: d2, column: dayEventsBox, header: dayHeaderBox });
+              let date2 = date.clone();
+              date2.isDate = true;
+              date2.makeImmutable();
+              this.mDateColumns.push({ date: date2, column: dayEventsBox, header: dayHeaderBox });
               counter++;
           }
 
           // Remove any extra columns that may have been hanging around
           function removeExtraKids(elem) {
               while (counter < elem.childNodes.length) {
                   elem.childNodes[counter].remove();
               }
@@ -3549,20 +3549,20 @@
             return columns;
           }
 
           // Note that these may be dates or datetimes
           let startDate = aItem.startDate || aItem.entryDate || aItem.dueDate;
           if (!startDate) {
               return columns;
           }
-          let tz = this.mDateColumns[0].date.timezone;
-          let targetDate = startDate.getInTimezone(tz);
+          let timezone = this.mDateColumns[0].date.timezone;
+          let targetDate = startDate.getInTimezone(timezone);
           let finishDate = (aItem.endDate || aItem.dueDate || aItem.entryDate || startDate)
-                               .getInTimezone(tz);
+                               .getInTimezone(timezone);
 
           if (!targetDate.isDate) {
             // Set the time to 00:00 so that we get all the boxes
             targetDate.hour = 0;
             targetDate.minute = 0;
             targetDate.second = 0;
           }
 
@@ -3596,19 +3596,21 @@
       <method name="findColumnForClientPoint">
         <parameter name="aClientX"/>
         <parameter name="aClientY"/>
         <body><![CDATA[
           if (!this.mDateColumns) {
               return null;
           }
           for (let col of this.mDateColumns) {
-              let bo = document.getAnonymousElementByAttribute(col.column, "anonid", "boxstack").boxObject;
-              if ((aClientX >= bo.screenX) && (aClientX <= (bo.screenX + bo.width)) &&
-                  (aClientY >= bo.screenY) && (aClientY <= (bo.screenY + bo.height))) {
+              let boxObject = document.getAnonymousElementByAttribute(col.column, "anonid", "boxstack").boxObject;
+              if (aClientX >= boxObject.screenX &&
+                  aClientX <= (boxObject.screenX + boxObject.width) &&
+                  aClientY >= boxObject.screenY &&
+                  aClientY <= (boxObject.screenY + boxObject.height)) {
                   return col.column;
               }
           }
           return null;
         ]]></body>
       </method>
 
       <method name="adjustScrollbarSpacersForAlldayEvents">
--- a/calendar/base/content/calendar-task-editing.js
+++ b/calendar/base/content/calendar-task-editing.js
@@ -21,22 +21,22 @@ var taskEdit = {
     get observedCalendar() {
         return this.mObservedCalendar;
     },
 
     /**
      * Set the currently observed calendar, removing listeners to any old
      * calendar set and adding listeners to the new one.
      */
-    set observedCalendar(v) {
+    set observedCalendar(aCalendar) {
         if (this.mObservedCalendar) {
             this.mObservedCalendar.removeObserver(this.calendarObserver);
         }
 
-        this.mObservedCalendar = v;
+        this.mObservedCalendar = aCalendar;
 
         if (this.mObservedCalendar) {
             this.mObservedCalendar.addObserver(this.calendarObserver);
         }
         return this.mObservedCalendar;
     },
 
     /**
--- a/calendar/base/content/calendar-task-tree.js
+++ b/calendar/base/content/calendar-task-tree.js
@@ -157,19 +157,18 @@ function contextChangeTaskProgress(aEven
  * Handler function to change the calendar of the selected tasks. The targeted
  * menuitem must have "calendar" property that implements calICalendar.
  *
  * @param aEvent      The DOM event that triggered this command.
  */
 function contextChangeTaskCalendar(aEvent) {
    startBatchTransaction();
    let tasks = getSelectedTasks(aEvent);
-   for (let t = 0; t < tasks.length; t++) {
-       let task = tasks[t];
-       let newTask = task.clone().QueryInterface(Components.interfaces.calITodo);
+   for (let task of tasks) {
+       let newTask = task.clone();
        newTask.calendar = aEvent.target.calendar;
        doTransaction("modify", newTask, newTask.calendar, task, null);
     }
     endBatchTransaction();
 }
 
 /**
  * Handler function to change the priority of the selected tasks, or of
@@ -232,18 +231,18 @@ function contextPostponeTask(aEvent, aDu
 /**
  * Modifies the selected tasks with the event dialog
  *
  * @param aEvent        The DOM event that triggered this command.
  * @param initialDate   (optional) The initial date for new task datepickers
  */
 function modifyTaskFromContext(aEvent, initialDate) {
     let tasks = getSelectedTasks(aEvent);
-    for (let t = 0; t < tasks.length; t++) {
-        modifyEventWithDialog(tasks[t], null, true, initialDate);
+    for (let task of tasks) {
+        modifyEventWithDialog(task, null, true, initialDate);
     }
  }
 
 /**
  *  Delete the current selected item with focus from the task tree
  *
  * @param aEvent          The DOM event that triggered this command.
  * @param aDoNotConfirm   If true, the user will not be asked to delete.
--- a/calendar/base/content/calendar-task-tree.xml
+++ b/calendar/base/content/calendar-task-tree.xml
@@ -942,21 +942,21 @@
 
               execute: function() {
                   if (aCalendar.id in this.binding.mPendingRefreshJobs) {
                       this.binding.mPendingRefreshJobs[aCalendar.id].cancel();
                   }
                   this.calendar = aCalendar;
                   this.items = [];
 
-                  let op = this.binding.mFilter.getItems(aCalendar,
-                                                         aCalendar.ITEM_FILTER_TYPE_TODO,
-                                                         this);
-                  if (op && op.isPending) {
-                      this.operation = op;
+                  let operation = this.binding.mFilter.getItems(aCalendar,
+                                                                aCalendar.ITEM_FILTER_TYPE_TODO,
+                                                                this);
+                  if (operation && operation.isPending) {
+                      this.operation = operation;
                       this.binding.mPendingRefreshJobs[aCalendar.id] = this;
                   }
               }
           };
 
           refreshJob.execute();
         ]]></body>
       </method>
@@ -1136,36 +1136,36 @@
 
         let tree = document.getAnonymousElementByAttribute(this, "anonid", "calendar-task-tree");
 
         // let's build the drag region
         let region = null;
         try {
           region = Components.classes["@mozilla.org/gfx/region;1"].createInstance(Components.interfaces.nsIScriptableRegion);
           region.init();
-          let obo = tree.treeBoxObject;
-          let bo = obo.treeBody.boxObject;
+          let treeBox = tree.treeBox;
+          let bodyBox = treeBox.treeBody.boxObject;
           let sel = tree.view.selection;
 
-          let rowX = bo.x;
-          let rowY = bo.y;
-          let rowHeight = obo.rowHeight;
-          let rowWidth = bo.width;
+          let rowX = bodyBox.x;
+          let rowY = bodyBox.y;
+          let rowHeight = treeBox.rowHeight;
+          let rowWidth = bodyBox.width;
 
           // add a rectangle for each visible selected row
-          for (let i = obo.getFirstVisibleRow(); i <= obo.getLastVisibleRow(); i++) {
+          for (let i = treeBox.getFirstVisibleRow(); i <= treeBox.getLastVisibleRow(); i++) {
             if (sel.isSelected(i)) {
               region.unionRect(rowX, rowY, rowWidth, rowHeight);
             }
             rowY = rowY + rowHeight;
           }
 
           // and finally, clip the result to be sure we don't spill over...
           if (!region.isEmpty()) {
-            region.intersectRect(bo.x, bo.y, bo.width, bo.height);
+            region.intersectRect(bodyBox.x, bodyBox.y, bodyBox.width, bodyBox.height);
           }
         } catch (ex) {
           ASSERT(false, "Error while building selection region: " + ex + "\n");
           region = null;
         }
         invokeEventDragSession(item, event.target);
       ]]></handler>
     </handlers>
--- a/calendar/base/content/calendar-ui-utils.js
+++ b/calendar/base/content/calendar-ui-utils.js
@@ -243,31 +243,31 @@ function removeChildren(aElement) {
 function sortCalendarArray(calendars) {
     let ret = calendars.concat([]);
     let sortOrder = {};
     let sortOrderPref = Preferences.get("calendar.list.sortOrder", "").split(" ");
     for (let i = 0; i < sortOrderPref.length; ++i) {
         sortOrder[sortOrderPref[i]] = i;
     }
     function sortFunc(cal1, cal2) {
-        let i1 = sortOrder[cal1.id] || -1;
-        let i2 = sortOrder[cal2.id] || -1;
-        if (i1 < i2) {
+        let orderIdx1 = sortOrder[cal1.id] || -1;
+        let orderIdx2 = sortOrder[cal2.id] || -1;
+        if (orderIdx1 < orderIdx2) {
             return -1;
         }
-        if (i1 > i2) {
+        if (orderIdx1 > orderIdx2) {
             return 1;
         }
         return 0;
     }
     ret.sort(sortFunc);
 
     // check and repair pref:
     let sortOrderString = Preferences.get("calendar.list.sortOrder", "");
-    let wantedOrderString = ret.map(c => c.id).join(" ");
+    let wantedOrderString = ret.map(calendar => calendar.id).join(" ");
     if (wantedOrderString != sortOrderString) {
         Preferences.set("calendar.list.sortOrder", wantedOrderString);
     }
 
     return ret;
 }
 
 /**
@@ -517,21 +517,21 @@ function menuListIndexOf(menuList, value
         }
     }
     return -1; // not found
 }
 
 /**
  * Creates the given element in the XUL namespace.
  *
- * @param el    The local name of the element to create.
- * @return      The XUL element requested.
+ * @param elem      The local name of the element to create.
+ * @return          The XUL element requested.
  */
-function createXULElement(el) {
-    return document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", el);
+function createXULElement(elem) {
+    return document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", elem);
 }
 
 /**
  * A helper function to calculate and add up certain css-values of a box.
  * It is required, that all css values can be converted to integers
  * see also
  * http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSview-getComputedStyle
  * @param aXULElement   The xul element to be inspected.
--- a/calendar/base/content/calendar-unifinder.js
+++ b/calendar/base/content/calendar-unifinder.js
@@ -331,22 +331,22 @@ function unifinderSelect(event) {
     let selectedItems = [];
     gCalendarEventTreeClicked = true;
 
     // Get the selected events from the tree
     let start = {};
     let end = {};
     let numRanges = tree.view.selection.getRangeCount();
 
-    for (let t = 0; t < numRanges; t++) {
-        tree.view.selection.getRangeAt(t, start, end);
+    for (let range = 0; range < numRanges; range++) {
+        tree.view.selection.getRangeAt(range, start, end);
 
-        for (let v = start.value; v <= end.value; v++) {
+        for (let i = start.value; i <= end.value; i++) {
             try {
-                selectedItems.push(unifinderTreeView.getItemAt(v));
+                selectedItems.push(unifinderTreeView.getItemAt(i));
             } catch (e) {
                WARN("Error getting Event from row: " + e + "\n");
             }
         }
     }
 
     if (selectedItems.length == 1) {
         // Go to the day of the selected item in the current view.
--- a/calendar/base/content/calendar-views.xml
+++ b/calendar/base/content/calendar-views.xml
@@ -89,30 +89,30 @@
                 <body><![CDATA[
                     this.displayDaysOff = !this.mWorkdaysOnly;
 
                     if (!aDate) {
                         this.refresh();
                         return;
                     }
                     aDate = aDate.getInTimezone(this.timezone);
-                    let d1 = getWeekInfoService().getStartOfWeek(aDate);
-                    let d2 = d1.clone();
-                    d2.day += 6;
-                    this.setDateRange(d1, d2);
+                    let weekStart = getWeekInfoService().getStartOfWeek(aDate);
+                    let weekEnd = weekStart.clone();
+                    weekEnd.day += 6;
+                    this.setDateRange(weekStart, weekEnd);
                     this.selectedDay = aDate;
                 ]]></body>
             </method>
             <method name="moveView">
                 <parameter name="aNumber"/>
                 <body><![CDATA[
                     if (aNumber) {
-                        let d1 = this.selectedDay.clone();
-                        d1.day += 7 * aNumber;
-                        this.goToDay(d1);
+                        let date = this.selectedDay.clone();
+                        date.day += 7 * aNumber;
+                        this.goToDay(date);
                     } else {
                         this.goToDay(now());
                     }
                 ]]></body>
             </method>
         </implementation>
     </binding>
 
@@ -180,38 +180,38 @@
                     // If aDate is null it means that only a refresh is needed
                     // without changing the start and end of the view.
                     if (aDate) {
                         aDate = aDate.getInTimezone(this.timezone);
                         // Get the first date that should be shown. This is the
                         // start of the week of the day that we're centering around
                         // adjusted for the day the week starts on and the number
                         // of previous weeks we're supposed to display.
-                        let d1 = getWeekInfoService().getStartOfWeek(aDate);
-                        d1.day -= (7 * Preferences.get("calendar.previousweeks.inview", 0));
+                        let dayStart = getWeekInfoService().getStartOfWeek(aDate);
+                        dayStart.day -= (7 * Preferences.get("calendar.previousweeks.inview", 0));
                         // The last day we're supposed to show
-                        let d2 = d1.clone();
-                        d2.day += ((7 * this.mWeeksInView) - 1);
-                        this.setDateRange(d1, d2);
+                        let dayEnd = dayStart.clone();
+                        dayEnd.day += ((7 * this.mWeeksInView) - 1);
+                        this.setDateRange(dayStart, dayEnd);
                         this.selectedDay = aDate;
                     } else {
                         this.refresh();
                     }
                 ]]></body>
             </method>
             <method name="moveView">
                 <parameter name="aNumber"/>
                 <body><![CDATA[
                     if (aNumber) {
-                        let d1 = this.startDay.clone();
+                        let date = this.startDay.clone();
                         let savedSelectedDay = this.selectedDay.clone();
                         // aNumber only corresponds to the number of weeks to move
                         // make sure to compensate for previous weeks in view too
-                        d1.day += 7 * (aNumber + Preferences.get("calendar.previousweeks.inview", 4));
-                        this.goToDay(d1);
+                        date.day += 7 * (aNumber + Preferences.get("calendar.previousweeks.inview", 4));
+                        this.goToDay(date);
                         savedSelectedDay.day += 7 * aNumber;
                         this.selectedDay = savedSelectedDay;
                     } else {
                         let date = now();
                         this.goToDay(date);
                         this.selectedDay = date;
                     }
                 ]]></body>
--- a/calendar/base/content/dialogs/calendar-creation.js
+++ b/calendar/base/content/dialogs/calendar-creation.js
@@ -5,42 +5,42 @@
 /* exported openLocalCalendar */
 
 /**
  * Shows the filepicker and creates a new calendar with a local file using the ICS
  * provider.
  */
 function openLocalCalendar() {
     const nsIFilePicker = Components.interfaces.nsIFilePicker;
-    let fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
-    fp.init(window, calGetString("calendar", "Open"), nsIFilePicker.modeOpen);
+    let picker = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
+    picker.init(window, calGetString("calendar", "Open"), nsIFilePicker.modeOpen);
     let wildmat = "*.ics";
     let description = calGetString("calendar", "filterIcs", [wildmat]);
-    fp.appendFilter(description, wildmat);
-    fp.appendFilters(nsIFilePicker.filterAll);
+    picker.appendFilter(description, wildmat);
+    picker.appendFilters(nsIFilePicker.filterAll);
 
-    if (fp.show() != nsIFilePicker.returnOK) {
+    if (picker.show() != nsIFilePicker.returnOK) {
         return;
     }
 
     let calMgr = getCalendarManager();
     let calendars = calMgr.getCalendars({});
-    if (calendars.some(x => x.uri == fp.fileURL)) {
+    if (calendars.some(x => x.uri == picker.fileURL)) {
         // The calendar already exists, select it and return.
         document.getElementById("calendar-list-tree-widget")
                 .tree.view.selection.select(index);
         return;
     }
 
-    let openCalendar = calMgr.createCalendar("ics", fp.fileURL);
+    let openCalendar = calMgr.createCalendar("ics", picker.fileURL);
 
     // Strip ".ics" from filename for use as calendar name, taken from
     // calendarCreation.js
     let fullPathRegex = new RegExp("([^/:]+)[.]ics$");
-    let prettyName = fp.fileURL.spec.match(fullPathRegex);
+    let prettyName = picker.fileURL.spec.match(fullPathRegex);
     let name;
 
     if (prettyName && prettyName.length >= 1) {
         name = decodeURIComponent(prettyName[1]);
     } else {
         name = calGetString("calendar", "untitledCalendarName");
     }
     openCalendar.name = name;
--- a/calendar/base/content/dialogs/calendar-dialog-utils.js
+++ b/calendar/base/content/dialogs/calendar-dialog-utils.js
@@ -596,34 +596,34 @@ function setupAttendees() {
                 let newCell = clonedCell.cloneNode(true);
                 let cell = row.appendChild(newCell);
                 let icon = cell.getElementsByTagName("img")[0];
                 let text = cell.getElementsByTagName("label")[0];
                 let attendee = window.attendees[attCount];
 
                 let label = (attendee.commonName && attendee.commonName.length)
                             ? attendee.commonName : attendee.toString();
-                let ut = attendee.userType || "INDIVIDUAL";
+                let userType = attendee.userType || "INDIVIDUAL";
                 let role = attendee.role || "REQ-PARTICIPANT";
-                let ps = attendee.participationStatus || "NEEDS-ACTION";
+                let partstat = attendee.participationStatus || "NEEDS-ACTION";
 
-                icon.setAttribute("partstat", ps);
-                icon.setAttribute("usertype", ut);
+                icon.setAttribute("partstat", partstat);
+                icon.setAttribute("usertype", userType);
                 icon.setAttribute("role", role);
                 cell.setAttribute("attendeeid", attendee.id);
                 cell.removeAttribute("hidden");
 
-                let utString = cal.calGetString("calendar", "dialog.tooltip.attendeeUserType2." + ut,
-                                                [attendee.toString()]);
+                let userTypeString = cal.calGetString("calendar", "dialog.tooltip.attendeeUserType2." + userType,
+                                                      [attendee.toString()]);
                 let roleString = cal.calGetString("calendar", "dialog.tooltip.attendeeRole2." + role,
-                                                  [utString]);
-                let psString = cal.calGetString("calendar", "dialog.tooltip.attendeePartStat2." + ps,
-                                                [label]);
+                                                  [userTypeString]);
+                let partstatString = cal.calGetString("calendar", "dialog.tooltip.attendeePartStat2." + partstat,
+                                                      [label]);
                 let tooltip = cal.calGetString("calendar", "dialog.tooltip.attendee.combined",
-                                               [roleString, psString]);
+                                               [roleString, partstatString]);
 
                 let del = cal.resolveDelegation(attendee, window.attendees);
                 if (del.delegators != "") {
                     del.delegators = cal.calGetString("calendar",
                                                       "dialog.attendee.append.delegatedFrom",
                                                       [del.delegators]);
                     label += " " + del.delegators;
                     tooltip += " " + del.delegators;
--- a/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-attendees.xml
@@ -226,25 +226,25 @@
               input.setAttribute("id", "attendeeCol3#" + rowNumber);
           }
 
           if (!aAttendee) {
               aAttendee = this.createAttendee();
           }
 
           // construct the display string from common name and/or email address.
-          let cn = aAttendee.commonName || "";
+          let commonName = aAttendee.commonName || "";
           let inputValue = cal.removeMailTo(aAttendee.id || "");
-          if (cn.length) {
+          if (commonName.length) {
               // Make the commonName appear in quotes if it contains a
               // character that could confuse the header parser
-              if (cn.search(/[,;<>@]/) != -1) {
-                  cn = '"' + cn + '"';
+              if (commonName.search(/[,;<>@]/) != -1) {
+                  commonName = '"' + commonName + '"';
               }
-              inputValue = inputValue.length ? cn + " <" + inputValue + ">" : cn;
+              inputValue = inputValue.length ? commonName + " <" + inputValue + ">" : commonName;
           }
 
           // trim spaces if any
           inputValue = inputValue.trim();
 
           // don't set value with null, otherwise autocomplete stops working,
           // but make sure attendee and dirty are set
           if (inputValue.length) {
@@ -488,49 +488,40 @@
         ]]></body>
     </method>
 
     <method name="_getListEntriesInt">
         <parameter name="mailingList"/>
         <parameter name="attendees"/>
         <parameter name="allListsUri"/>
         <body><![CDATA[
-            function in_list(aList, listid) {
-              for (let l = 0; l < aList.length; l++) {
-                if (aList[l] === listid) {
-                  return true;
-                }
-              }
-              return false;
-            }
-
             let addressLists = mailingList.addressLists;
             for (let i = 0; i < addressLists.length; i++) {
               let abCard = addressLists.queryElementAt(i, Components.interfaces.nsIAbCard);
               let thisId = abCard.primaryEmail;
               if (abCard.displayName.length > 0) {
                   let rCn = abCard.displayName;
                   if (rCn.includes(",")) {
                       rCn = '"' + rCn + '"';
                   }
                   thisId = rCn + " <" + thisId + ">";
               }
-              if (in_list(attendees, thisId)) {
+              if (attendees.some(att => att == thisId)) {
                 continue;
               }
 
               if (abCard.displayName.length > 0) {
-                let ml = this._findListInAddrBooks(abCard.displayName);
-                if (ml) {
-                  if (in_list(allListsUri, ml.URI)) {
+                let list = this._findListInAddrBooks(abCard.displayName);
+                if (list) {
+                  if (allListsUri.some(uri => uri == list.URI)) {
                     continue;
                   }
-                  allListsUri.push(ml.URI);
+                  allListsUri.push(list.URI);
 
-                  this._getListEntriesInt(ml, attendees, allListsUri);
+                  this._getListEntriesInt(list, attendees, allListsUri);
 
                   continue;
                 }
               }
 
               attendees.push(thisId);
             }
 
--- a/calendar/base/content/dialogs/calendar-event-dialog-recurrence-preview.xml
+++ b/calendar/base/content/dialogs/calendar-event-dialog-recurrence-preview.xml
@@ -142,25 +142,25 @@
 
           this.updateContent();
           this.updatePreview(this.mRecurrenceInfo);
         ]]></body>
       </method>
 
       <method name="updateContent">
         <body><![CDATA[
-          let dt = cal.dateTimeToJsDate(this.dateTime);
+          let date = cal.dateTimeToJsDate(this.dateTime);
           let row = document.getAnonymousElementByAttribute(
                         this, "anonid", "row");
           while (row) {
               let numChilds = row.childNodes.length - 1;
               for (let i = 0; i < numChilds; i++) {
                   let minimonth = row.childNodes[i];
-                  minimonth.showMonth(dt);
-                  dt.setMonth(dt.getMonth() + 1);
+                  minimonth.showMonth(date);
+                  date.setMonth(date.getMonth() + 1);
               }
               row = row.nextSibling;
           }
         ]]></body>
       </method>
 
       <method name="updatePreview">
         <parameter name="aRecurrenceInfo"/>
--- a/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
@@ -97,17 +97,17 @@ function initializeControls(rule) {
             }
             document.getElementById("yearly-group").selectedIndex = 0;
             setElementValue("yearly-days", aByMonthDay);
         }
     }
 
     function everyWeekDay(aByDay) {
         // Checks if aByDay contains only values from 1 to 7 with any order.
-        let mask = aByDay.reduce((v, c) => v | (1 << c), 1);
+        let mask = aByDay.reduce((value, item) => value | (1 << item), 1);
         return aByDay.length == 7 && mask == Math.pow(2, 8) - 1;
     }
 
     switch (rule.type) {
         case "DAILY":
             document.getElementById("period-list").selectedIndex = 0;
             setElementValue("daily-days", rule.interval);
             break;
@@ -502,24 +502,24 @@ function enableRecurrenceFields(aAttribu
  * XXX This function is duplicate from calendar-dialog-utils.js, which we may
  * want to include in this dialog.
  *
  * @param recurrenceInfo    An item's recurrence info to parse.
  * @return                  An array with two elements: an array of positive
  *                            rules and an array of negative rules.
  */
 function splitRecurrenceRules(recurrenceInfo) {
-    let ritems = recurrenceInfo.getRecurrenceItems({});
+    let recItems = recurrenceInfo.getRecurrenceItems({});
     let rules = [];
     let exceptions = [];
-    for (let r of ritems) {
-        if (r.isNegative) {
-            exceptions.push(r);
+    for (let recItem of recItems) {
+        if (recItem.isNegative) {
+            exceptions.push(recItem);
         } else {
-            rules.push(r);
+            rules.push(recItem);
         }
     }
     return [rules, exceptions];
 }
 
 /**
  * Handler function to update the period-deck when an item from the period-list
  * is selected. Also updates the controls on that deck.
@@ -753,20 +753,20 @@ function changeOrderForElements(aPropKey
 
     try {
         localeOrder = calGetString("calendar-event-dialog",
                                    aPropKey,
                                    aPropParams);
 
         localeOrder = localeOrder.split(" ");
     } catch (ex) {
-        let s = "The key " + aPropKey + " in calendar-event-dialog.prop" +
-                "erties has incorrect number of params. Expected " +
-                aPropParams.length + " params.";
-        Components.utils.reportError(s + " " + ex);
+        let msg = "The key " + aPropKey + " in calendar-event-dialog.prop" +
+                  "erties has incorrect number of params. Expected " +
+                  aPropParams.length + " params.";
+        Components.utils.reportError(msg + " " + ex);
         return;
     }
 
     // Add elements in the right order, removing them from their old parent
     for (let i = 0; i < aPropParams.length; i++) {
         let newEl = document.getElementById(localeOrder[i]);
         if (newEl) {
             parents[i].appendChild(newEl.parentNode.removeChild(newEl));
--- a/calendar/base/content/dialogs/calendar-event-dialog-timezone.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog-timezone.js
@@ -29,21 +29,21 @@ function onLoad() {
     if (args.calendar.getProperty("capabilities.timezones.UTC.supported") !== false) {
         addMenuItem(tzMenuPopup, UTC().displayName, UTC().tzid);
     }
 
     let enumerator = tzProvider.timezoneIds;
     let tzids = {};
     let displayNames = [];
     while (enumerator.hasMore()) {
-        let tz = tzProvider.getTimezone(enumerator.getNext());
-        if (tz && !tz.isFloating && !tz.isUTC) {
-            let displayName = tz.displayName;
+        let timezone = tzProvider.getTimezone(enumerator.getNext());
+        if (timezone && !timezone.isFloating && !timezone.isUTC) {
+            let displayName = timezone.displayName;
             displayNames.push(displayName);
-            tzids[displayName] = tz.tzid;
+            tzids[displayName] = timezone.tzid;
         }
     }
     // the display names need to be sorted
     displayNames.sort(String.localeCompare);
     for (let i = 0; i < displayNames.length; ++i) {
         let displayName = displayNames[i];
         addMenuItem(tzMenuPopup, displayName, tzids[displayName]);
     }
@@ -85,52 +85,52 @@ function findTimezone(timezone) {
 
 /**
  * Handler function to call when the timezone selection has changed. Updates the
  * timezone-time field and the timezone-stack.
  */
 function updateTimezone() {
     let menulist = document.getElementById("timezone-menulist");
     let menuitem = menulist.selectedItem;
-    let tz = window.tzProvider.getTimezone(menuitem.getAttribute("value"));
+    let timezone = window.tzProvider.getTimezone(menuitem.getAttribute("value"));
 
     // convert the date/time to the currently selected timezone
     // and display the result in the appropriate control.
     // before feeding the date/time value into the control we need
     // to set the timezone to 'floating' in order to avoid the
     // automatic conversion back into the OS timezone.
     let datetime = document.getElementById("timezone-time");
-    let time = window.time.getInTimezone(tz);
+    let time = window.time.getInTimezone(timezone);
     time.timezone = cal.floating();
     datetime.value = cal.dateTimeToJsDate(time);
 
     // don't highlight any timezone in the map by default
     let standardTZOffset = "none";
-    if (tz.isUTC) {
+    if (timezone.isUTC) {
         standardTZOffset = "+0000";
-    } else if (!tz.isFloating) {
-        let standard = tz.icalComponent.getFirstSubcomponent("STANDARD");
+    } else if (!timezone.isFloating) {
+        let standard = timezone.icalComponent.getFirstSubcomponent("STANDARD");
         // any reason why valueAsIcalString is used instead of plain value? xxx todo: ask mickey
         standardTZOffset = standard.getFirstProperty("TZOFFSETTO").valueAsIcalString;
     }
 
     let image = document.getElementById("highlighter");
     image.setAttribute("tzid", standardTZOffset);
 }
 /**
  * Handler function to be called when the accept button is pressed.
  *
  * @return      Returns true if the window should be closed
  */
 function onAccept() {
     let menulist = document.getElementById("timezone-menulist");
     let menuitem = menulist.selectedItem;
-    let timezone = menuitem.getAttribute("value");
-    let tz = window.tzProvider.getTimezone(timezone);
-    let datetime = window.time.getInTimezone(tz);
+    let timezoneString = menuitem.getAttribute("value");
+    let timezone = window.tzProvider.getTimezone(timezoneString);
+    let datetime = window.time.getInTimezone(timezone);
     window.onAcceptCallback(datetime);
     return true;
 }
 
 /**
  * Handler function to be called when the cancel button is pressed.
  *
  */
--- a/calendar/base/content/dialogs/calendar-subscriptions-dialog.js
+++ b/calendar/base/content/dialogs/calendar-subscriptions-dialog.js
@@ -101,36 +101,36 @@ function onSearch() {
     richListBox.clear();
 
     let registeredCals = {};
     for (let calendar of getCalendarManager().getCalendars({})) {
         registeredCals[calendar.id] = true;
     }
 
     let opListener = {
-        onResult: function(op, result) {
+        onResult: function(operation, result) {
             if (result) {
                 for (let calendar of result) {
                     richListBox.addCalendar(calendar, registeredCals[calendar.id]);
                 }
             }
-            if (!op.isPending) {
+            if (!operation.isPending) {
                 let statusDeck = document.getElementById("status-deck");
                 if (richListBox.getRowCount() > 0) {
                     statusDeck.selectedIndex = 0;
                 } else {
                     statusDeck.selectedIndex = 2;
                 }
             }
         }
     };
 
-    let op = getCalendarSearchService().searchForCalendars(document.getElementById("search-textbox").value,
+    let operation = getCalendarSearchService().searchForCalendars(document.getElementById("search-textbox").value,
                                                            0 /* hints */, 50, opListener);
-    if (op && op.isPending) {
+    if (operation && operation.isPending) {
         gCurrentSearchOperation = op;
         document.getElementById("status-deck").selectedIndex = 1;
     }
 }
 
 /**
  * Markes the selected item in the subscriptions-listbox for subscribing. The
  * actual subscribe happens when the window is closed.
--- a/calendar/base/content/dialogs/calendar-summary-dialog.js
+++ b/calendar/base/content/dialogs/calendar-summary-dialog.js
@@ -118,33 +118,33 @@ function onLoad() {
     let organizer = item.organizer;
     if (organizer && organizer.id) {
         document.getElementById("organizer-row").removeAttribute("hidden");
         let cell = document.getElementsByClassName("item-organizer-cell")[0];
         let text = cell.getElementsByTagName("label")[0];
         let icon = cell.getElementsByTagName("img")[0];
 
         let role = organizer.role || "REQ-PARTICIPANT";
-        let ut = organizer.userType || "INDIVIDUAL";
-        let ps = organizer.participationStatus || "NEEDS-ACTION";
+        let userType = organizer.userType || "INDIVIDUAL";
+        let partstat = organizer.participationStatus || "NEEDS-ACTION";
         let orgName = (organizer.commonName && organizer.commonName.length)
-                      ? organizer.commonName : organizer.toString();
-        let utString = cal.calGetString("calendar", "dialog.tooltip.attendeeUserType2." + ut,
-                                        [organizer.toString()]);
+                       ? organizer.commonName : organizer.toString();
+        let userTypeString = cal.calGetString("calendar", "dialog.tooltip.attendeeUserType2." + userType,
+                                              [organizer.toString()]);
         let roleString = cal.calGetString("calendar", "dialog.tooltip.attendeeRole2." + role,
-                                          [utString]);
-        let psString = cal.calGetString("calendar", "dialog.tooltip.attendeePartStat2." + ps,
-                                       [orgName]);
-        let tt = cal.calGetString("calendar", "dialog.tooltip.attendee.combined",
-                                  [roleString, psString]);
+                                          [userTypeString]);
+        let partstatString = cal.calGetString("calendar", "dialog.tooltip.attendeePartStat2." + partstat,
+                                             [orgName]);
+        let tooltip = cal.calGetString("calendar", "dialog.tooltip.attendee.combined",
+                                       [roleString, partstatString]);
 
         text.setAttribute("value", orgName);
-        cell.setAttribute("tooltiptext", tt);
-        icon.setAttribute("partstat", ps);
-        icon.setAttribute("usertype", ut);
+        cell.setAttribute("tooltiptext", tooltip);
+        icon.setAttribute("partstat", partstat);
+        icon.setAttribute("usertype", userType);
         icon.setAttribute("role", role);
     }
 
     let status = item.getProperty("STATUS");
     if (status && status.length) {
         let statusRow = document.getElementById("status-row");
         for (let i = 0; i < statusRow.childNodes.length; i++) {
             if (statusRow.childNodes[i].getAttribute("status") == status) {
--- a/calendar/base/content/import-export.js
+++ b/calendar/base/content/import-export.js
@@ -16,22 +16,22 @@ var MODE_TRUNCATE = 0x20;
  * Shows a file dialog, reads the selected file(s) and tries to parse events from it.
  *
  * @param aCalendar  (optional) If specified, the items will be imported directly
  *                              into the calendar
  */
 function loadEventsFromFile(aCalendar) {
     const nsIFilePicker = Components.interfaces.nsIFilePicker;
 
-    let fp = Components.classes["@mozilla.org/filepicker;1"]
-                       .createInstance(nsIFilePicker);
-    fp.init(window,
-            calGetString("calendar", "filepickerTitleImport"),
-            nsIFilePicker.modeOpen);
-    fp.defaultExtension = "ics";
+    let picker = Components.classes["@mozilla.org/filepicker;1"]
+                           .createInstance(nsIFilePicker);
+    picker.init(window,
+                calGetString("calendar", "filepickerTitleImport"),
+                nsIFilePicker.modeOpen);
+    picker.defaultExtension = "ics";
 
     // Get a list of importers
     let contractids = [];
     let catman = Components.classes["@mozilla.org/categorymanager;1"]
                            .getService(Components.interfaces.nsICategoryManager);
     let catenum = catman.enumerateCategory("cal-importers");
     let currentListLength = 0;
     let defaultCIDIndex = 0;
@@ -44,48 +44,48 @@ function loadEventsFromFile(aCalendar) {
             importer = Components.classes[contractid]
                                  .getService(Components.interfaces.calIImporter);
         } catch (e) {
             cal.WARN("Could not initialize importer: " + contractid + "\nError: " + e);
             continue;
         }
         let types = importer.getFileTypes({});
         for (let type of types) {
-            fp.appendFilter(type.description, type.extensionFilter);
-            if (type.extensionFilter == "*." + fp.defaultExtension) {
-                fp.filterIndex = currentListLength;
+            picker.appendFilter(type.description, type.extensionFilter);
+            if (type.extensionFilter == "*." + picker.defaultExtension) {
+                picker.filterIndex = currentListLength;
                 defaultCIDIndex = currentListLength;
             }
             contractids.push(contractid);
             currentListLength++;
         }
     }
 
-    let rv = fp.show();
+    let rv = picker.show();
 
     if (rv != nsIFilePicker.returnCancel &&
-        fp.file && fp.file.path && fp.file.path.length > 0) {
-        let filterIndex = fp.filterIndex;
-        if (fp.filterIndex < 0 || fp.filterIndex > contractids.length) {
+        picker.file && picker.file.path && picker.file.path.length > 0) {
+        let filterIndex = picker.filterIndex;
+        if (picker.filterIndex < 0 || picker.filterIndex > contractids.length) {
             // For some reason the wrong filter was selected, assume default extension
             filterIndex = defaultCIDIndex;
         }
 
-        let filePath = fp.file.path;
+        let filePath = picker.file.path;
         let importer = Components.classes[contractids[filterIndex]]
                                  .getService(Components.interfaces.calIImporter);
 
         const nsIFileInputStream = Components.interfaces.nsIFileInputStream;
 
         let inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"]
                                     .createInstance(nsIFileInputStream);
         let items = [];
 
         try {
-            inputStream.init(fp.file, MODE_RDONLY, parseInt("0444", 8), {});
+            inputStream.init(picker.file, MODE_RDONLY, parseInt("0444", 8), {});
             items = importer.importFromStream(inputStream, {});
         } catch (ex) {
             switch (ex.result) {
                 case Components.interfaces.calIErrors.INVALID_TIMEZONE:
                     showError(calGetString("calendar", "timezoneError", [filePath]));
                     break;
                 default:
                     showError(calGetString("calendar", "unableToRead") + filePath + "\n" + ex);
@@ -202,32 +202,32 @@ function putItemsIntoCal(destCal, aItems
 function saveEventsToFile(calendarEventArray, aDefaultFileName) {
     if (!calendarEventArray || !calendarEventArray.length) {
         return;
     }
 
     // Show the 'Save As' dialog and ask for a filename to save to
     const nsIFilePicker = Components.interfaces.nsIFilePicker;
 
-    let fp = Components.classes["@mozilla.org/filepicker;1"]
+    let picker = Components.classes["@mozilla.org/filepicker;1"]
                        .createInstance(nsIFilePicker);
 
-    fp.init(window,
-            calGetString("calendar", "filepickerTitleExport"),
-            nsIFilePicker.modeSave);
+    picker.init(window,
+                calGetString("calendar", "filepickerTitleExport"),
+                nsIFilePicker.modeSave);
 
     if (aDefaultFileName && aDefaultFileName.length && aDefaultFileName.length > 0) {
-        fp.defaultString = aDefaultFileName;
+        picker.defaultString = aDefaultFileName;
     } else if (calendarEventArray.length == 1 && calendarEventArray[0].title) {
-        fp.defaultString = calendarEventArray[0].title;
+        picker.defaultString = calendarEventArray[0].title;
     } else {
-        fp.defaultString = calGetString("calendar", "defaultFileName");
+        picker.defaultString = calGetString("calendar", "defaultFileName");
     }
 
-    fp.defaultExtension = "ics";
+    picker.defaultExtension = "ics";
 
     // Get a list of exporters
     let contractids = [];
     let catman = Components.classes["@mozilla.org/categorymanager;1"]
                            .getService(Components.interfaces.nsICategoryManager);
     let catenum = catman.enumerateCategory("cal-exporters");
     let currentListLength = 0;
     let defaultCIDIndex = 0;
@@ -240,40 +240,40 @@ function saveEventsToFile(calendarEventA
             exporter = Components.classes[contractid]
                                  .getService(Components.interfaces.calIExporter);
         } catch (e) {
             cal.WARN("Could not initialize exporter: " + contractid + "\nError: " + e);
             continue;
         }
         let types = exporter.getFileTypes({});
         for (let type of types) {
-            fp.appendFilter(type.description, type.extensionFilter);
-            if (type.extensionFilter == "*." + fp.defaultExtension) {
-                fp.filterIndex = currentListLength;
+            picker.appendFilter(type.description, type.extensionFilter);
+            if (type.extensionFilter == "*." + picker.defaultExtension) {
+                picker.filterIndex = currentListLength;
                 defaultCIDIndex = currentListLength;
             }
             contractids.push(contractid);
             currentListLength++;
         }
     }
 
-    let rv = fp.show();
+    let rv = picker.show();
 
     // Now find out as what to save, convert the events and save to file.
-    if (rv != nsIFilePicker.returnCancel && fp.file && fp.file.path.length > 0) {
-        let filterIndex = fp.filterIndex;
-        if (fp.filterIndex < 0 || fp.filterIndex > contractids.length) {
+    if (rv != nsIFilePicker.returnCancel && picker.file && picker.file.path.length > 0) {
+        let filterIndex = picker.filterIndex;
+        if (picker.filterIndex < 0 || picker.filterIndex > contractids.length) {
             // For some reason the wrong filter was selected, assume default extension
             filterIndex = defaultCIDIndex;
         }
 
         let exporter = Components.classes[contractids[filterIndex]]
                                  .getService(Components.interfaces.calIExporter);
 
-        let filePath = fp.file.path;
+        let filePath = picker.file.path;
         if (!filePath.includes(".")) {
             filePath += "." + exporter.getFileTypes({})[0].defaultExtension;
         }
 
         const nsILocalFile = Components.interfaces.nsILocalFile;
         const nsIFileOutputStream = Components.interfaces.nsIFileOutputStream;
 
         let outputStream;
--- a/calendar/base/content/preferences/alarms.js
+++ b/calendar/base/content/preferences/alarms.js
@@ -69,32 +69,32 @@ var gAlarmsPane = {
         this.readSoundLocation();
     },
 
     /**
      * Opens a filepicker to open a local sound for the alarm.
      */
     browseAlarm: function() {
         const nsIFilePicker = Components.interfaces.nsIFilePicker;
-        let fp = Components.classes["@mozilla.org/filepicker;1"]
-                    .createInstance(nsIFilePicker);
+        let picker = Components.classes["@mozilla.org/filepicker;1"]
+                               .createInstance(nsIFilePicker);
 
         let bundlePreferences = document.getElementById("bundleCalendarPreferences");
         let title = bundlePreferences.getString("Open");
         let wildmat = "*.wav";
         let label = bundlePreferences.getFormattedString("filterWav", [wildmat], 1);
 
-        fp.init(window, title, nsIFilePicker.modeOpen);
-        fp.appendFilter(label, wildmat);
-        fp.appendFilters(nsIFilePicker.filterAll);
+        picker.init(window, title, nsIFilePicker.modeOpen);
+        picker.appendFilter(label, wildmat);
+        picker.appendFilters(nsIFilePicker.filterAll);
 
-        let ret = fp.show();
+        let ret = picker.show();
 
         if (ret == nsIFilePicker.returnOK) {
-            document.getElementById("calendar.alarms.soundURL").value = fp.fileURL.spec;
+            document.getElementById("calendar.alarms.soundURL").value = picker.fileURL.spec;
             document.getElementById("alarmSoundCheckbox").checked = true;
             this.readSoundLocation();
         }
     },
 
     /**
      * Plays the alarm sound currently selected.
      */
--- a/calendar/base/content/preferences/general.js
+++ b/calendar/base/content/preferences/general.js
@@ -10,21 +10,21 @@ Components.utils.import("resource://cale
  * Global Object to hold methods for the general pref pane
  */
 var gCalendarGeneralPane = {
     /**
      * Initialize the general pref pane. Sets up dialog controls to match the
      * values set in prefs.
      */
     init: function() {
-        let df = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
-                    .getService(Components.interfaces.calIDateTimeFormatter);
+        let formatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
+                                  .getService(Components.interfaces.calIDateTimeFormatter);
 
-        let dateFormattedLong = df.formatDateLong(now());
-        let dateFormattedShort = df.formatDateShort(now());
+        let dateFormattedLong = formatter.formatDateLong(now());
+        let dateFormattedShort = formatter.formatDateShort(now());
 
         // menu items include examples of current date formats.
         document.getElementById("dateformat-long-menuitem")
                 .setAttribute("label", labelLong + ": " + dateFormattedLong);
         document.getElementById("dateformat-short-menuitem")
                 .setAttribute("label", labelShort + ": " + dateFormattedShort);
 
         // deselect and reselect to update visible item title
@@ -36,21 +36,21 @@ var gCalendarGeneralPane = {
         let tzMenuPopup = document.getElementById("calendar-timezone-menupopup");
 
         let tzService = cal.getTimezoneService();
         let enumerator = tzService.timezoneIds;
         let tzids = {};
         let displayNames = [];
         // don't rely on what order the timezone-service gives you
         while (enumerator.hasMore()) {
-            let tz = tzService.getTimezone(enumerator.getNext());
-            if (tz && !tz.isFloating && !tz.isUTC) {
-                let displayName = tz.displayName;
+            let timezone = tzService.getTimezone(enumerator.getNext());
+            if (timezone && !timezone.isFloating && !timezone.isUTC) {
+                let displayName = timezone.displayName;
                 displayNames.push(displayName);
-                tzids[displayName] = tz.tzid;
+                tzids[displayName] = timezone.tzid;
             }
         }
         // the display names need to be sorted
         displayNames.sort(String.localeCompare);
         for (let displayName of displayNames) {
             addMenuItem(tzMenuPopup, displayName, tzids[displayName]);
         }
 
--- a/calendar/base/content/widgets/calendar-alarm-widget.xml
+++ b/calendar/base/content/widgets/calendar-alarm-widget.xml
@@ -280,18 +280,18 @@
           snoozeEvent.detail = minutes;
 
           // The onsnooze attribute is set on the menupopup, this binding is
           // instanciated on the menupopup's arrowscrollbox. Therefore we need
           // to go up one node.
           let handler = this.parentNode.getAttribute("onsnooze");
           let cancel = false;
           if (handler) {
-              let fn = new Function("event", handler);
-              cancel = (fn.call(this, snoozeEvent) === false);
+              let func = new Function("event", handler);
+              cancel = (func.call(this, snoozeEvent) === false);
           }
 
           if (!cancel) {
               this.dispatchEvent(snoozeEvent);
           }
         ]]></body>
       </method>
 
--- a/calendar/base/content/widgets/calendar-list-tree.xml
+++ b/calendar/base/content/widgets/calendar-list-tree.xml
@@ -1052,52 +1052,52 @@
             event.preventDefault();
         }
       ]]></handler>
       <handler event="keypress" keycode="VK_DOWN" modifiers="control"><![CDATA[
         if (!this.allowDrag) {
           return;
         }
 
-        let ci = this.tree.currentIndex;
+        let idx = this.tree.currentIndex;
 
-        if (ci < this.mCalendarList.length - 1) {
-            this.mCalendarList.splice(ci + 1, 0, this.mCalendarList.splice(ci, 1)[0]);
-            this.treebox.invalidateRange(ci, ci + 1);
+        if (idx < this.mCalendarList.length - 1) {
+            this.mCalendarList.splice(idx + 1, 0, this.mCalendarList.splice(idx, 1)[0]);
+            this.treebox.invalidateRange(idx, idx + 1);
 
-            if (this.tree.view.selection.isSelected(ci)) {
-                this.tree.view.selection.toggleSelect(ci);
-                this.tree.view.selection.toggleSelect(ci + 1);
+            if (this.tree.view.selection.isSelected(idx)) {
+                this.tree.view.selection.toggleSelect(idx);
+                this.tree.view.selection.toggleSelect(idx + 1);
             }
-            if (this.tree.view.selection.currentIndex == ci) {
-                this.tree.view.selection.currentIndex = ci + 1;
+            if (this.tree.view.selection.currentIndex == idx) {
+                this.tree.view.selection.currentIndex = idx + 1;
             }
 
             // Fire event
             this.sortOrderChanged();
         }
         // Don't call the default <key> handler.
         event.preventDefault();
       ]]></handler>
       <handler event="keypress" keycode="VK_UP" modifiers="control"><![CDATA[
         if (!this.allowDrag) {
           return;
         }
 
-        let ci = this.tree.currentIndex;
-        if (ci > 0) {
-            this.mCalendarList.splice(ci - 1, 0, this.mCalendarList.splice(ci, 1)[0]);
-            this.treebox.invalidateRange(ci - 1, ci);
+        let idx = this.tree.currentIndex;
+        if (idx > 0) {
+            this.mCalendarList.splice(idx - 1, 0, this.mCalendarList.splice(idx, 1)[0]);
+            this.treebox.invalidateRange(idx - 1, idx);
 
-            if (this.tree.view.selection.isSelected(ci)) {
-                this.tree.view.selection.toggleSelect(ci);
-                this.tree.view.selection.toggleSelect(ci - 1);
+            if (this.tree.view.selection.isSelected(idx)) {
+                this.tree.view.selection.toggleSelect(idx);
+                this.tree.view.selection.toggleSelect(idx - 1);
             }
-            if (this.tree.view.selection.currentIndex == ci) {
-                this.tree.view.selection.currentIndex = ci - 1;
+            if (this.tree.view.selection.currentIndex == idx) {
+                this.tree.view.selection.currentIndex = idx - 1;
             }
 
             // Fire event
             this.sortOrderChanged();
         }
         // Don't call the default <key> handler.
         event.preventDefault();
       ]]></handler>
--- a/calendar/base/content/widgets/minimonth.xml
+++ b/calendar/base/content/widgets/minimonth.xml
@@ -402,27 +402,27 @@
       <property name="extra"
                 onget="return this.mExtraDate"
                 onset="this.mExtraDate = val"/>
 
        <!--returns the first (inclusive) date of the minimonth as a calIDateTime object-->
       <property name="firstDate" readonly="true">
         <getter><![CDATA[
             let calbox = document.getAnonymousElementByAttribute(this, "anonid", "minimonth-calendar");
-            let dt = calbox.childNodes[1].firstChild.nextSibling.date;
-            return cal.jsDateToDateTime(dt);
+            let date = calbox.childNodes[1].firstChild.nextSibling.date;
+            return cal.jsDateToDateTime(date);
         ]]></getter>
       </property>
 
        <!--returns the last (exclusive) date of the minimonth as a calIDateTime object-->
       <property name="lastDate" readonly="true">
         <getter><![CDATA[
             let calbox = document.getAnonymousElementByAttribute(this, "anonid", "minimonth-calendar");
-            let dt = calbox.lastChild.lastChild.date;
-            let lastDateTime = cal.jsDateToDateTime(dt);
+            let date = calbox.lastChild.lastChild.date;
+            let lastDateTime = cal.jsDateToDateTime(date);
             lastDateTime.day = lastDateTime.day + 1;
             return lastDateTime;
         ]]></getter>
       </property>
       <field name="mDaymap">null</field>
       <field name="mValue">null</field>
       <field name="mEditorDate">null</field>
       <field name="mExtraDate">null</field>
@@ -752,18 +752,18 @@
               for (i = 1; i < dayList.length; i++) {
                   minLength = Math.min(minLength, dayList[i].length);
               }
               // 2. If some day name abbrev. is longer than 2 chars (not Catalan),
               //    and ALL localized day names share same prefix (as in Chinese),
               //    then trim shared "day-" prefix.
               if (dayList.some(dayAbbr => dayAbbr.length > 2)) {
                   for (let endPrefix = 0; endPrefix < minLength; endPrefix++) {
-                      let c = dayList[0][endPrefix];
-                      if (dayList.some(dayAbbr => dayAbbr[endPrefix] != c)) {
+                      let suffix = dayList[0][endPrefix];
+                      if (dayList.some(dayAbbr => dayAbbr[endPrefix] != suffix)) {
                           if (endPrefix > 0) {
                               for (i = 0; i < dayList.length; i++) { // trim prefix chars.
                                   dayList[i] = dayList[i].substring(endPrefix);
                               }
                           }
                           break;
                       }
                   }
--- a/calendar/base/modules/calAlarmUtils.jsm
+++ b/calendar/base/modules/calAlarmUtils.jsm
@@ -65,19 +65,19 @@ cal.alarms = {
                 returnDate = aItem[cal.calGetEndDateProp(aItem)];
             }
 
             if (returnDate && aAlarm.offset) {
                 // Handle all day events.  This is kinda weird, because they don't
                 // have a well defined startTime.  We just consider the start/end
                 // to be midnight in the user's timezone.
                 if (returnDate.isDate) {
-                    let tz = cal.calendarDefaultTimezone();
+                    let timezone = cal.calendarDefaultTimezone();
                     // This returns a copy, so no extra cloning needed.
-                    returnDate = returnDate.getInTimezone(tz);
+                    returnDate = returnDate.getInTimezone(timezone);
                     returnDate.isDate = false;
                 } else {
                     // Clone the date to correctly add the duration.
                     returnDate = returnDate.clone();
                 }
 
                 returnDate.addDuration(aAlarm.offset);
                 return returnDate;
@@ -117,19 +117,19 @@ cal.alarms = {
     /**
      * Adds reminder images to a given node, making sure only one icon per alarm
      * action is added.
      *
      * @param aElement    The element to add the images to.
      * @param aReminders  The set of reminders to add images for.
      */
     addReminderImages: function(aElement, aReminders) {
-        function createOwnedXULNode(el) {
+        function createOwnedXULNode(elem) {
             const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-            return aElement.ownerDocument.createElementNS(XUL_NS, el);
+            return aElement.ownerDocument.createElementNS(XUL_NS, elem);
         }
 
         function setupActionImage(node, reminder) {
             let image = node || createOwnedXULNode("image");
             image.setAttribute("class", "reminder-icon");
             image.setAttribute("value", reminder.action);
             return image;
         }
--- a/calendar/base/modules/calAuthUtils.jsm
+++ b/calendar/base/modules/calAuthUtils.jsm
@@ -236,20 +236,20 @@ cal.auth.Prompt.prototype = {
         let port = aChannel.URI.port;
         if (port == -1) {
             let handler = Services.io.getProtocolHandler(aChannel.URI.scheme)
                                      .QueryInterface(Components.interfaces.nsIProtocolHandler);
             port = handler.defaultPort;
         }
         hostRealm.passwordRealm = aChannel.URI.host + ":" + port + " (" + aAuthInfo.realm + ")";
 
-        let pw = this.getPasswordInfo(hostRealm);
-        aAuthInfo.username = pw.username;
-        if (pw && pw.found) {
-            aAuthInfo.password = pw.password;
+        let pwInfo = this.getPasswordInfo(hostRealm);
+        aAuthInfo.username = pwInfo.username;
+        if (pwInfo && pwInfo.found) {
+            aAuthInfo.password = pwInfo.password;
             return true;
         } else {
             let prompter2 = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
                                       .getService(Components.interfaces.nsIPromptFactory)
                                       .getPrompt(this.mWindow, Components.interfaces.nsIAuthPrompt2);
             return prompter2.promptAuth(aChannel, aLevel, aAuthInfo);
         }
     },
--- a/calendar/base/modules/calExtract.jsm
+++ b/calendar/base/modules/calExtract.jsm
@@ -95,19 +95,19 @@ Extractor.prototype = {
         }
     },
 
     avgNonAsciiCharCode: function() {
         let sum = 0;
         let cnt = 0;
 
         for (let i = 0; i < this.email.length; i++) {
-            let ch = this.email.charCodeAt(i);
-            if (ch > 128) {
-                sum += ch;
+            let char = this.email.charCodeAt(i);
+            if (char > 128) {
+                sum += char;
                 cnt++;
             }
         }
 
         let nonAscii = sum / cnt || 0;
         cal.LOG("[calExtract] Average non-ascii charcode: " + nonAscii);
         return nonAscii;
     },
@@ -139,64 +139,64 @@ Extractor.prototype = {
                 } else {
                     langs.splice(idx, 1);
                     Preferences.set(pref, this.fallbackLocale + "," + langs.join(","));
                 }
             }
         } else {
             let spellclass = "@mozilla.org/spellchecker/engine;1";
             let mozISpellCheckingEngine = Components.interfaces.mozISpellCheckingEngine;
-            let sp = Components.classes[spellclass]
-                               .getService(mozISpellCheckingEngine);
+            let spellchecker = Components.classes[spellclass]
+                                         .getService(mozISpellCheckingEngine);
 
             let arr = {};
             let cnt = {};
-            sp.getDictionaryList(arr, cnt);
+            spellchecker.getDictionaryList(arr, cnt);
             let dicts = arr.value;
 
             if (dicts.length == 0) {
                 cal.LOG("[calExtract] There are no dictionaries installed and " +
                         "enabled. You might want to add some if date and time " +
                         "extraction from emails seems inaccurate.");
             }
 
             let patterns;
             let words = this.email.split(/\s+/);
             let most = 0;
             let mostLocale;
             for (let dict in dicts) {
                 // dictionary locale and patterns locale match
                 if (this.checkBundle(dicts[dict])) {
-                    let t1 = (new Date()).getTime();
-                    sp.dictionary = dicts[dict];
-                    let dur = (new Date()).getTime() - t1;
+                    let time1 = (new Date()).getTime();
+                    spellchecker.dictionary = dicts[dict];
+                    let dur = (new Date()).getTime() - time1;
                     cal.LOG("[calExtract] Loading " + dicts[dict] +
                             " dictionary took " + dur + "ms");
                     patterns = dicts[dict];
                 // beginning of dictionary locale matches patterns locale
                 } else if (this.checkBundle(dicts[dict].substring(0, 2))) {
-                    let t1 = (new Date()).getTime();
-                    sp.dictionary = dicts[dict];
-                    let dur = (new Date()).getTime() - t1;
+                    let time1 = (new Date()).getTime();
+                    spellchecker.dictionary = dicts[dict];
+                    let dur = (new Date()).getTime() - time1;
                     cal.LOG("[calExtract] Loading " + dicts[dict] +
                             " dictionary took " + dur + "ms");
                     patterns = dicts[dict].substring(0, 2);
                 // dictionary for which patterns aren't present
                 } else {
                     cal.LOG("[calExtract] Dictionary present, rules missing: " + dicts[dict]);
                     continue;
                 }
 
                 let correct = 0;
                 let total = 0;
                 for (let word in words) {
                     words[word] = words[word].replace(/[()\d,;:?!#\.]/g, "");
                     if (words[word].length >= 2) {
                         total++;
-                        if (sp.check(words[word])) {
+                        if (spellchecker.check(words[word])) {
                             correct++;
                         }
                     }
                 }
 
                 let percentage = correct / total * 100.0;
                 cal.LOG("[calExtract] " + dicts[dict] + " dictionary matches " +
                         percentage + "% of words");
@@ -442,18 +442,18 @@ Extractor.prototype = {
 
             while ((res = re.exec(this.email)) != null) {
                 if (!this.limitNums(res, this.email) && !this.limitChars(res, this.email)) {
                     let day = this.parseNumber(res[positions[1]], this.numbers);
                     let month = res[positions[2]];
 
                     if (this.isValidDay(day)) {
                         for (let i = 0; i < 12; i++) {
-                            let ms = this.unescape(this.months[i]).split("|");
-                            if (ms.includes(month.toLowerCase())) {
+                            let months = this.unescape(this.months[i]).split("|");
+                            if (months.includes(month.toLowerCase())) {
                                 let date = { year: this.now.getFullYear(), month: i + 1, day: day };
                                 if (this.isPastDate(date, this.now)) {
                                     // find next such date
                                     let item = new Date(this.now.getTime());
                                     while (true) {
                                         item.setDate(item.getDate() + 1);
                                         if (item.getMonth() == date.month - 1 &&
                                             item.getDate() == date.day) {
@@ -1087,22 +1087,22 @@ Extractor.prototype = {
                 alts[val] = { pattern: patterns[val], positions: positions };
             }
         } catch (ex) {
             cal.LOG("[calExtract] Pattern not found: " + name);
         }
         return alts;
     },
 
-    getPositionsFor: function(s, name, count) {
+    getPositionsFor: function(str, name, count) {
         let positions = [];
         let re = /#(\d)/g;
         let match;
         let i = 0;
-        while ((match = re.exec(s))) {
+        while ((match = re.exec(str))) {
             i++;
             positions[parseInt(match[1], 10)] = i;
         }
 
         // correctness checking
         for (i = 1; i <= count; i++) {
             if (positions[i] === undefined) {
                 Components.utils.reportError("[calExtract] Faulty extraction pattern " + name +
@@ -1179,92 +1179,92 @@ Extractor.prototype = {
         if (alphabet == this.defPattern) {
             return false;
         }
 
         let pattern = email.substring(res.index, res.index + res[0].length);
         let before = email.charAt(res.index - 1);
         let after = email.charAt(res.index + res[0].length);
 
-        let w = new RegExp("[" + alphabet + "]");
-        let result = (w.exec(before) && w.exec(pattern.charAt(0))) ||
-                     (w.exec(pattern.charAt(pattern.length - 1)) && w.exec(after));
+        let re = new RegExp("[" + alphabet + "]");
+        let result = (re.exec(before) && re.exec(pattern.charAt(0))) ||
+                     (re.exec(pattern.charAt(pattern.length - 1)) && re.exec(after));
         return result != null;
     },
 
     prefixSuffixStartEnd: function(res, relation, email) {
         let pattern = email.substring(res.index, res.index + res[0].length);
         let prev = email.substring(0, res.index);
         let next = email.substring(res.index + res[0].length);
         let prefixSuffix = {
             start: res.index,
             end: res.index + res[0].length,
             pattern: pattern,
             relation: relation
         };
-        let ch = "\\s*";
+        let char = "\\s*";
         let psres;
 
-        let re = new RegExp("(" + this.getPatterns("end.prefix") + ")" + ch + "$", "ig");
+        let re = new RegExp("(" + this.getPatterns("end.prefix") + ")" + char + "$", "ig");
         if ((psres = re.exec(prev)) != null) {
             prefixSuffix.relation = "end";
             prefixSuffix.start = psres.index;
             prefixSuffix.pattern = psres[0] + pattern;
         }
 
-        re = new RegExp("^" + ch + "(" + this.getPatterns("end.suffix") + ")", "ig");
+        re = new RegExp("^" + char + "(" + this.getPatterns("end.suffix") + ")", "ig");
         if ((psres = re.exec(next)) != null) {
             prefixSuffix.relation = "end";
             prefixSuffix.end = prefixSuffix.end + psres[0].length;
             prefixSuffix.pattern = pattern + psres[0];
         }
 
-        re = new RegExp("(" + this.getPatterns("start.prefix") + ")" + ch + "$", "ig");
+        re = new RegExp("(" + this.getPatterns("start.prefix") + ")" + char + "$", "ig");
         if ((psres = re.exec(prev)) != null) {
             prefixSuffix.relation = "start";
             prefixSuffix.start = psres.index;
             prefixSuffix.pattern = psres[0] + pattern;
         }
 
-        re = new RegExp("^" + ch + "(" + this.getPatterns("start.suffix") + ")", "ig");
+        re = new RegExp("^" + char + "(" + this.getPatterns("start.suffix") + ")", "ig");
         if ((psres = re.exec(next)) != null) {
             prefixSuffix.relation = "start";
             prefixSuffix.end = prefixSuffix.end + psres[0].length;
             prefixSuffix.pattern = pattern + psres[0];
         }
 
-        re = new RegExp("\\s(" + this.getPatterns("no.datetime.prefix") + ")" + ch + "$", "ig");
+        re = new RegExp("\\s(" + this.getPatterns("no.datetime.prefix") + ")" + char + "$", "ig");
 
         if ((psres = re.exec(prev)) != null) {
             prefixSuffix.relation = "notadatetime";
         }
 
-        re = new RegExp("^" + ch + "(" + this.getPatterns("no.datetime.suffix") + ")", "ig");
+        re = new RegExp("^" + char + "(" + this.getPatterns("no.datetime.suffix") + ")", "ig");
         if ((psres = re.exec(next)) != null) {
             prefixSuffix.relation = "notadatetime";
         }
 
         return prefixSuffix;
     },
 
-    parseNumber: function(number, numbers) {
-        let r = parseInt(number, 10);
+    parseNumber: function(numberString, numbers) {
+        let number = parseInt(numberString, 10);
         // number comes in as plain text, numbers are already adjusted for usage
         // in regular expression
-        number = this.cleanPatterns(number);
-        if (isNaN(r)) {
+        let cleanNumberString = this.cleanPatterns(numberString);
+        if (isNaN(number)) {
             for (let i = 0; i <= 31; i++) {
-                let ns = numbers[i].split("|");
-                if (ns.includes(number.toLowerCase())) {
+                let numberparts = numbers[i].split("|");
+                if (numberparts.includes(cleanNumberString.toLowerCase())) {
                     return i;
                 }
             }
             return -1;
         } else {
-            return r;
+            return number;
         }
     },
 
     guess: function(year, month, day, hour, minute, start, end, str,
                     relation, pattern, ambiguous) {
         let dateGuess = {
             year: year,
             month: month,
--- a/calendar/base/modules/calItipUtils.jsm
+++ b/calendar/base/modules/calItipUtils.jsm
@@ -54,27 +54,27 @@ cal.itip = {
      * the last received one of an attendee; see
      * <http://tools.ietf.org/html/draft-desruisseaux-caldav-sched-04#section-7.2>.
      */
     getStamp: function(item) {
         let dtstamp = null;
 
         let wrappedItem = cal.wrapInstance(item, Components.interfaces.calIAttendee);
         if (wrappedItem) {
-            let st = wrappedItem.getProperty("RECEIVED-DTSTAMP");
-            if (st) {
-                dtstamp = cal.createDateTime(st);
+            let stamp = wrappedItem.getProperty("RECEIVED-DTSTAMP");
+            if (stamp) {
+                dtstamp = cal.createDateTime(stamp);
             }
         } else if (item) {
             // Unless the below is standardized, we store the last original
             // REQUEST/PUBLISH DTSTAMP in X-MOZ-RECEIVED-DTSTAMP to test against it
             // when updates come in:
-            let st = item.getProperty("X-MOZ-RECEIVED-DTSTAMP");
-            if (st) {
-                dtstamp = cal.createDateTime(st);
+            let stamp = item.getProperty("X-MOZ-RECEIVED-DTSTAMP");
+            if (stamp) {
+                dtstamp = cal.createDateTime(stamp);
             } else {
                 // xxx todo: are there similar X-MICROSOFT-CDO properties to be considered here?
                 dtstamp = item.stampTime;
             }
         }
 
         return dtstamp;
     },
@@ -557,19 +557,19 @@ cal.itip = {
             if (aOriginalItem.recurrenceInfo && aItem.recurrenceInfo) {
                 // check whether the two differ only in EXDATEs
                 let clonedItem = aItem.clone();
                 let exdates = [];
                 for (let ritem of clonedItem.recurrenceInfo.getRecurrenceItems({})) {
                     let wrappedRItem = cal.wrapInstance(ritem, Components.interfaces.calIRecurrenceDate);
                     if (ritem.isNegative &&
                         wrappedRItem &&
-                        !aOriginalItem.recurrenceInfo.getRecurrenceItems({}).some((r) => {
-                            let wrappedR = cal.wrapInstance(r, Components.interfaces.calIRecurrenceDate);
-                            return r.isNegative &&
+                        !aOriginalItem.recurrenceInfo.getRecurrenceItems({}).some((recitem) => {
+                            let wrappedR = cal.wrapInstance(recitem, Components.interfaces.calIRecurrenceDate);
+                            return recitem.isNegative &&
                                    wrappedR &&
                                    wrappedR.date.compare(wrappedRItem.date) == 0;
                         })) {
                         exdates.push(wrappedRItem);
                     }
                 }
                 if (exdates.length > 0) {
                     // check whether really only EXDATEs have been added:
@@ -809,19 +809,19 @@ cal.itip = {
                         propStrings.push(item.recurrenceId + "#" + prop.icalString);
                     }
                 }
             }
             propStrings.sort();
             return propStrings.join("");
         };
 
-        let h1 = hashMajorProps(newItem);
-        let h2 = hashMajorProps(oldItem);
-        if (h1 != h2) {
+        let hash1 = hashMajorProps(newItem);
+        let hash2 = hashMajorProps(oldItem);
+        if (hash1 != hash2) {
             newItem = newItem.clone();
             // bump SEQUENCE, it never decreases (mind undo scenario here)
             newItem.setProperty("SEQUENCE",
                                 String(Math.max(cal.itip.getSequence(oldItem),
                                                 cal.itip.getSequence(newItem)) + 1));
         }
 
         return newItem;
@@ -1491,19 +1491,19 @@ ItipItemFinder.prototype = {
                 }
             }
         }
 
         cal.LOG("iTIP operations: " + operations.length);
         let actionFunc = null;
         if (operations.length > 0) {
             actionFunc = function(opListener, partStat) {
-                for (let op of operations) {
+                for (let operation of operations) {
                     try {
-                        op(opListener, partStat);
+                        operation(opListener, partStat);
                     } catch (exc) {
                         cal.ERROR(exc);
                     }
                 }
             };
             actionFunc.method = actionMethod;
         }
 
--- a/calendar/base/modules/calPrintUtils.jsm
+++ b/calendar/base/modules/calPrintUtils.jsm
@@ -10,18 +10,18 @@ this.EXPORTED_SYMBOLS = ["cal"]; // even
 cal.print = {
     /**
      * Returns a simple key in the format YYYY-MM-DD for use in the table of
      * dates to day boxes
      *
      * @param dt    The date to translate
      * @return      YYYY-MM-DD
      */
-    getDateKey: function(dt) {
-        return dt.year + "-" + dt.month + "-" + dt.day;
+    getDateKey: function(date) {
+        return date.year + "-" + date.month + "-" + date.day;
     },
 
     /**
      * Add category styles to the document's "sheet" element. This is needed
      * since the HTML created is serialized, so we can't dynamically set the
      * styles and can be changed if the print formatter decides to return a
      * DOM document instead.
      *
--- a/calendar/base/modules/calRecurrenceUtils.jsm
+++ b/calendar/base/modules/calRecurrenceUtils.jsm
@@ -36,17 +36,17 @@ function recurrenceRule2String(recurrenc
                nounClassStr.substr(1);
     }
     function pluralWeekday(aDayString) {
         let plural = getRString("pluralForWeekdays") == "true";
         return (plural ? aDayString + "Plural" : aDayString);
     }
     function everyWeekDay(aByDay) {
         // Checks if aByDay contains only values from 1 to 7 with any order.
-        let mask = aByDay.reduce((v, c) => v | (1 << c), 1);
+        let mask = aByDay.reduce((value, item) => value | (1 << item), 1);
         return aByDay.length == 7 && mask == Math.pow(2, 8) - 1;
     }
 
 
     // Retrieve a valid recurrence rule from the currently
     // set recurrence info. Bail out if there's more
     // than a single rule or something other than a rule.
     recurrenceInfo = recurrenceInfo.clone();
@@ -368,21 +368,21 @@ function recurrenceRule2String(recurrenc
  * @param recurrenceInfo    An item's recurrence info to parse.
  * @return                  An array with two elements: an array of positive
  *                            rules and an array of negative rules.
  */
 function splitRecurrenceRules(recurrenceInfo) {
     let ritems = recurrenceInfo.getRecurrenceItems({});
     let rules = [];
     let exceptions = [];
-    for (let r of ritems) {
-        if (r.isNegative) {
-            exceptions.push(r);
+    for (let ritem of ritems) {
+        if (ritem.isNegative) {
+            exceptions.push(ritem);
         } else {
-            rules.push(r);
+            rules.push(ritem);
         }
     }
     return [rules, exceptions];
 }
 
 /**
  * Check if a recurrence rule's component is valid.
  *
--- a/calendar/base/modules/calUtils.jsm
+++ b/calendar/base/modules/calUtils.jsm
@@ -153,18 +153,18 @@ var cal = {
      */
     isTaskCalendar: function(aCalendar) {
         return (aCalendar.getProperty("capabilities.tasks.supported") !== false);
     },
 
     /**
      * Checks whether a timezone lacks a definition.
      */
-    isPhantomTimezone: function(tz) {
-        return (!tz.icalComponent && !tz.isUTC && !tz.isFloating);
+    isPhantomTimezone: function(timezone) {
+        return (!timezone.icalComponent && !timezone.isUTC && !timezone.isFloating);
     },
 
     /**
      * Shifts an item by the given timely offset.
      *
      * @param item an item
      * @param offset an offset (calIDuration)
      */
@@ -277,23 +277,23 @@ var cal = {
             }
             let parts = (prefix + member).match(/(.*)( <.*>)/);
             if (parts) {
                 if (parts[2] == " <>") {
                     // CN but no email address - we keep the CN part to prefix the next member's CN
                     prefix = parts[1];
                 } else {
                     // CN with email address
-                    let cn = parts[1].trim();
+                    let commonName = parts[1].trim();
                     // in case of any special characters in the CN string, we make sure to enclose
                     // it with dquotes - simple spaces don't require dquotes
-                    if (cn.match(/[\-\[\]{}()*+?.,;\\\^$|#\f\n\r\t\v]/)) {
-                        cn = '"' + cn.replace(/\\"|"/, "").trim() + '"';
+                    if (commonName.match(/[\-\[\]{}()*+?.,;\\\^$|#\f\n\r\t\v]/)) {
+                        commonName = '"' + commonName.replace(/\\"|"/, "").trim() + '"';
                     }
-                    list.push(cn + parts[2]);
+                    list.push(commonName + parts[2]);
                     prefix = "";
                 }
             } else if (member.length) {
                 // email address only
                 list.push(member);
                 prefix = "";
             }
         }
@@ -404,24 +404,24 @@ var cal = {
      */
     getAttendeeEmail: function(aAttendee, aIncludeCn) {
         // If the recipient id is of type urn, we need to figure out the email address, otherwise
         // we fall back to the attendee id
         let email = aAttendee.id.match(/^urn:/i) ? aAttendee.getProperty("EMAIL") || "" : aAttendee.id;
         // Strip leading "mailto:" if it exists.
         email = email.replace(/^mailto:/i, "");
         // We add the CN if requested and available
-        let cn = aAttendee.commonName;
-        if (aIncludeCn && email.length > 0 && cn && cn.length > 0) {
-            if (cn.match(/[,;]/)) {
-                cn = '"' + cn + '"';
+        let commonName = aAttendee.commonName;
+        if (aIncludeCn && email.length > 0 && commonName && commonName.length > 0) {
+            if (commonName.match(/[,;]/)) {
+                commonName = '"' + commonName + '"';
             }
-            cn = cn + " <" + email + ">";
-            if (cal.validateRecipientList(cn) == cn) {
-                email = cn;
+            commonName = commonName + " <" + email + ">";
+            if (cal.validateRecipientList(commonName) == commonName) {
+                email = commonName;
             }
         }
         return email;
     },
 
     /**
      * Provides a string to use in email "to" header for given attendees
      *
@@ -538,26 +538,26 @@ var cal = {
             if (modifier == 1) {
               return cal.compareNativeTimeFilledAsc(nsA, nsB);
             } else {
               return cal.compareNativeTimeFilledDesc(nsA, nsB);
             }
           };
         case "string":
           return function(sortEntryA, sortEntryB) {
-            let sA = cal.sortEntryKey(sortEntryA);
-            let sB = cal.sortEntryKey(sortEntryB);
-            if (sA.length == 0 || sB.length == 0) {
+            let seA = cal.sortEntryKey(sortEntryA);
+            let seB = cal.sortEntryKey(sortEntryB);
+            if (seA.length == 0 || seB.length == 0) {
               // sort empty values to end (so when users first sort by a
               // column, they can see and find the desired values in that
               // column without scrolling past all the empty values).
-              return -(sA.length - sB.length) * modifier;
+              return -(seA.length - seB.length) * modifier;
             }
             let collator = cal.createLocaleCollator();
-            let comparison = collator.compareString(0, sA, sB);
+            let comparison = collator.compareString(0, seA, seB);
             return comparison * modifier;
           };
         default:
           return function(sortEntryA, sortEntryB) {
             return 0;
           };
       }
     },
@@ -634,21 +634,21 @@ var cal = {
     },
 
     nativeTimeOrNow: function(calDateTime, sortStartedTime) {
         // Treat null/0 as 'now' when sort started, so incomplete tasks stay current.
         // Time is computed once per sort (just before sort) so sort is stable.
         if (calDateTime == null) {
             return sortStartedTime.nativeTime;
         }
-        let ns = calDateTime.nativeTime;
-        if (ns == -62168601600000000) { // ns value for (0000/00/00 00:00:00)
+        let nativeTime = calDateTime.nativeTime;
+        if (nativeTime == -62168601600000000) { // nativeTime value for (0000/00/00 00:00:00)
             return sortStartedTime;
         }
-        return ns;
+        return nativeTime;
     },
 
     nativeTime: function(calDateTime) {
         if (calDateTime == null) {
             return -62168601600000000; // ns value for (0000/00/00 00:00:00)
         }
         return calDateTime.nativeTime;
     },
--- a/calendar/base/src/calAlarm.js
+++ b/calendar/base/src/calAlarm.js
@@ -86,73 +86,73 @@ calAlarm.prototype = {
                 }
             }
         }
 
         this.mImmutable = true;
     },
 
     clone: function() {
-        let m = new calAlarm();
+        let cloned = new calAlarm();
 
-        m.mImmutable = false;
+        cloned.mImmutable = false;
 
         const simpleMembers = ["mAction",
                                "mSummary",
                                "mDescription",
                                "mRelated",
                                "mRepeat"];
 
         const arrayMembers = ["mAttendees",
                               "mAttachments"];
 
         const objectMembers = ["mAbsoluteDate",
                                "mOffset",
                                "mDuration",
                                "mLastAck"];
 
         for (let member of simpleMembers) {
-            m[member] = this[member];
+            cloned[member] = this[member];
         }
 
         for (let member of arrayMembers) {
             let newArray = [];
             for (let oldElem of this[member]) {
                 newArray.push(oldElem.clone());
             }
-            m[member] = newArray;
+            cloned[member] = newArray;
         }
 
         for (let member of objectMembers) {
             if (this[member] && this[member].clone) {
-                m[member] = this[member].clone();
+                cloned[member] = this[member].clone();
             } else {
-                m[member] = this[member];
+                cloned[member] = this[member];
             }
         }
 
         // X-Props
-        m.mProperties = new calPropertyBag();
+        cloned.mProperties = new calPropertyBag();
         for (let [name, value] of this.mProperties) {
             if (value instanceof Components.interfaces.calIDateTime) {
                 value = value.clone();
             }
 
-            m.mProperties.setProperty(name, value);
+            cloned.mProperties.setProperty(name, value);
 
             let propBucket = this.mPropertyParams[name];
             if (propBucket) {
                 let newBucket = {};
                 for (let param in propBucket) {
                     newBucket[param] = propBucket[param];
                 }
-                m.mPropertyParams[name] = newBucket;
+                cloned.mPropertyParams[name] = newBucket;
             }
         }
-        return m;
+        return cloned;
     },
 
 
     get related() {
         return this.mRelated;
     },
     set related(aValue) {
         this.ensureMutable();
--- a/calendar/base/src/calAttachment.js
+++ b/calendar/base/src/calAttachment.js
@@ -26,27 +26,27 @@ calAttachment.prototype = {
         classID: calAttachmentClassID,
         contractID: "@mozilla.org/calendar/attachment;1",
         classDescription: "Calendar Item Attachment",
         interfaces: calAttachmentInterfaces
     }),
 
     get hashId() {
         if (!this.mHashId) {
-            let ch = Components.classes["@mozilla.org/security/hash;1"]
-                               .createInstance(Components.interfaces.nsICryptoHash);
+            let cryptoHash = Components.classes["@mozilla.org/security/hash;1"]
+                                       .createInstance(Components.interfaces.nsICryptoHash);
 
             let converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
                                       .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
             converter.charset = "UTF-8";
             let data = converter.convertToByteArray(this.rawData, {});
 
-            ch.init(ch.MD5);
-            ch.update(data, data.length);
-            this.mHashId = ch.finish(true);
+            cryptoHash.init(cryptoHash.MD5);
+            cryptoHash.update(data, data.length);
+            this.mHashId = cryptoHash.finish(true);
         }
         return this.mHashId;
     },
 
     /**
      * calIAttachment
      */
 
--- a/calendar/base/src/calCachedCalendar.js
+++ b/calendar/base/src/calCachedCalendar.js
@@ -303,36 +303,36 @@ calCachedCalendar.prototype = {
                 try {
                     func(status);
                 } catch (exc) {
                     cal.ASSERT(false, exc);
                 }
             }
             queue.forEach(execResponseFunc);
             cal.LOG("[calCachedCalendar] sync queue empty.");
-            let op = self.mPendingSync;
+            let operation = self.mPendingSync;
             self.mPendingSync = null;
-            return op;
+            return operation;
         }
 
         if (this.offline) {
             return emptyQueue(Components.results.NS_OK);
         }
 
         if (this.supportsChangeLog) {
             cal.LOG("[calCachedCalendar] Doing changelog based sync for calendar " + this.uri.spec);
             let opListener = {
-                onResult: function(op, result) {
-                    if (!op || !op.isPending) {
-                        let status = (op ? op.status : Components.results.NS_OK);
+                onResult: function(operation, result) {
+                    if (!operation || !operation.isPending) {
+                        let status = (operation ? operation.status : Components.results.NS_OK);
                         if (!Components.isSuccessCode(status)) {
                             cal.ERROR("[calCachedCalendar] replay action failed: " +
-                                      (op ? op.id : "<unknown>") + ", uri=" +
+                                      (operation ? operation.id : "<unknown>") + ", uri=" +
                                       self.uri.spec + ", result=" +
-                                      result + ", op=" + op);
+                                      result + ", operation=" + operation);
                         }
                         cal.LOG("[calCachedCalendar] replayChangesOn finished.");
                         emptyQueue(status);
                     }
                 }
             };
             this.mPendingSync = this.mUncachedCalendar.replayChangesOn(opListener);
             return this.mPendingSync;
@@ -701,17 +701,17 @@ calCachedCalendar.prototype = {
 
     modifyItem: function(newItem, oldItem, listener) {
         let self = this;
 
         // First of all, we should find out if the item to modify is
         // already an offline item or not.
         let flagListener = {
             onGetResult: function() {},
-            onOperationComplete: function(c, s, o, i, offline_flag) {
+            onOperationComplete: function(calendar, status, opType, id, offline_flag) {
                 if (offline_flag == cICL.OFFLINE_FLAG_CREATED_RECORD ||
                     offline_flag == cICL.OFFLINE_FLAG_MODIFIED_RECORD) {
                     // The item is already offline, just modify it in the cache
                     self.modifyOfflineItem(newItem, oldItem, listener);
                 } else {
                     // Not an offline item, attempt to modify using provider
                     self.mUncachedCalendar.modifyItem(newItem, oldItem, cacheListener);
                 }
@@ -782,17 +782,17 @@ calCachedCalendar.prototype = {
 
     deleteItem: function(item, listener) {
         let self = this;
 
         // First of all, we should find out if the item to delete is
         // already an offline item or not.
         let flagListener = {
             onGetResult: function() {},
-            onOperationComplete: function(c, s, o, i, offline_flag) {
+            onOperationComplete: function(calendar, status, opType, id, offline_flag) {
                 if (offline_flag == cICL.OFFLINE_FLAG_CREATED_RECORD ||
                     offline_flag == cICL.OFFLINE_FLAG_MODIFIED_RECORD) {
                     // The item is already offline, just mark it deleted it in
                     // the cache
                     self.deleteOfflineItem(item, listener);
                 } else {
                     // Not an offline item, attempt to delete using provider
                     self.mUncachedCalendar.deleteItem(item, cacheListener);
--- a/calendar/base/src/calCalendarManager.js
+++ b/calendar/base/src/calCalendarManager.js
@@ -147,25 +147,25 @@ calCalendarManager.prototype = {
                 // Unfortunately, the ability to do this with a general pref has
                 // been removed. Calendar servers might still want to know what
                 // client is used for access, so add our UA String to each
                 // request.
                 let httpChannel = aSubject.QueryInterface(Components.interfaces.nsIHttpChannel);
                 try {
                     // NOTE: For some reason, this observer call doesn't have
                     // the "cal" namespace defined
-                    let ua = httpChannel.getRequestHeader("User-Agent");
+                    let userAgent = httpChannel.getRequestHeader("User-Agent");
                     let calUAString = Preferences.get("calendar.useragent.extra", "").trim();
 
                     // Don't add an empty string or an already included token.
-                    if (calUAString && !ua.includes(calUAString)) {
+                    if (calUAString && !userAgent.includes(calUAString)) {
                         // User-Agent is not a mergeable header. We need to
                         // merge the user agent ourselves.
                         httpChannel.setRequestHeader("User-Agent",
-                                                     ua + " " + calUAString,
+                                                     userAgent + " " + calUAString,
                                                      false);
                     }
                 } catch (e) {
                     if (e.result != Components.results.NS_ERROR_NOT_AVAILABLE) {
                         throw e;
                     }
                     // We swallow this error since it means the User Agent
                     // header is not set. We don't want to force it to be set.
@@ -299,18 +299,17 @@ calCalendarManager.prototype = {
                             break;
                     }
                 }
                 selectPrefs.reset();
             }
 
             let sortOrderAr = [];
             for (let id in sortOrder) {
-                let s = sortOrder[id];
-                sortOrderAr.push(s);
+                sortOrderAr.push(sortOrder[id]);
             }
             Preferences.set("calendar.list.sortOrder", sortOrderAr.join(" "));
             flushPrefs();
         } finally {
             selectPrefs.reset();
             selectCalendars.reset();
         }
     },
@@ -1100,22 +1099,22 @@ var gCalendarManagerAddonListener = {
 };
 
 function appendToRealm(authHeader, appendStr) {
     let isEscaped = false;
     let idx = authHeader.search(/realm="(.*?)(\\*)"/);
     if (idx > -1) {
         let remain = authHeader.substr(idx + 7); idx += 7;
         while (remain.length && !isEscaped) {
-            let m = remain.match(/(.*?)(\\*)"/);
-            idx += m[0].length;
+            let match = remain.match(/(.*?)(\\*)"/);
+            idx += match[0].length;
 
-            isEscaped = ((m[2].length % 2) == 0);
+            isEscaped = ((match[2].length % 2) == 0);
             if (!isEscaped) {
-                remain = remain.substr(m[0].length);
+                remain = remain.substr(match[0].length);
             }
         }
         return authHeader.substr(0, idx - 1) + " " +
                 appendStr + authHeader.substr(idx - 1);
     } else {
         return authHeader;
     }
 }
--- a/calendar/base/src/calDeletedItems.js
+++ b/calendar/base/src/calDeletedItems.js
@@ -63,19 +63,19 @@ calDeletedItems.prototype = {
             stmt.params.calId = aCalId;
         } else {
             stmt = this.stmtGet;
         }
 
         stmt.params.id = aId;
         try {
             if (stmt.executeStep()) {
-                let dt = cal.createDateTime();
-                dt.nativeTime = stmt.row.time_deleted;
-                return dt.getInTimezone(cal.calendarDefaultTimezone());
+                let date = cal.createDateTime();
+                date.nativeTime = stmt.row.time_deleted;
+                return date.getInTimezone(cal.calendarDefaultTimezone());
             }
         } catch (e) {
             cal.ERROR(e);
         } finally {
             stmt.reset();
         }
         return null;
     },
--- a/calendar/base/src/calEvent.js
+++ b/calendar/base/src/calEvent.js
@@ -31,37 +31,37 @@ calEvent.prototype = {
     classInfo: XPCOMUtils.generateCI({
         classID: calEventClassID,
         contractID: "@mozilla.org/calendar/event;1",
         classDescription: "Calendar Event",
         interfaces: calEventInterfaces
     }),
 
     cloneShallow: function(aNewParent) {
-        let m = new calEvent();
-        this.cloneItemBaseInto(m, aNewParent);
-        return m;
+        let cloned = new calEvent();
+        this.cloneItemBaseInto(cloned, aNewParent);
+        return cloned;
     },
 
     createProxy: function(aRecurrenceId) {
         cal.ASSERT(!this.mIsProxy, "Tried to create a proxy for an existing proxy!", true);
 
-        let m = new calEvent();
+        let proxy = new calEvent();
 
         // override proxy's DTSTART/DTEND/RECURRENCE-ID
         // before master is set (and item might get immutable):
         let endDate = aRecurrenceId.clone();
         endDate.addDuration(this.duration);
-        m.endDate = endDate;
-        m.startDate = aRecurrenceId;
+        proxy.endDate = endDate;
+        proxy.startDate = aRecurrenceId;
 
-        m.initializeProxy(this, aRecurrenceId);
-        m.mDirty = false;
+        proxy.initializeProxy(this, aRecurrenceId);
+        proxy.mDirty = false;
 
-        return m;
+        return proxy;
     },
 
     makeImmutable: function() {
         this.makeItemBaseImmutable();
     },
 
     get duration() {
         if (this.endDate && this.startDate) {
--- a/calendar/base/src/calFilter.js
+++ b/calendar/base/src/calFilter.js
@@ -129,23 +129,23 @@ calFilterProperties.prototype = {
         }
         let props = ["start", "end", "due", "status", "category", "occurrences", "onfilter"];
         return props.every(function(prop) {
             return (this[prop] == aFilterProps[prop]);
         }, this);
     },
 
     clone: function() {
-        let cl = new calFilterProperties();
+        let cloned = new calFilterProperties();
         let props = ["start", "end", "due", "status", "category", "occurrences", "onfilter"];
         props.forEach(function(prop) {
-            cl[prop] = this[prop];
+            cloned[prop] = this[prop];
         }, this);
 
-        return cl;
+        return cloned;
     },
 
     LOG: function(aString) {
         cal.LOG("[calFilterProperties] " +
                 (aString || "") +
                 " start=" + this.start +
                 " end=" + this.end +
                 " status=" + this.status +
--- a/calendar/base/src/calIcsParser.js
+++ b/calendar/base/src/calIcsParser.js
@@ -224,19 +224,19 @@ parserState.prototype = {
     listener: null,
 
     /**
      * Checks if the timezones are missing and notifies the user via error console
      *
      * @param item      The item to check for
      * @param dt        The datetime object to check with
      */
-    checkTimezone: function(item, dt) {
-        if (dt && cal.isPhantomTimezone(dt.timezone)) {
-            let tzid = dt.timezone.tzid;
+    checkTimezone: function(item, date) {
+        if (date && cal.isPhantomTimezone(date.timezone)) {
+            let tzid = date.timezone.tzid;
             let hid = item.hashId + "#" + tzid;
             if (!(hid in this.tzErrors)) {
                 // For now, publish errors to console and alert user.
                 // In future, maybe make them available through an interface method
                 // so this UI code can be removed from the parser, and caller can
                 // choose whether to alert, or show user the problem items and ask
                 // for fixes, or something else.
                 let msgArgs = [tzid, item.title, cal.getDateFormatter().formatDateTime(dt)];
--- a/calendar/base/src/calItemBase.js
+++ b/calendar/base/src/calItemBase.js
@@ -242,85 +242,85 @@ calItemBase.prototype = {
 
     /**
      * Clones the base item's properties into the passed object, potentially
      * setting a new parent item.
      *
      * @param m     The item to clone this item into
      * @param aNewParent    (optional) The new parent item to set on m.
      */
-    cloneItemBaseInto: function(m, aNewParent) {
-        m.mImmutable = false;
-        m.mACLEntry = this.mACLEntry;
-        m.mIsProxy = this.mIsProxy;
-        m.mParentItem = calTryWrappedJSObject(aNewParent) || this.mParentItem;
-        m.mHashId = this.mHashId;
-        m.mCalendar = this.mCalendar;
+    cloneItemBaseInto: function(cloned, aNewParent) {
+        cloned.mImmutable = false;
+        cloned.mACLEntry = this.mACLEntry;
+        cloned.mIsProxy = this.mIsProxy;
+        cloned.mParentItem = calTryWrappedJSObject(aNewParent) || this.mParentItem;
+        cloned.mHashId = this.mHashId;
+        cloned.mCalendar = this.mCalendar;
         if (this.mRecurrenceInfo) {
-            m.mRecurrenceInfo = calTryWrappedJSObject(this.mRecurrenceInfo.clone());
-            m.mRecurrenceInfo.item = m;
+            cloned.mRecurrenceInfo = calTryWrappedJSObject(this.mRecurrenceInfo.clone());
+            cloned.mRecurrenceInfo.item = cloned;
         }
 
         let org = this.organizer;
         if (org) {
             org = org.clone();
         }
-        m.mOrganizer = org;
+        cloned.mOrganizer = org;
 
-        m.mAttendees = [];
+        cloned.mAttendees = [];
         for (let att of this.getAttendees({})) {
-            m.mAttendees.push(att.clone());
+            cloned.mAttendees.push(att.clone());
         }
 
-        m.mProperties = new calPropertyBag();
+        cloned.mProperties = new calPropertyBag();
         for (let [name, value] of this.mProperties) {
             if (value instanceof Components.interfaces.calIDateTime) {
                 value = value.clone();
             }
 
-            m.mProperties.setProperty(name, value);
+            cloned.mProperties.setProperty(name, value);
 
             let propBucket = this.mPropertyParams[name];
             if (propBucket) {
                 let newBucket = {};
                 for (let param in propBucket) {
                     newBucket[param] = propBucket[param];
                 }
-                m.mPropertyParams[name] = newBucket;
+                cloned.mPropertyParams[name] = newBucket;
             }
         }
 
-        m.mAttachments = [];
+        cloned.mAttachments = [];
         for (let att of this.getAttachments({})) {
-            m.mAttachments.push(att.clone());
+            cloned.mAttachments.push(att.clone());
         }
 
-        m.mRelations = [];
+        cloned.mRelations = [];
         for (let rel of this.getRelations({})) {
-            m.mRelations.push(rel.clone());
+            cloned.mRelations.push(rel.clone());
         }
 
-        m.mCategories = this.getCategories({});
+        cloned.mCategories = this.getCategories({});
 
-        m.mAlarms = [];
+        cloned.mAlarms = [];
         for (let alarm of this.getAlarms({})) {
             // Clone alarms into new item, assume the alarms from the old item
             // are valid and don't need validation.
-            m.mAlarms.push(alarm.clone());
+            cloned.mAlarms.push(alarm.clone());
         }
 
         let alarmLastAck = this.alarmLastAck;
         if (alarmLastAck) {
             alarmLastAck = alarmLastAck.clone();
         }
-        m.mAlarmLastAck = alarmLastAck;
+        cloned.mAlarmLastAck = alarmLastAck;
 
-        m.mDirty = this.mDirty;
+        cloned.mDirty = this.mDirty;
 
-        return m;
+        return cloned;
     },
 
     // attribute calIDateTime alarmLastAck;
     get alarmLastAck() {
         return this.mAlarmLastAck;
     },
     set alarmLastAck(aValue) {
         this.modify();
@@ -570,23 +570,23 @@ calItemBase.prototype = {
                 this.removeAttendee(exists);
             } else {
                 attendee = null;
             }
         }
         if (attendee) {
             if (attendee.commonName) {
                 // migration code for bug 1209399 to remove leading/training double quotes in
-                let cn = attendee.commonName.replace(/^["]*([^"]*)["]*$/, "$1");
-                if (cn.length == 0) {
-                    cn = null;
+                let commonName = attendee.commonName.replace(/^["]*([^"]*)["]*$/, "$1");
+                if (commonName.length == 0) {
+                    commonName = null;
                 }
-                if (cn != attendee.commonName) {
+                if (commonName != attendee.commonName) {
                     if (attendee.isMutable) {
-                        attendee.commonName = cn;
+                        attendee.commonName = commonName;
                     } else {
                         cal.LOG("Failed to cleanup malformed commonName for immutable attendee " +
                                 attendee.toString() + "\n" + cal.STACK(20));
                     }
                 }
             }
             this.modify();
             this.mAttendees = this.getAttendees({});
@@ -682,35 +682,35 @@ calItemBase.prototype = {
     // attribute calICalendar calendar;
     get calendar() {
         if (!this.mCalendar && (this.parentItem != this)) {
             return this.parentItem.calendar;
         } else {
             return this.mCalendar;
         }
     },
-    set calendar(v) {
+    set calendar(calendar) {
         if (this.mImmutable) {
             throw Components.results.NS_ERROR_OBJECT_IS_IMMUTABLE;
         }
         this.mHashId = null; // recompute hashId
-        this.mCalendar = v;
+        this.mCalendar = calendar;
     },
 
     // attribute calIAttendee organizer;
     get organizer() {
         if (this.mIsProxy && (this.mOrganizer === undefined)) {
             return this.mParentItem.organizer;
         } else {
             return this.mOrganizer;
         }
     },
-    set organizer(v) {
+    set organizer(organizer) {
         this.modify();
-        this.mOrganizer = v;
+        this.mOrganizer = organizer;
     },
 
     // void getCategories(out PRUint32 aCount,
     //                    [array, size_is(aCount), retval] out wstring aCategories);
     getCategories: function(aCount) {
         if (!this.mCategories && this.mIsProxy) {
             this.mCategories = this.mParentItem.getCategories(aCount);
         }
@@ -1117,19 +1117,19 @@ function makeMemberAttr(ctor, varname, d
     // XXX handle defaults!
     let getter = function() {
         if (asProperty) {
             return this.getProperty(varname);
         } else {
             return (varname in this ? this[varname] : undefined);
         }
     };
-    let setter = function(v) {
+    let setter = function(value) {
         this.modify();
         if (asProperty) {
-            return this.setProperty(varname, v);
+            return this.setProperty(varname, value);
         } else {
-            return (this[varname] = v);
+            return (this[varname] = value);
         }
     };
     ctor.prototype.__defineGetter__(attr, getter);
     ctor.prototype.__defineSetter__(attr, setter);
 }
--- a/calendar/base/src/calRecurrenceInfo.js
+++ b/calendar/base/src/calRecurrenceInfo.js
@@ -1,24 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 Components.utils.import("resource://calendar/modules/calUtils.jsm");
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-function getRidKey(dt) {
-    if (!dt) {
+function getRidKey(date) {
+    if (!date) {
         return null;
     }
-    let tz = dt.timezone;
-    if (!tz.isUTC && !tz.isFloating) {
-        dt = dt.getInTimezone(UTC());
+    let timezone = date.timezone;
+    if (!timezone.isUTC && !timezone.isFloating) {
+        date = date.getInTimezone(UTC());
     }
-    return dt.icalString;
+    return date.icalString;
 }
 
 function calRecurrenceInfo() {
     this.mRecurrenceItems = [];
     this.mExceptionMap = {};
 
     this.wrappedJSObject = this;
 }
@@ -277,18 +277,18 @@ calRecurrenceInfo.prototype = {
                 // occurrs before the event started and its illegal to EXDATE an
                 // RDATE.
                 let rdates = ritem.getOccurrences(startDate,
                                                   startDate,
                                                   null,
                                                   0,
                                                   {});
                 // Map all negative dates.
-                for (let r of rdates) {
-                    negMap[getRidKey(r)] = true;
+                for (let rdate of rdates) {
+                    negMap[getRidKey(rdate)] = true;
                 }
             } else {
                 WARN("Item '" + this.mBaseItem.title + "'" +
                      (this.mBaseItem.calendar ? " (" + this.mBaseItem.calendar.name + ")" : "") +
                      " has an infinite negative rule (EXRULE)");
             }
         }
 
@@ -542,46 +542,46 @@ calRecurrenceInfo.prototype = {
             // check exceptions here
             for (let dateToRemove of cur_dates) {
                 let dateToRemoveKey = getRidKey(dateToRemove);
                 if (dateToRemove.isDate) {
                     // As decided in bug 734245, an EXDATE of type DATE shall also match a DTSTART of type DATE-TIME
                     let toRemove = [];
                     for (let occurenceKey in occurrenceMap) {
                         if (occurrenceMap[occurenceKey] && occurenceKey.substring(0, 8) == dateToRemoveKey) {
-                            dates = dates.filter(d => d.id.compare(dateToRemove) != 0);
+                            dates = dates.filter(date => date.id.compare(dateToRemove) != 0);
                             toRemove.push(occurenceKey);
                         }
                     }
                     for (let i = 0; i < toRemove.length; i++) {
                         delete occurrenceMap[toRemove[i]];
                     }
                 } else if (occurrenceMap[dateToRemoveKey]) {
                     // TODO PERF Theoretically we could use occurrence map
                     // to construct the array of occurrences. Right now I'm
                     // just using the occurrence map to skip the filter
                     // action if the occurrence isn't there anyway.
-                    dates = dates.filter(d => d.id.compare(dateToRemove) != 0);
+                    dates = dates.filter(date => date.id.compare(dateToRemove) != 0);
                     delete occurrenceMap[dateToRemoveKey];
                 }
             }
         }
 
         // The list was already sorted above, chop anything over aMaxCount, if
         // specified.
         if (aMaxCount && dates.length > aMaxCount) {
             dates = dates.slice(0, aMaxCount);
         }
 
         return dates;
     },
 
     getOccurrenceDates: function(aRangeStart, aRangeEnd, aMaxCount, aCount) {
         let dates = this.calculateDates(aRangeStart, aRangeEnd, aMaxCount);
-        dates = dates.map(d => d.rstart);
+        dates = dates.map(date => date.rstart);
         aCount.value = dates.length;
         return dates;
     },
 
     getOccurrences: function(aRangeStart, aRangeEnd, aMaxCount, aCount) {
         let results = [];
         let dates = this.calculateDates(aRangeStart, aRangeEnd, aMaxCount);
         if (dates.length) {
@@ -608,36 +608,35 @@ calRecurrenceInfo.prototype = {
         }
         return proxy;
     },
 
     removeOccurrenceAt: function(aRecurrenceId) {
         this.ensureBaseItem();
         this.ensureMutable();
 
-        let d = Components.classes["@mozilla.org/calendar/recurrence-date;1"]
-                          .createInstance(Components.interfaces.calIRecurrenceDate);
-        d.isNegative = true;
-        d.date = aRecurrenceId.clone();
+        let rdate = Components.classes["@mozilla.org/calendar/recurrence-date;1"]
+                              .createInstance(Components.interfaces.calIRecurrenceDate);
+        rdate.isNegative = true;
+        rdate.date = aRecurrenceId.clone();
 
-        this.removeExceptionFor(d.date);
+        this.removeExceptionFor(rdate.date);
 
-        this.appendRecurrenceItem(d);
+        this.appendRecurrenceItem(rdate);
     },
 
     restoreOccurrenceAt: function(aRecurrenceId) {
         this.ensureBaseItem();
         this.ensureMutable();
         this.ensureSortedRecurrenceRules();
 
         for (let i = 0; i < this.mRecurrenceItems.length; i++) {
-            let wrappedItem = cal.wrapInstance(this.mRecurrenceItems[i], Components.interfaces.calIRecurrenceDate);
-            if (wrappedItem) {
-                let rd = wrappedItem;
-                if (rd.isNegative && rd.date.compare(aRecurrenceId) == 0) {
+            let rdate = cal.wrapInstance(this.mRecurrenceItems[i], Components.interfaces.calIRecurrenceDate);
+            if (rdate) {
+                if (rdate.isNegative && rdate.date.compare(aRecurrenceId) == 0) {
                     return this.deleteRecurrenceItemAt(i);
                 }
             }
         }
 
         throw Components.results.NS_ERROR_INVALID_ARG;
     },
 
--- a/calendar/base/src/calTimezoneService.js
+++ b/calendar/base/src/calTimezoneService.js
@@ -189,57 +189,57 @@ calTimezoneService.prototype = {
         if (tzid.startsWith("/mozilla.org/")) {
             // We know that our former tzids look like "/mozilla.org/<dtstamp>/continent/..."
             // The ending of the mozilla prefix is the index of that slash before the
             // continent. Therefore, we start looking for the prefix-ending slash
             // after position 13.
             tzid = tzid.substring(tzid.indexOf("/", 13) + 1);
         }
 
-        let tz = this.mZones.get(tzid);
-        if (!tz) {
+        let timezone = this.mZones.get(tzid);
+        if (!timezone) {
             cal.ERROR("Couldn't find " + tzid);
             return null;
         }
-        if (!tz.zone) {
-            if (tz.aliasTo) {
+        if (!timezone.zone) {
+            if (timezone.aliasTo) {
                 // This zone is an alias.
-                tz.zone = this.getTimezone(tz.aliasTo);
+                timezone.zone = this.getTimezone(timezone.aliasTo);
             } else if (Preferences.get("calendar.icaljs", false)) {
-                let parsedComp = ICAL.parse("BEGIN:VCALENDAR\r\n" + tz.ics + "\r\nEND:VCALENDAR");
+                let parsedComp = ICAL.parse("BEGIN:VCALENDAR\r\n" + timezone.ics + "\r\nEND:VCALENDAR");
                 let icalComp = new ICAL.Component(parsedComp);
                 let tzComp = icalComp.getFirstSubcomponent("vtimezone");
-                tz.zone = new calICALJSTimezone(ICAL.Timezone.fromData({
+                timezone.zone = new calICALJSTimezone(ICAL.Timezone.fromData({
                     tzid: tzid,
                     component: tzComp,
-                    latitude: tz.latitude,
-                    longitude: tz.longitude
+                    latitude: timezone.latitude,
+                    longitude: timezone.longitude
                 }));
             } else {
-                tz.zone = new calLibicalTimezone(tzid, tz.ics, tz.latitude, tz.longitude);
+                timezone.zone = new calLibicalTimezone(tzid, timezone.ics, timezone.latitude, timezone.longitude);
             }
         }
-        return tz.zone;
+        return timezone.zone;
     },
 
     get timezoneIds() {
         let zones = [];
         for (let [k, v] of this.mZones.entries()) {
             if (!v.aliasTo && k != "UTC" && k != "floating") {
                 zones.push(k);
             }
         }
         return new calStringEnumerator(zones);
     },
 
     get aliasIds() {
         let zones = [];
-        for (let [k, v] of this.mZones.entries()) {
-            if (v.aliasTo && k != "UTC" && k != "floating") {
-                zones.push(k);
+        for (let [key, value] of this.mZones.entries()) {
+            if (value.aliasTo && key != "UTC" && key != "floating") {
+                zones.push(key);
             }
         }
         return new calStringEnumerator(zones);
     },
 
     get version() {
         return this.mVersion;
     },
@@ -325,54 +325,54 @@ function guessSystemTimezone() {
     // * standard offset and daylight/summer offset if present (longitude),
     // * if has summer time, direction of change (northern/southern hemisphere)
     // * if has summer time, dates of next transitions
     // * timezone name (such as "Western European Standard Time").
     // Score is 3 if matches dates and names, 2 if matches dates without names,
     // 1 if matches dates within a week (so changes on different weekday),
     // otherwise 0 if no match.
     function checkTZ(tzId) {
-        let tz = tzSvc.getTimezone(tzId);
+        let timezone = tzSvc.getTimezone(tzId);
 
         // Have to handle UTC separately because it has no .icalComponent.
-        if (tz.isUTC) {
+        if (timezone.isUTC) {
             if (offsetDec == 0 && offsetJun == 0) {
                 if (tzNameJun == "UTC" && tzNameDec == "UTC") {
                     return 3;
                 } else {
                     return 2;
                 }
             } else {
                 return 0;
             }
         }
 
-        let subComp = tz.icalComponent;
+        let subComp = timezone.icalComponent;
         // find currently applicable time period, not just first,
         // because offsets of timezone may be changed over the years.
-        let standard = findCurrentTimePeriod(tz, subComp, "STANDARD");
+        let standard = findCurrentTimePeriod(timezone, subComp, "STANDARD");
         let standardTZOffset = getIcalString(standard, "TZOFFSETTO");
         let standardName = getIcalString(standard, "TZNAME");
-        let daylight = findCurrentTimePeriod(tz, subComp, "DAYLIGHT");
+        let daylight = findCurrentTimePeriod(timezone, subComp, "DAYLIGHT");
         let daylightTZOffset = getIcalString(daylight, "TZOFFSETTO");
         let daylightName = getIcalString(daylight, "TZNAME");
 
         // Try northern hemisphere cases.
         if (offsetDec == standardTZOffset && offsetDec == offsetJun &&
             !daylight) {
             if (standardName && standardName == tzNameJun) {
                 return 3;
             } else {
                 return 2;
             }
         }
 
         if (offsetDec == standardTZOffset && offsetJun == daylightTZOffset &&
             daylight) {
-            let dateMatchWt = systemTZMatchesTimeShiftDates(tz, subComp);
+            let dateMatchWt = systemTZMatchesTimeShiftDates(timezone, subComp);
             if (dateMatchWt > 0) {
                 if (standardName && standardName == tzNameJun &&
                     daylightName && daylightName == tzNameDec) {
                     return 3;
                 } else {
                     return dateMatchWt;
                 }
             }
@@ -385,60 +385,61 @@ function guessSystemTimezone() {
                 return 3;
             } else {
                 return 2;
             }
         }
 
         if (offsetJun == standardTZOffset && offsetDec == daylightTZOffset &&
             daylight) {
-            let dateMatchWt = systemTZMatchesTimeShiftDates(tz, subComp);
+            let dateMatchWt = systemTZMatchesTimeShiftDates(timezone, subComp);
             if (dateMatchWt > 0) {
                 if (standardName && standardName == tzNameJun &&
                     daylightName && daylightName == tzNameDec) {
                     return 3;
                 } else {
                     return dateMatchWt;
                 }
             }
         }
         return 0;
     }
 
     // returns 2=match-within-hours, 1=match-within-week, 0=no-match
-    function systemTZMatchesTimeShiftDates(tz, subComp) {
+    function systemTZMatchesTimeShiftDates(timezone, subComp) {
         // Verify local autumn and spring shifts also occur in system timezone
         // (jsDate) on correct date in correct direction.
         // (Differs for northern/southern hemisphere.
         //  Local autumn shift is to local winter STANDARD time.
         //  Local spring shift is to local summer DAYLIGHT time.)
         const autumnShiftJSDate =
-            findCurrentTimePeriod(tz, subComp, "STANDARD", true);
+            findCurrentTimePeriod(timezone, subComp, "STANDARD", true);
         const afterAutumnShiftJSDate = new Date(autumnShiftJSDate);
         const beforeAutumnShiftJSDate = new Date(autumnShiftJSDate);
         const springShiftJSDate =
-            findCurrentTimePeriod(tz, subComp, "DAYLIGHT", true);
+            findCurrentTimePeriod(timezone, subComp, "DAYLIGHT", true);
         const beforeSpringShiftJSDate = new Date(springShiftJSDate);
         const afterSpringShiftJSDate = new Date(springShiftJSDate);
         // Try with 6 HOURS fuzz in either direction, since OS and ZoneInfo
         // may disagree on the exact time of shift (midnight, 2am, 4am, etc).
         beforeAutumnShiftJSDate.setHours(autumnShiftJSDate.getHours() - 6);
         afterAutumnShiftJSDate.setHours(autumnShiftJSDate.getHours() + 6);
         afterSpringShiftJSDate.setHours(afterSpringShiftJSDate.getHours() + 6);
         beforeSpringShiftJSDate.setHours(beforeSpringShiftJSDate.getHours() - 6);
         if ((beforeAutumnShiftJSDate.getTimezoneOffset() <
              afterAutumnShiftJSDate.getTimezoneOffset()) &&
             (beforeSpringShiftJSDate.getTimezoneOffset() >
              afterSpringShiftJSDate.getTimezoneOffset())) {
             return 2;
         }
-        // Try with 7 DAYS fuzz in either direction, so if no other tz found,
-        // will have a nearby tz that disagrees only on the weekday of shift
-        // (sunday vs. friday vs. calendar day), or off by exactly one week,
-        // (e.g., needed to guess Africa/Cairo on w2k in 2006).
+        // Try with 7 DAYS fuzz in either direction, so if no other timezone
+        // found, will have a nearby timezone that disagrees only on the
+        // weekday of shift (sunday vs. friday vs. calendar day), or off by
+        // exactly one week, (e.g., needed to guess Africa/Cairo on w2k in
+        // 2006).
         beforeAutumnShiftJSDate.setDate(autumnShiftJSDate.getDate() - 7);
         afterAutumnShiftJSDate.setDate(autumnShiftJSDate.getDate() + 7);
         afterSpringShiftJSDate.setDate(afterSpringShiftJSDate.getDate() + 7);
         beforeSpringShiftJSDate.setDate(beforeSpringShiftJSDate.getDate() - 7);
         if ((beforeAutumnShiftJSDate.getTimezoneOffset() <
              afterAutumnShiftJSDate.getTimezoneOffset()) &&
             (beforeSpringShiftJSDate.getTimezoneOffset() >
              afterSpringShiftJSDate.getTimezoneOffset())) {
@@ -450,27 +451,27 @@ function guessSystemTimezone() {
 
     const todayUTC = cal.jsDateToDateTime(new Date());
     const oneYrUTC = todayUTC.clone(); oneYrUTC.year += 1;
     const periodStartCalDate = cal.createDateTime();
     const periodUntilCalDate = cal.createDateTime(); // until timezone is UTC
     const periodCalRule = cal.createRecurrenceRule();
     const untilRegex = /UNTIL=(\d{8}T\d{6}Z)/;
 
-    function findCurrentTimePeriod(tz, subComp, standardOrDaylight,
+    function findCurrentTimePeriod(timezone, subComp, standardOrDaylight,
                                    isForNextTransitionDate) {
         // Iterate through 'STANDARD' declarations or 'DAYLIGHT' declarations
         // (periods in history with different settings.
         //  e.g., US changes daylight start in 2007 (from April to March).)
         // Each period is marked by a DTSTART.
         // Find the currently applicable period: has most recent DTSTART
         // not later than today and no UNTIL, or UNTIL is greater than today.
         for (let period of cal.ical.subcomponentIterator(subComp, standardOrDaylight)) {
             periodStartCalDate.icalString = getIcalString(period, "DTSTART");
-            periodStartCalDate.timezone = tz;
+            periodStartCalDate.timezone = timezone;
             if (oneYrUTC.nativeTime < periodStartCalDate.nativeTime) {
                 continue; // period starts too far in future
             }
             // Must examine UNTIL date (not next daylight start) because
             // some zones (e.g., Arizona, Hawaii) may stop using daylight
             // time, so there might not be a next daylight start.
             let rrule = period.getFirstProperty("RRULE");
             if (rrule) {
@@ -562,19 +563,19 @@ function guessSystemTimezone() {
                 fileInstream.close();
             }
         } catch (ex) {
             Components.utils.reportError(filepath + ": " + ex);
             return "";
         }
     }
 
-    function weekday(icsDate, tz) {
+    function weekday(icsDate, timezone) {
         let calDate = cal.createDateTime(icsDate);
-        calDate.timezone = tz;
+        calDate.timezone = timezone;
         return cal.dateTimeToJsDate(calDate).toLocaleFormat("%a");
     }
 
     // Try to find a tz that matches OS/JSDate timezone.  If no name match,
     // will use first of probable timezone(s) with highest score.
     let probableTZId = "floating"; // default fallback tz if no tz matches.
     let probableTZScore = 0;
     let probableTZSource = null;
@@ -760,34 +761,34 @@ function guessSystemTimezone() {
     // If reach here, there were no score=3 matches, so Warn in console.
     try {
         switch (probableTZScore) {
         case 0:
             cal.WARN(calProperties.GetStringFromName("warningUsingFloatingTZNoMatch"));
             break;
         case 1: case 2:
             let tzId = probableTZId;
-            let tz = tzSvc.getTimezone(tzId);
-            let subComp = tz.icalComponent;
-            let standard = findCurrentTimePeriod(tz, subComp, "STANDARD");
+            let timezone = tzSvc.getTimezone(tzId);
+            let subComp = timezone.icalComponent;
+            let standard = findCurrentTimePeriod(timezone, subComp, "STANDARD");
             let standardTZOffset = getIcalString(standard, "TZOFFSETTO");
-            let daylight = findCurrentTimePeriod(tz, subComp, "DAYLIGHT");
+            let daylight = findCurrentTimePeriod(timezone, subComp, "DAYLIGHT");
             let daylightTZOffset = getIcalString(daylight, "TZOFFSETTO");
             let warningDetail;
             if (probableTZScore == 1) {
                 // score 1 means has daylight time,
                 // but transitions start on different weekday from os timezone.
                 let standardStart = getIcalString(standard, "DTSTART");
-                let standardStartWeekday = weekday(standardStart, tz);
+                let standardStartWeekday = weekday(standardStart, timezone);
                 let standardRule = getIcalString(standard, "RRULE");
                 let standardText =
                     "  Standard: " + standardStart + " " + standardStartWeekday + "\n" +
                     "            " + standardRule + "\n";
                 let daylightStart = getIcalString(daylight, "DTSTART");
-                let daylightStartWeekday = weekday(daylightStart, tz);
+                let daylightStartWeekday = weekday(daylightStart, timezone);
                 let daylightRule = getIcalString(daylight, "RRULE");
                 let daylightText =
                     "  Daylight: " + daylightStart + " " + daylightStartWeekday + "\n" +
                     "            " + daylightRule + "\n";
                 warningDetail =
                     (standardStart < daylightStart
                       ? standardText + daylightText
                       : daylightText + standardText) +
--- a/calendar/base/src/calTodo.js
+++ b/calendar/base/src/calTodo.js
@@ -34,54 +34,54 @@ calTodo.prototype = {
     classInfo: XPCOMUtils.generateCI({
         classID: calTodoClassID,
         contractID: "@mozilla.org/calendar/todo;1",
         classDescription: "Calendar Todo",
         interfaces: calTodoInterfaces,
     }),
 
     cloneShallow: function(aNewParent) {
-        let m = new calTodo();
-        this.cloneItemBaseInto(m, aNewParent);
-        return m;
+        let cloned = new calTodo();
+        this.cloneItemBaseInto(cloned, aNewParent);
+        return cloned;
     },
 
     createProxy: function(aRecurrenceId) {
         cal.ASSERT(!this.mIsProxy, "Tried to create a proxy for an existing proxy!", true);
 
-        let m = new calTodo();
+        let proxy = new calTodo();
 
         // override proxy's DTSTART/DUE/RECURRENCE-ID
         // before master is set (and item might get immutable):
         let duration = this.duration;
         if (duration) {
             let dueDate = aRecurrenceId.clone();
             dueDate.addDuration(duration);
-            m.dueDate = dueDate;
+            proxy.dueDate = dueDate;
         }
-        m.entryDate = aRecurrenceId;
+        proxy.entryDate = aRecurrenceId;
 
-        m.initializeProxy(this, aRecurrenceId);
-        m.mDirty = false;
+        proxy.initializeProxy(this, aRecurrenceId);
+        proxy.mDirty = false;
 
-        return m;
+        return proxy;
     },
 
     makeImmutable: function() {
         this.makeItemBaseImmutable();
     },
 
     get isCompleted() {
         return this.completedDate != null ||
                this.percentComplete == 100 ||
                this.status == "COMPLETED";
     },
 
-    set isCompleted(v) {
-        if (v) {
+    set isCompleted(completed) {
+        if (completed) {
             if (!this.completedDate) {
                 this.completedDate = cal.jsDateToDateTime(new Date());
             }
             this.status = "COMPLETED";
             this.percentComplete = 100;
         } else {
             this.deleteProperty("COMPLETED");
             this.deleteProperty("STATUS");
--- a/calendar/base/src/calUtils.js
+++ b/calendar/base/src/calUtils.js
@@ -173,20 +173,20 @@ function getRecentTimezones(aConvertZone
     if (!Array.isArray(recentTimezones)) {
         recentTimezones = [];
     }
 
     let tzService = cal.getTimezoneService();
     if (aConvertZones) {
         let oldZonesLength = recentTimezones.length;
         for (let i = 0; i < recentTimezones.length; i++) {
-            let tz = tzService.getTimezone(recentTimezones[i]);
-            if (tz) {
+            let timezone = tzService.getTimezone(recentTimezones[i]);
+            if (timezone) {
                 // Replace id with found timezone
-                recentTimezones[i] = tz;
+                recentTimezones[i] = timezone;
             } else {
                 // Looks like the timezone doesn't longer exist, remove it
                 recentTimezones.splice(i, 1);
                 i--;
             }
         }
 
         if (oldZonesLength != recentTimezones.length) {
@@ -217,19 +217,19 @@ function getRecentTimezones(aConvertZone
  *   nmchar            [_a-zA-Z0-9-]|{nonascii}|{escape}
  *   name              {nmchar}+
  *   http://www.w3.org/TR/CSS21/grammar.html#scanner
  *
  * @param aString       The unicode string to format
  * @return              The formatted string using only chars [_a-zA-Z0-9-]
  */
 function formatStringForCSSRule(aString) {
-    function toReplacement(ch) {
+    function toReplacement(char) {
         // char code is natural number (positive integer)
-        let nat = ch.charCodeAt(0);
+        let nat = char.charCodeAt(0);
         switch (nat) {
             case 0x20: // space
                 return "_";
             default:
                 return "-ux" + nat.toString(16) + "-"; // lowercase
         }
     }
     // Result must be lowercase or style rule will not work.
@@ -406,18 +406,18 @@ function makeURL(aUriString) {
     return Services.io.newURI(aUriString, null, null);
 }
 
 /**
  * Returns a calIDateTime that corresponds to the current time in the user's
  * default timezone.
  */
 function now() {
-    let d = cal.jsDateToDateTime(new Date());
-    return d.getInTimezone(calendarDefaultTimezone());
+    let date = cal.jsDateToDateTime(new Date());
+    return date.getInTimezone(calendarDefaultTimezone());
 }
 
 /**
  * Selects an item with id aItemId in the radio group with id aRadioGroupId
  *
  * @param aRadioGroupId  the id of the radio group which contains the item
  * @param aItemId        the item to be selected
  */
@@ -696,19 +696,19 @@ function calGetString(aBundleName, aStri
         let props = Services.strings.createBundle(propName);
 
         if (aParams && aParams.length) {
             return props.formatStringFromName(aStringName, aParams, aParams.length);
         } else {
             return props.GetStringFromName(aStringName);
         }
     } catch (ex) {
-        let s = "Failed to read '" + aStringName + "' from " + propName + ".";
-        Components.utils.reportError(s + " Error: " + ex);
-        return s;
+        let msg = "Failed to read '" + aStringName + "' from " + propName + ".";
+        Components.utils.reportError(msg + " Error: " + ex);
+        return msg;
     }
 }
 
 /**
  * Make a UUID using the UUIDGenerator service available, we'll use that.
  */
 function getUUID() {
     let uuidGen = Components.classes["@mozilla.org/uuid-generator;1"]
@@ -1289,25 +1289,25 @@ function calOperationGroup(cancelFunc) {
 }
 calOperationGroup.prototype = {
     mCancelFunc: null,
     mId: null,
     mIsPending: true,
     mStatus: Components.results.NS_OK,
     mSubOperations: null,
 
-    add: function(op) {
-        if (op && op.isPending) {
-            this.mSubOperations.push(op);
+    add: function(aOperation) {
+        if (aOperation && aOperation.isPending) {
+            this.mSubOperations.push(aOperation);
         }
     },
 
-    remove: function(op) {
-        if (op) {
-            this.mSubOperations = this.mSubOperations.filter(op_ => op.id != op_.id);
+    remove: function(aOperation) {
+        if (aOperation) {
+            this.mSubOperations = this.mSubOperations.filter(operation => aOperation.id != operation.id);
         }
     },
 
     get isEmpty() {
         return (this.mSubOperations.length == 0);
     },
 
     notifyCompleted: function(status) {
@@ -1345,18 +1345,18 @@ calOperationGroup.prototype = {
             this.notifyCompleted(status);
             let cancelFunc = this.mCancelFunc;
             if (cancelFunc) {
                 this.mCancelFunc = null;
                 cancelFunc();
             }
             let subOperations = this.mSubOperations;
             this.mSubOperations = [];
-            for (let op of subOperations) {
-                op.cancel(Components.interfaces.calIErrors.OPERATION_CANCELLED);
+            for (let operation of subOperations) {
+                operation.cancel(Components.interfaces.calIErrors.OPERATION_CANCELLED);
             }
         }
     }
 };
 
 function sameDay(date1, date2) {
     if (date1 && date2) {
         if ((date1.day == date2.day) &&
@@ -1769,20 +1769,20 @@ function compareItemContent(aFirstItem, 
 function binarySearch(itemArray, newItem, comptor) {
     function binarySearchInternal(low, high) {
         // Are we done yet?
         if (low == high) {
             return low + (comptor(newItem, itemArray[low]) < 0 ? 0 : 1);
         }
 
         let mid = Math.floor(low + ((high - low) / 2));
-        let q = comptor(newItem, itemArray[mid]);
-        if (q > 0) {
+        let cmp = comptor(newItem, itemArray[mid]);
+        if (cmp > 0) {
             return binarySearchInternal(mid + 1, high);
-        } else if (q < 0) {
+        } else if (cmp < 0) {
             return binarySearchInternal(low, mid);
         } else {
             return mid;
         }
     }
 
     if (itemArray.length < 1) {
         return -1;
--- a/calendar/import-export/calOutlookCSVImportExport.js
+++ b/calendar/import-export/calOutlookCSVImportExport.js
@@ -363,50 +363,50 @@ calOutlookCSVImporter.prototype = {
         } while (eventRegExp.lastIndex != 0);
 
         // return results
         aCount.value = eventArray.length;
         return eventArray;
     },
 
     parseDateTime: function(aDate, aTime, aLocale) {
-        let dt = cal.createDateTime();
+        let date = cal.createDateTime();
 
         // XXX Can we do better?
-        dt.timezone = cal.floating();
+        date.timezone = cal.floating();
 
-        let rd = aLocale.dateRe.exec(aDate);
-        let rt = aLocale.timeRe.exec(aTime);
+        let datepart = aLocale.dateRe.exec(aDate);
+        let timepart = aLocale.timeRe.exec(aTime);
 
-        if (!rd || !rt) {
+        if (!datepart || !timepart) {
             return null;
         }
 
-        dt.year = rd[aLocale.dateYearIndex];
-        dt.month = rd[aLocale.dateMonthIndex] - 1;
-        dt.day = rd[aLocale.dateDayIndex];
-        if (rt) {
-            dt.hour = Number(rt[aLocale.timeHourIndex]);
-            dt.minute = rt[aLocale.timeMinuteIndex];
-            dt.second = rt[aLocale.timeSecondIndex];
+        date.year = datepart[aLocale.dateYearIndex];
+        date.month = datepart[aLocale.dateMonthIndex] - 1;
+        date.day = datepart[aLocale.dateDayIndex];
+        if (timepart) {
+            date.hour = Number(timepart[aLocale.timeHourIndex]);
+            date.minute = timepart[aLocale.timeMinuteIndex];
+            date.second = timepart[aLocale.timeSecondIndex];
         } else {
-            dt.isDate = true;
+            date.isDate = true;
         }
 
-        if (rt && aLocale.timeAmPmIndex &&
-            rt[aLocale.timeAmPmIndex] != aLocale.timePmString) {
+        if (timepart && aLocale.timeAmPmIndex &&
+            timepart[aLocale.timeAmPmIndex] != aLocale.timePmString) {
             // AM
-            if (dt.hour == 12) {
-                dt.hour = 0;
+            if (date.hour == 12) {
+                date.hour = 0;
             }
-        } else if (dt.hour < 12) {
+        } else if (date.hour < 12) {
            // PM
-           dt.hour += 12;
+           date.hour += 12;
         }
-        return dt;
+        return date;
     },
 
     parseTextField: function(aTextField) {
         return aTextField ? aTextField.replace(/""/g, "\"") : "";
     }
 };
 
 // Exporter
@@ -444,17 +444,17 @@ calOutlookCSVExporter.prototype = {
         headers.push(localeEn.headAllDayEvent);
         headers.push(localeEn.headAlarm);
         headers.push(localeEn.headAlarmDate);
         headers.push(localeEn.headAlarmTime);
         headers.push(localeEn.headCategories);
         headers.push(localeEn.headDescription);
         headers.push(localeEn.headLocation);
         headers.push(localeEn.headPrivate);
-        headers = headers.map(v => '"' + v + '"');
+        headers = headers.map(hdr => '"' + hdr + '"');
         str = headers.join(",");
         str += exportLineEnding;
         aStream.write(str, str.length);
 
         for (let item of aItems) {
             if (!cal.isEvent(item)) {
                 // XXX TODO: warn the user (once) that tasks are not supported
                 // (bug 336175)
@@ -475,14 +475,14 @@ calOutlookCSVExporter.prototype = {
             line.push(alarmDate ? localeEn.valueTrue : localeEn.valueFalse);
             line.push(alarmDate ? dateString(alarmDate) : "");
             line.push(alarmDate ? timeString(alarmDate) : "");
             line.push(txtString(cal.categoriesArrayToString(item.getCategories({})))); // xxx todo: what's the correct way to encode ',' in csv?, how are multi-values expressed?
             line.push(txtString(item.getProperty("DESCRIPTION")));
             line.push(txtString(item.getProperty("LOCATION")));
             line.push(item.privacy == "PRIVATE" ? localeEn.valueTrue : localeEn.valueFalse);
 
-            line = line.map(v => `"${String(v).replace(/"/g, '""')}"`);
+            line = line.map(value => `"${String(value).replace(/"/g, '""')}"`);
             str = line.join(",") + exportLineEnding;
             aStream.write(str, str.length);
         }
     }
 };
--- a/calendar/itip/calItipEmailTransport.js
+++ b/calendar/itip/calItipEmailTransport.js
@@ -252,17 +252,17 @@ calItipEmailTransport.prototype = {
                 }
                 let cbEmail = function(aVal, aInd, aArr) {
                     let email = cal.getAttendeeEmail(aVal, true);
                     if (!email.length) {
                         cal.LOG("Invalid recipient for email transport: " + aVal.toString());
                     }
                     return email;
                 };
-                let toMap = aToList.map(cbEmail).filter(v => v.length);
+                let toMap = aToList.map(cbEmail).filter(value => value.length);
                 if (toMap.length < aToList.length) {
                     // at least one invalid recipient, so we skip sending for this message
                     return false;
                 }
                 let toList = toMap.join(", ");
                 let composeUtils = Components.classes["@mozilla.org/messengercompose/computils;1"]
                                              .createInstance(Components.interfaces.nsIMsgCompUtils);
                 let messageId = composeUtils.msgGenerateMessageId(identity);
@@ -277,16 +277,17 @@ calItipEmailTransport.prototype = {
                     composeFields.from = (cal.validateRecipientList(mailfrom) == mailfrom ? mailfrom : identity.email);
                     composeFields.replyTo = identity.replyTo;
                     composeFields.organization = identity.organization;
                     composeFields.messageId = messageId;
                     let validRecipients;
                     if (identity.doCc) {
                         validRecipients = cal.validateRecipientList(identity.doCcList);
                         if (validRecipients != "") {
+                            // eslint-disable-next-line id-length
                             composeFields.cc = validRecipients;
                         }
                     }
                     if (identity.doBcc) {
                         validRecipients = cal.validateRecipientList(identity.doBccList);
                         if (validRecipients != "") {
                             composeFields.bcc = validRecipients;
                         }
--- a/calendar/lightning/components/calItipProtocolHandler.js
+++ b/calendar/lightning/components/calItipProtocolHandler.js
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 Components.utils.import("resource://calendar/modules/calUtils.jsm");
 
-var CI = Components.interfaces;
+var Ci = Components.interfaces;
 
 var ITIP_HANDLER_MIMETYPE = "application/x-itip-internal";
 var ITIP_HANDLER_PROTOCOL = "moz-cal-handle-itip";
 var NS_ERROR_WONT_HANDLE_CONTENT = 0x805d0001;
 
 
 function NYI() {
     throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
@@ -67,25 +67,25 @@ ItipProtocolHandler.prototype = {
     QueryInterface: XPCOMUtils.generateQI(ItipProtocolHandlerInterfaces),
     classInfo: XPCOMUtils.generateCI({
         classID: ItipProtocolHandlerClassID,
         contractID: "@mozilla.org/network/protocol;1?name=" + ITIP_HANDLER_PROTOCOL,
         classDescription: "iTIP Protocol Handler",
         interfaces: ItipProtocolHandlerInterfaces
     }),
 
-    protocolFlags: CI.nsIProtocolHandler.URI_NORELATIVE | CI.nsIProtocolHandler.URI_DANGEROUS_TO_LOAD,
+    protocolFlags: Ci.nsIProtocolHandler.URI_NORELATIVE | Ci.nsIProtocolHandler.URI_DANGEROUS_TO_LOAD,
     allowPort: () => false,
     isSecure: false,
     newURI: function(spec, charSet, baseURI) {
         let cls = Components.classes["@mozilla.org/network/standard-url;1"];
-        let url = cls.createInstance(CI.nsIStandardURL);
-        url.init(CI.nsIStandardURL.URLTYPE_STANDARD, 0, spec, charSet, baseURI);
+        let url = cls.createInstance(Ci.nsIStandardURL);
+        url.init(Ci.nsIStandardURL.URLTYPE_STANDARD, 0, spec, charSet, baseURI);
         dump("Creating new URI for " + spec + "\n");
-        return url.QueryInterface(CI.nsIURI);
+        return url.QueryInterface(Ci.nsIURI);
     },
 
     newChannel: function(URI) {
         return this.newChannel2(URI, null);
     },
 
     newChannel2: function(URI, aLoadInfo) {
         dump("Creating new ItipChannel for " + URI + "\n");
@@ -104,28 +104,28 @@ ItipContentHandler.prototype = {
     classInfo: XPCOMUtils.generateCI({
         classID: ItipContentHandlerClassID,
         contractID: "@mozilla.org/uriloader/content-handler;1?type=" + ITIP_HANDLER_MIMETYPE,
         classDescription: "Lightning text/calendar content handler",
         interfaces: ItipContentHandlerInterfaces
     }),
 
     handleContent: function(contentType, windowTarget, request) {
-        let channel = request.QueryInterface(CI.nsIChannel);
+        let channel = request.QueryInterface(Ci.nsIChannel);
         let uri = channel.URI.spec;
         if (!uri.startsWith(ITIP_HANDLER_PROTOCOL + ":")) {
             cal.ERROR("Unexpected iTIP uri: " + uri + "\n");
             throw NS_ERROR_WONT_HANDLE_CONTENT;
         }
         // moz-cal-handle-itip:///?
         let paramString = uri.substring(ITIP_HANDLER_PROTOCOL.length + 4);
         let paramArray = paramString.split("&");
         let paramBlock = { };
-        paramArray.forEach((v) => {
-            let parts = v.split("=");
+        paramArray.forEach((value) => {
+            let parts = value.split("=");
             paramBlock[parts[0]] = unescape(unescape(parts[1]));
         });
         // dump("content-handler: have params " + paramBlock.toSource() + "\n");
         let event = cal.createEvent(paramBlock.data);
         dump("Processing iTIP event '" + event.title + "' from " +
             event.organizer.id + " (" + event.id + ")\n");
         let calMgr = cal.getCalendarManager();
         let cals = calMgr.getCalendars({});
--- a/calendar/lightning/content/html-item-editing/react-code.js
+++ b/calendar/lightning/content/html-item-editing/react-code.js
@@ -249,19 +249,19 @@ var TopComponent = React.createClass({
             categoriesList: this.props.initialCategoriesList,
             attachments: this.props.initialAttachments,
 
             isWideview: (window.innerWidth > 750),
             activeTab: 0
         };
     },
     updateWideview: function() {
-        let wv = (window.innerWidth > 750);
-        if (wv != this.state.isWideview) {
-            this.setState({ isWideview: wv });
+        let wideview = (window.innerWidth > 750);
+        if (wideview != this.state.isWideview) {
+            this.setState({ isWideview: wideview });
         }
     },
     componentWillMount: function() {
         this.updateWideview();
     },
     componentDidMount: function() {
         window.addEventListener("resize", this.updateWideview);
     },
@@ -281,17 +281,17 @@ var TopComponent = React.createClass({
     handleSimpleChange: function(aKey, aValue) {
         let obj = {};
         obj[aKey] = aValue;
         this.setState(obj);
     },
     handleShowTimeAsChange: function(aKey, aValue) {
         // convert from true/false to OPAQUE/TRANSPARENT
         let list = this.props.showTimeAsList;
-        let index = list.findIndex((t) => (t[1] == aValue));
+        let index = list.findIndex(i => (i[1] == aValue));
         let newValue = list[index][0];
         this.handleSimpleChange(aKey, newValue);
     },
     linkClicked: function(aValue) {
 
     },
     onDeleteCapsule: function(aKey, aValue) {
         let a = this.state[aKey];
@@ -475,18 +475,17 @@ var TopComponent = React.createClass({
                 keyprop: "priority",
                 value: this.state.priority,
                 options: this.props.priorityList,
                 onInput: this.handleSimpleChange,
                 disabled: !this.props.supportsPriority
             })
         );
 
-        let tIndex = this.props.showTimeAsList.findIndex(
-            (t) => (t[0] == this.state.showTimeAs));
+        let tIndex = this.props.showTimeAsList.findIndex(i => (i[0] == this.state.showTimeAs));
         let showTimeAsDiv = React.DOM.div(
             { id: "showTimeAsDiv", className: "box" },
             React.createElement(Checkbox, {
                 keyprop: "showTimeAs",
                 checked: (tIndex == -1 ? false : this.props.showTimeAsList[tIndex][1]),
                 onInput: this.handleShowTimeAsChange,
                 options: this.props.showTimeAsList
             }),
@@ -540,17 +539,17 @@ var TopComponent = React.createClass({
                     statusDiv,
                     priorityDiv,
                     showTimeAsDiv
                 ),
                 remindersDiv,
                 attachmentsDiv,
                 attendeesDiv
             ];
-            let tabpanels = this.props.tabs.map((m, index) => {
+            let tabpanels = this.props.tabs.map((elem, index) => {
                 return React.DOM.div({
                         className: "box tabpanel " + (this.state.activeTab == index ? "" : "hidden"),
                         key: "tabpanelkey " + index
                     },
                     tabpanelChildren[index]
                 );
             });
             return React.DOM.div({ id: "topwrapper" },
--- a/calendar/lightning/content/imip-bar.js
+++ b/calendar/lightning/content/imip-bar.js
@@ -122,25 +122,19 @@ var ltnImipBar = {
         buttons.forEach(hideElement);
         buttons.forEach(aButton => ltnImipBar.getMenuItems(aButton).forEach(showElement));
     },
 
     /**
      * Provides a list of all available buttons
      */
     getButtons: function() {
-        let buttons = [];
-        let nl = document.getElementById("imip-view-toolbar")
-                         .getElementsByTagName("toolbarbutton");
-        if (nl != null && nl.length > 0) {
-            for (let button of nl) {
-                buttons.push(button);
-            }
-        }
-        return buttons;
+        let toolbarbuttons = document.getElementById("imip-view-toolbar")
+                                     .getElementsByTagName("toolbarbutton");
+        return Array.from(toolbarbuttons);
     },
 
     /**
      * Provides a list of available menuitems of a button
      *
      * @param aButton        button node
      */
     getMenuItems: function(aButton) {
@@ -208,18 +202,18 @@ var ltnImipBar = {
         // folder flags only may lead to false positives.
         let isOutgoing = function(aMsgHdr) {
             if (!aMsgHdr) {
                 return false;
             }
             let author = aMsgHdr.mime2DecodedAuthor;
             let isSentFolder = aMsgHdr.folder.flags & nsMsgFolderFlags.SentMail;
             if (author && isSentFolder) {
-                let am = MailServices.accounts;
-                for (let identity in fixIterator(am.allIdentities,
+                let accounts = MailServices.accounts;
+                for (let identity in fixIterator(accounts.allIdentities,
                                                  Components.interfaces.nsIMsgIdentity)) {
                     if (author.includes(identity.email) && !identity.fccReplyFollowParent) {
                         return true;
                     }
                 }
             }
             return false;
         };
--- a/calendar/lightning/content/lightning-item-iframe.js
+++ b/calendar/lightning/content/lightning-item-iframe.js
@@ -565,21 +565,21 @@ function loadDialog(aItem) {
         let calendarList = unfilteredList.filter((calendar) =>
            (calendar.id == calendarToUse.id ||
             (calendar &&
              isCalendarWritable(calendar) &&
              (userCanAddItemsToCalendar(calendar) ||
               (calendar == aItem.calendar && userCanModifyItem(aItem))) &&
              isItemSupported(aItem, calendar))));
 
-        itemProps.calendarList = calendarList.map((c) => [c.id, c.name]);
+        itemProps.calendarList = calendarList.map(calendar => [calendar.id, calendar.name]);
 
         if (calendarToUse && calendarToUse.id) {
             let index = itemProps.calendarList.findIndex(
-                (c) => (c[0] == calendarToUse.id));
+                calendar => (calendar[0] == calendarToUse.id));
             if (index != -1) {
                 itemProps.initialCalendarId = calendarToUse.id;
             }
         }
     } else {
         let calendarList = document.getElementById("item-calendar");
         removeChildren(calendarList);
         let indexToSelect = appendCalendarItems(aItem, calendarList, aItem.calendar || window.arguments[0].calendar);
@@ -1128,35 +1128,35 @@ function dateTimeControls2State(aStartDa
 function updateEntryDate() {
     updateDateCheckboxes(
         "todo-entrydate",
         "todo-has-entrydate",
         {
             isValid: function() {
                 return gStartTime != null;
             },
-            setDateTime: function(dt) {
-                gStartTime = dt;
+            setDateTime: function(date) {
+                gStartTime = date;
             }
         });
 }
 
 /**
  * Updates the due date checkboxes.
  */
 function updateDueDate() {
     updateDateCheckboxes(
         "todo-duedate",
         "todo-has-duedate",
         {
             isValid: function() {
                 return gEndTime != null;
             },
-            setDateTime: function(dt) {
-                gEndTime = dt;
+            setDateTime: function(date) {
+                gEndTime = date;
             }
         });
 }
 
 /**
  * Common function used by updateEntryDate and updateDueDate to set up the
  * checkboxes correctly.
  *
@@ -1178,18 +1178,18 @@ function updateDateCheckboxes(aDatePicke
     setElementValue(aDatePickerId, getElementValue(aDatePickerId));
 
     // first of all disable the datetime picker if we don't have a date
     let hasDate = getElementValue(aCheckboxId, "checked");
     setElementValue(aDatePickerId, !hasDate, "disabled");
 
     // create a new datetime object if date is now checked for the first time
     if (hasDate && !aDateTime.isValid()) {
-        let dt = cal.jsDateToDateTime(getElementValue(aDatePickerId), cal.calendarDefaultTimezone());
-        aDateTime.setDateTime(dt);
+        let date = cal.jsDateToDateTime(getElementValue(aDatePickerId), cal.calendarDefaultTimezone());
+        aDateTime.setDateTime(date);
     } else if (!hasDate && aDateTime.isValid()) {
         aDateTime.setDateTime(null);
     }
 
     // calculate the duration if possible
     let hasEntryDate = getElementValue("todo-has-entrydate", "checked");
     let hasDueDate = getElementValue("todo-has-duedate", "checked");
     if (hasEntryDate && hasDueDate) {
@@ -1231,21 +1231,21 @@ function getRepeatTypeAndUntilDate(aItem
         }
     };
 
     if (recurrenceInfo) {
         repeatType = "custom";
         let ritems = recurrenceInfo.getRecurrenceItems({});
         let rules = [];
         let exceptions = [];
-        for (let r of ritems) {
-            if (r.isNegative) {
-                exceptions.push(r);
+        for (let ritem of ritems) {
+            if (ritem.isNegative) {
+                exceptions.push(ritem);
             } else {
-                rules.push(r);
+                rules.push(ritem);
             }
         }
         if (rules.length == 1) {
             let rule = cal.wrapInstance(rules[0], Components.interfaces.calIRecurrenceRule);
             if (rule) {
                 switch (rule.type) {
                     case "DAILY":
                         if (!checkRecurrenceRule(rule, ["BYSECOND",
@@ -2006,31 +2006,31 @@ function attachFileByAccountKey(aAccount
 function attachFile(cloudProvider) {
     if (!cloudProvider) {
         cal.ERROR("[calendar-event-dialog] Could not attach file without cloud provider" + cal.STACK(10));
     }
 
     let files;
     try {
         const nsIFilePicker = Components.interfaces.nsIFilePicker;
-        let fp = Components.classes["@mozilla.org/filepicker;1"]
-                           .createInstance(nsIFilePicker);
-        fp.init(window,
-                calGetString("calendar-event-dialog", "selectAFile"),
-                nsIFilePicker.modeOpenMultiple);
+        let filePicker = Components.classes["@mozilla.org/filepicker;1"]
+                                   .createInstance(nsIFilePicker);
+        filePicker.init(window,
+                        calGetString("calendar-event-dialog", "selectAFile"),
+                        nsIFilePicker.modeOpenMultiple);
 
         // Check for the last directory
         let lastDir = lastDirectory();
         if (lastDir) {
-            fp.displayDirectory = lastDir;
+            filePicker.displayDirectory = lastDir;
         }
 
         // Get the attachment
-        if (fp.show() == nsIFilePicker.returnOK) {
-            files = fp.files;
+        if (filePicker.show() == nsIFilePicker.returnOK) {
+            files = filePicker.files;
         }
     } catch (ex) {
         dump("failed to get attachments: " +ex+ "\n");
     }
 
     // Check if something has to be done
     if (!files || !files.hasMoreElements()) {
         return;
@@ -2252,25 +2252,25 @@ function deleteAttachment() {
 }
 
 /**
  * Removes all attachments from the dialog controls.
  */
 function deleteAllAttachments() {
     let documentLink = document.getElementById("attachment-link");
     let itemCount = documentLink.getRowCount();
-    let ok = (itemCount < 2);
+    let canRemove = (itemCount < 2);
 
     if (itemCount > 1) {
         let removeText = PluralForm.get(itemCount, cal.calGetString("calendar-event-dialog", "removeAttachmentsText"));
         let removeTitle = cal.calGetString("calendar-event-dialog", "removeCalendarsTitle");
-        ok = Services.prompt.confirm(window, removeTitle, removeText.replace("#1", itemCount), {});
+        canRemove = Services.prompt.confirm(window, removeTitle, removeText.replace("#1", itemCount), {});
     }
 
-    if (ok) {
+    if (canRemove) {
         let child;
         while (documentLink.hasChildNodes()) {
             child = documentLink.lastChild;
             child.attachment = null;
             child.remove();
         }
         gAttachMap = {};
     }
@@ -3187,20 +3187,20 @@ function showTimezonePopup(event, dateTi
     timezoneDefaultItem.label = defaultTimezone.displayName;
 
     // Clear out any old recent timezones
     while (timezoneDefaultItem.nextSibling != timezoneSeparator) {
         timezoneDefaultItem.nextSibling.remove();
     }
 
     // Fill in the new recent timezones
-    for (let tz of recentTimezones) {
+    for (let timezone of recentTimezones) {
         let menuItem = createXULElement("menuitem");
-        menuItem.setAttribute("value", tz.tzid);
-        menuItem.setAttribute("label", tz.displayName);
+        menuItem.setAttribute("value", timezone.tzid);
+        menuItem.setAttribute("label", timezone.displayName);
         timezonePopup.insertBefore(menuItem, timezoneDefaultItem.nextSibling);
     }
 
     // Show the popup
     timezonePopup.openPopup(event.target, "after_start", 0, 0, true);
 }
 
 /**
@@ -3538,34 +3538,34 @@ function updateAttendees() {
 
         if (window.organizer && window.organizer.id) {
             document.getElementById("item-organizer-row").removeAttribute("collapsed");
             let cell = document.querySelector(".item-organizer-cell");
             let icon = cell.querySelector("img:nth-of-type(1)");
             let text = cell.querySelector("label:nth-of-type(1)");
 
             let role = organizer.role || "REQ-PARTICIPANT";
-            let ut = organizer.userType || "INDIVIDUAL";
-            let ps = organizer.participationStatus || "NEEDS-ACTION";
+            let userType = organizer.userType || "INDIVIDUAL";
+            let partStat = organizer.participationStatus || "NEEDS-ACTION";
 
             let orgName = (organizer.commonName && organizer.commonName.length)
                           ? organizer.commonName : organizer.toString();
-            let utString = cal.calGetString("calendar", "dialog.tooltip.attendeeUserType2." + ut,
+            let userTypeString = cal.calGetString("calendar", "dialog.tooltip.attendeeUserType2." + userType,
                                             [organizer.toString()]);
             let roleString = cal.calGetString("calendar", "dialog.tooltip.attendeeRole2." + role,
-                                              [utString]);
-            let psString = cal.calGetString("calendar", "dialog.tooltip.attendeePartStat2." + ps,
+                                              [userTypeString]);
+            let partStatString = cal.calGetString("calendar", "dialog.tooltip.attendeePartStat2." + partStat,
                                             [orgName]);
-            let tt = cal.calGetString("calendar", "dialog.tooltip.attendee.combined",
-                                      [roleString, psString]);
+            let tooltip = cal.calGetString("calendar", "dialog.tooltip.attendee.combined",
+                                           [roleString, partStatString]);
 
             text.setAttribute("value", orgName);
-            cell.setAttribute("tooltiptext", tt);
-            icon.setAttribute("partstat", ps);
-            icon.setAttribute("usertype", ut);
+            cell.setAttribute("tooltiptext", tooltip);
+            icon.setAttribute("partstat", partStat);
+            icon.setAttribute("usertype", userType);
             icon.setAttribute("role", role);
         } else {
             setBooleanAttribute("item-organizer-row", "collapsed", true);
         }
         setupAttendees();
     } else {
         attendeeTab.setAttribute("collapsed", "true");
         attendeePanel.setAttribute("collapsed", "true");
--- a/calendar/lightning/modules/ltnInvitationUtils.jsm
+++ b/calendar/lightning/modules/ltnInvitationUtils.jsm
@@ -219,32 +219,32 @@ ltn.invitation = {
             let del = cal.resolveDelegation(aAttendee, attendees);
             if (del.delegators != "") {
                 del.delegators = " " + ltn.getString("lightning", "imipHtml.attendeeDelegatedFrom",
                                                      [del.delegators]);
             }
 
             // display itip icon
             let role = aAttendee.role || "REQ-PARTICIPANT";
-            let ps = aAttendee.participationStatus || "NEEDS-ACTION";
-            let ut = aAttendee.userType || "INDIVIDUAL";
+            let partstat = aAttendee.participationStatus || "NEEDS-ACTION";
+            let userType = aAttendee.userType || "INDIVIDUAL";
             let itipIcon = row.getElementsByClassName("itip-icon")[0];
             itipIcon.setAttribute("role", role);
-            itipIcon.setAttribute("usertype", ut);
-            itipIcon.setAttribute("partstat", ps);
+            itipIcon.setAttribute("usertype", userType);
+            itipIcon.setAttribute("partstat", partstat);
             let attName = aAttendee.commonName && aAttendee.commonName.length
                           ? aAttendee.commonName : aAttendee.toString();
-            let utString = ltn.getString("lightning", "imipHtml.attendeeUserType2." + ut,
-                                         [aAttendee.toString()]);
+            let userTypeString = ltn.getString("lightning", "imipHtml.attendeeUserType2." + userType,
+                                               [aAttendee.toString()]);
             let roleString = ltn.getString("lightning", "imipHtml.attendeeRole2." + role,
-                                           [utString]);
-            let psString = ltn.getString("lightning", "imipHtml.attendeePartStat2." + ps,
-                                         [attName, del.delegatees]);
+                                           [userTypeString]);
+            let partstatString = ltn.getString("lightning", "imipHtml.attendeePartStat2." + partstat,
+                                               [attName, del.delegatees]);
             let itipTooltip = ltn.getString("lightning", "imipHtml.attendee.combined",
-                                            [roleString, psString]);
+                                            [roleString, partstatString]);
             row.setAttribute("title", itipTooltip);
             // display attendee
             row.getElementsByClassName("attendee-name")[0].textContent = aAttendee.toString() +
                                                                          del.delegators;
             return row;
         };
 
         // Fill rows for attendees and organizer
@@ -446,18 +446,18 @@ ltn.invitation = {
      */
     getRfc5322FormattedDate: function(aDate = null) {
         let date = aDate || new Date();
         let str = date.toString()
                       .replace(/^(\w{3}) (\w{3}) (\d{2}) (\d{4}) ([0-9:]{8}) GMT([+-])(\d{4}).*$/,
                                "$1, $3 $2 $4 $5 $6$7");
         // according to section 3.3 of RfC5322, +0000 should be used for defined timezones using
         // UTC time, while -0000 should indicate a floating time instead
-        let tz = cal.calendarDefaultTimezone();
-        if (tz && tz.isFloating) {
+        let timezone = cal.calendarDefaultTimezone();
+        if (timezone && timezone.isFloating) {
             str.replace(/\+0000$/, "-0000");
         }
         return str;
     },
 
     /**
      * Converts a given unicode text to utf-8 and normalizes line-breaks to \r\n
      * @param  {String} aText   a unicode encoded string
--- a/calendar/providers/caldav/calDavCalendar.js
+++ b/calendar/providers/caldav/calDavCalendar.js
@@ -28,23 +28,25 @@ var davNS = "DAV:";
 var caldavNS = "urn:ietf:params:xml:ns:caldav";
 var calservNS = "http://calendarserver.org/ns/";
 var MIME_TEXT_CALENDAR = "text/calendar; charset=utf-8";
 var MIME_TEXT_XML = "text/xml; charset=utf-8";
 
 var cIOL = Components.interfaces.calIOperationListener;
 
 function caldavNSResolver(prefix) {
-    const ns = {
+    /* eslint-disable id-length */
+    const namespaces = {
         D: davNS,
         C: caldavNS,
         CS: calservNS
     };
+    /* eslint-enable id-length */
 
-    return ns[prefix] || null;
+    return namespaces[prefix] || null;
 }
 
 function caldavXPath(aNode, aExpr, aType) {
     return cal.xml.evalXPath(aNode, aExpr, caldavNSResolver, aType);
 }
 function caldavXPathFirst(aNode, aExpr, aType) {
     return cal.xml.evalXPathFirst(aNode, aExpr, caldavNSResolver, aType);
 }
--- a/calendar/providers/caldav/calDavRequestHandlers.js
+++ b/calendar/providers/caldav/calDavRequestHandlers.js
@@ -217,42 +217,42 @@ etagsHandler.prototype = {
             this.logXML += "<" + aQName + ">";
         }
     },
 
     endElement: function(aUri, aLocalName, aQName) {
         switch (aLocalName) {
             case "response":
                 this.tag = null;
-                let r = this.currentResponse;
-                if (r.getetag && r.getetag.length &&
-                    r.href && r.href.length &&
-                    r.getcontenttype && r.getcontenttype.length &&
-                    !r.isCollection) {
-                    r.href = this.calendar.ensureDecodedPath(r.href);
+                let resp = this.currentResponse;
+                if (resp.getetag && resp.getetag.length &&
+                    resp.href && resp.href.length &&
+                    resp.getcontenttype && resp.getcontenttype.length &&
+                    !resp.isCollection) {
+                    resp.href = this.calendar.ensureDecodedPath(resp.href);
 
-                    if (r.getcontenttype.substr(0, 14) == "message/rfc822") {
+                    if (resp.getcontenttype.substr(0, 14) == "message/rfc822") {
                         // workaround for a Scalix bug which causes incorrect
                         // contenttype to be returned.
-                        r.getcontenttype = "text/calendar";
+                        resp.getcontenttype = "text/calendar";
                     }
-                    if (r.getcontenttype == "text/vtodo") {
+                    if (resp.getcontenttype == "text/vtodo") {
                         // workaround Kerio wierdness
-                        r.getcontenttype = "text/calendar";
+                        resp.getcontenttype = "text/calendar";
                     }
 
                     // Only handle calendar items
-                    if (r.getcontenttype.substr(0, 13) == "text/calendar") {
-                        if (r.href && r.href.length) {
-                            this.itemsReported[r.href] = r.getetag;
+                    if (resp.getcontenttype.substr(0, 13) == "text/calendar") {
+                        if (resp.href && resp.href.length) {
+                            this.itemsReported[resp.href] = resp.getetag;
 
-                            let itemUid = this.calendar.mHrefIndex[r.href];
+                            let itemUid = this.calendar.mHrefIndex[resp.href];
                             if (!itemUid ||
-                                r.getetag != this.calendar.mItemInfoCache[itemUid].etag) {
-                                this.itemsNeedFetching.push(r.href);
+                                resp.getetag != this.calendar.mItemInfoCache[itemUid].etag) {
+                                this.itemsNeedFetching.push(resp.href);
                             }
                         }
                     }
                 }
                 break;
             case "href":
             case "getetag":
             case "getcontenttype":
@@ -528,93 +528,93 @@ webDavSyncHandler.prototype = {
             this.logXML += "<" + aQName + ">";
         }
     },
 
     endElement: function(aUri, aLocalName, aQName) {
         switch (aLocalName) {
             case "response": // WebDAV Sync draft 3
             case "sync-response": // WebDAV Sync draft 0,1,2
-                let r = this.currentResponse;
-                if (r.href && r.href.length) {
-                    r.href = this.calendar.ensureDecodedPath(r.href);
+                let resp = this.currentResponse;
+                if (resp.href && resp.href.length) {
+                    resp.href = this.calendar.ensureDecodedPath(resp.href);
                 }
 
-                if ((!r.getcontenttype || r.getcontenttype == "text/plain") &&
-                    r.href &&
-                    r.href.endsWith(".ics")) {
+                if ((!resp.getcontenttype || resp.getcontenttype == "text/plain") &&
+                    resp.href &&
+                    resp.href.endsWith(".ics")) {
                   // If there is no content-type (iCloud) or text/plain was passed
                   // (iCal Server) for the resource but its name ends with ".ics"
                   // assume the content type to be text/calendar. Apple
                   // iCloud/iCal Server interoperability fix.
-                  r.getcontenttype = "text/calendar";
+                  resp.getcontenttype = "text/calendar";
                 }
 
                 // Deleted item
-                if (r.href && r.href.length &&
-                    r.status &&
-                    r.status.length &&
-                    r.status.indexOf(" 404") > 0) {
-                    if (this.calendar.mHrefIndex[r.href]) {
+                if (resp.href && resp.href.length &&
+                    resp.status &&
+                    resp.status.length &&
+                    resp.status.indexOf(" 404") > 0) {
+                    if (this.calendar.mHrefIndex[resp.href]) {
                         this.changeCount++;
-                        this.calendar.deleteTargetCalendarItem(r.href);
+                        this.calendar.deleteTargetCalendarItem(resp.href);
                     } else {
-                        cal.LOG("CalDAV: skipping unfound deleted item : " + r.href);
+                        cal.LOG("CalDAV: skipping unfound deleted item : " + resp.href);
                     }
                 // Only handle Created or Updated calendar items
-                } else if (r.getcontenttype &&
-                           r.getcontenttype.substr(0, 13) == "text/calendar" &&
-                           r.getetag && r.getetag.length &&
-                           r.href && r.href.length &&
-                           (!r.status ||                 // Draft 3 does not require
-                            r.status.length == 0 ||      // a status for created or updated items but
-                            r.status.indexOf(" 204") ||  // draft 0, 1 and 2 needed it so treat no status
-                            r.status.indexOf(" 200") ||  // Apple iCloud returns 200 status for each item
-                            r.status.indexOf(" 201"))) { // and status 201 and 204 the same
-                    this.itemsReported[r.href] = r.getetag;
-                    let itemId = this.calendar.mHrefIndex[r.href];
+                } else if (resp.getcontenttype &&
+                           resp.getcontenttype.substr(0, 13) == "text/calendar" &&
+                           resp.getetag && resp.getetag.length &&
+                           resp.href && resp.href.length &&
+                           (!resp.status ||                 // Draft 3 does not require
+                            resp.status.length == 0 ||      // a status for created or updated items but
+                            resp.status.indexOf(" 204") ||  // draft 0, 1 and 2 needed it so treat no status
+                            resp.status.indexOf(" 200") ||  // Apple iCloud returns 200 status for each item
+                            resp.status.indexOf(" 201"))) { // and status 201 and 204 the same
+                    this.itemsReported[resp.href] = resp.getetag;
+                    let itemId = this.calendar.mHrefIndex[resp.href];
                     let oldEtag = itemId && this.calendar.mItemInfoCache[itemId].etag;
 
-                    if (!oldEtag || oldEtag != r.getetag) {
+                    if (!oldEtag || oldEtag != resp.getetag) {
                         // Etag mismatch, getting new/updated item.
-                        this.itemsNeedFetching.push(r.href);
+                        this.itemsNeedFetching.push(resp.href);
                     }
-                } else if (r.status &&
-                           r.status.includes(" 507")) {
+                } else if (resp.status &&
+                           resp.status.includes(" 507")) {
                     // webdav-sync says that if a 507 is encountered and the
                     // url matches the request, the current token should be
                     // saved and another request should be made. We don't
                     // actually compare the URL, its too easy to get this
                     // wrong.
 
                     // The 507 doesn't mean the data received is invalid, so
                     // continue processing.
                     this.additionalSyncNeeded = true;
-                } else if (r.status &&
-                           r.status.indexOf(" 200") &&
-                           r.href &&
-                           r.href.endsWith("/")) {
+                } else if (resp.status &&
+                           resp.status.indexOf(" 200") &&
+                           resp.href &&
+                           resp.href.endsWith("/")) {
                     // iCloud returns status responses for directories too
                     // so we just ignore them if they have status code 200. We
                     // want to make sure these are not counted as unhandled
                     // errors in the next block
-                } else if ((r.getcontenttype &&
-                            r.getcontenttype.startsWith("text/calendar")) ||
-                           (r.status &&
-                            !r.status.includes(" 404"))) {
+                } else if ((resp.getcontenttype &&
+                            resp.getcontenttype.startsWith("text/calendar")) ||
+                           (resp.status &&
+                            !resp.status.includes(" 404"))) {
                     // If the response element is still not handled, log an
                     // error only if the content-type is text/calendar or the
                     // response status is different than 404 not found.  We
                     // don't care about response elements on non-calendar
                     // resources or whose status is not indicating a deleted
                     // resource.
-                    cal.WARN("CalDAV: Unexpected response, status: " + r.status + ", href: " + r.href);
+                    cal.WARN("CalDAV: Unexpected response, status: " + resp.status + ", href: " + resp.href);
                     this.unhandledErrors++;
                 } else {
-                    cal.LOG("CalDAV: Unhandled response element, status: " + r.status + ", href: " + r.href + " contenttype:" + r.getcontenttype);
+                    cal.LOG("CalDAV: Unhandled response element, status: " + resp.status + ", href: " + resp.href + " contenttype:" + resp.getcontenttype);
                 }
                 break;
             case "sync-token":
                 this.newSyncToken = this.currentResponse[this.tag];
                 break;
             case "propstat":
                 this.isInPropStat = false;
                 break;
@@ -881,55 +881,55 @@ multigetSyncHandler.prototype = {
         if (this.calendar.verboseLogging()) {
             this.logXML += "<" + aQName + ">";
         }
     },
 
     endElement: function(aUri, aLocalName, aQName) {
         switch (aLocalName) {
             case "response":
-                let r = this.currentResponse;
-                if (r.href &&
-                    r.href.length) {
-                    r.href = this.calendar.ensureDecodedPath(r.href);
+                let resp = this.currentResponse;
+                if (resp.href &&
+                    resp.href.length) {
+                    resp.href = this.calendar.ensureDecodedPath(resp.href);
                 }
-                if (r.href && r.href.length &&
-                    r.status &&
-                    r.status.length &&
-                    r.status.indexOf(" 404") > 0) {
-                    if (this.calendar.mHrefIndex[r.href]) {
+                if (resp.href && resp.href.length &&
+                    resp.status &&
+                    resp.status.length &&
+                    resp.status.indexOf(" 404") > 0) {
+                    if (this.calendar.mHrefIndex[resp.href]) {
                         this.changeCount++;
-                        this.calendar.deleteTargetCalendarItem(r.href);
+                        this.calendar.deleteTargetCalendarItem(resp.href);
                     } else {
-                        cal.LOG("CalDAV: skipping unfound deleted item : " + r.href);
+                        cal.LOG("CalDAV: skipping unfound deleted item : " + resp.href);
                     }
                 // Created or Updated item
-                } else if (r.getetag && r.getetag.length &&
-                           r.href && r.href.length &&
-                           r.calendardata && r.calendardata.length) {
+                } else if (resp.getetag && resp.getetag.length &&
+                           resp.href && resp.href.length &&
+                           resp.calendardata && resp.calendardata.length) {
                     let oldEtag;
-                    let itemId = this.calendar.mHrefIndex[r.href];
+                    let itemId = this.calendar.mHrefIndex[resp.href];
                     if (itemId) {
                         oldEtag = this.calendar.mItemInfoCache[itemId].etag;
                     } else {
                         oldEtag = null;
                     }
-                    if (!oldEtag || oldEtag != r.getetag) {
+                    if (!oldEtag || oldEtag != resp.getetag) {
                         this.changeCount++;
-                        this.calendar.addTargetCalendarItem(r.href,
-                                                            r.calendardata,
+                        this.calendar.addTargetCalendarItem(resp.href,
+                                                            resp.calendardata,
                                                             this.baseUri,
-                                                            r.getetag,
+                                                            resp.getetag,
                                                             this.listener);
                     } else {
                         cal.LOG("CalDAV: skipping item with unmodified etag : " + oldEtag);
                     }
                 } else {
                     cal.WARN("CalDAV: Unexpected response, status: " +
-                             r.status + ", href: " + r.href + " calendar-data:\n" + r.calendardata);
+                             resp.status + ", href: " + resp.href + " calendar-data:\n" + resp.calendardata);
                     this.unhandledErrors++;
                 }
                 break;
             case "propstat":
                 this.isInPropStat = false;
                 break;
         }
         this.tag = null;
--- a/calendar/providers/composite/calCompositeCalendar.js
+++ b/calendar/providers/composite/calCompositeCalendar.js
@@ -133,22 +133,22 @@ calCompositeCalendar.prototype = {
             }
         }
         this.mPrefPrefix = aPrefPrefix;
         this.mActivePref = aPrefPrefix + "-in-composite";
         this.mDefaultPref = aPrefPrefix + "-default";
         let mgr = cal.getCalendarManager();
         let cals = mgr.getCalendars({});
 
-        cals.forEach(function(c) {
-            if (c.getProperty(this.mActivePref)) {
-                this.addCalendar(c);
+        cals.forEach(function(calendar) {
+            if (calendar.getProperty(this.mActivePref)) {
+                this.addCalendar(calendar);
             }
-            if (c.getProperty(this.mDefaultPref)) {
-                this.setDefaultCalendar(c, false);
+            if (calendar.getProperty(this.mDefaultPref)) {
+                this.setDefaultCalendar(calendar, false);
             }
         }, this);
     },
 
     get prefPrefix() {
         return this.mPrefPrefix;
     },
 
@@ -220,18 +220,18 @@ calCompositeCalendar.prototype = {
             if (calendar) {
                 calendar.setProperty(this.mDefaultPref, true);
             }
         }
         this.mDefaultCalendar = calendar;
         this.mCompositeObservers.notify("onDefaultCalendarChanged", [calendar]);
     },
 
-    set defaultCalendar(v) {
-        this.setDefaultCalendar(v, true);
+    set defaultCalendar(calendar) {
+        this.setDefaultCalendar(calendar, true);
     },
 
     //
     // calICalendar interface
     //
     // Write operations here are forwarded to either the item's
     // parent calendar, or to the default calendar if one is set.
     // Get operations are sent to each calendar.
@@ -253,17 +253,17 @@ calCompositeCalendar.prototype = {
     },
 
     // this could, at some point, return some kind of URI identifying
     // all the child calendars, thus letting us create nifty calendar
     // trees.
     get uri() {
         throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
     },
-    set uri(v) {
+    set uri(val) {
         throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
     },
 
     get readOnly() {
         throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
     },
     set readOnly(bool) {
         throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
@@ -271,17 +271,17 @@ calCompositeCalendar.prototype = {
 
     get canRefresh() {
         return true;
     },
 
     get name() {
         throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
     },
-    set name(v) {
+    set name(val) {
         throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
     },
 
     get type() {
         return "composite";
     },
 
     getProperty: function(aName) {
--- a/calendar/providers/ics/calICSCalendar.js
+++ b/calendar/providers/ics/calICSCalendar.js
@@ -14,22 +14,22 @@ Components.utils.import("resource://cale
 // calICSCalendar.js
 //
 // This is a non-sync ics file. It reads the file pointer to by uri when set,
 // then writes it on updates. External changes to the file will be
 // ignored and overwritten.
 //
 // XXX Should do locks, so that external changes are not overwritten.
 
-var CI = Components.interfaces;
+var Ci = Components.interfaces;
 var calICalendar = Components.interfaces.calICalendar;
 var calIErrors = Components.interfaces.calIErrors;
 
 function icsNSResolver(prefix) {
-    const ns = { D: "DAV:" };
+    const ns = { D: "DAV:" }; // eslint-disable-line id-length
     return ns[prefix] || null;
 }
 
 function icsXPathFirst(aNode, aExpr, aType) {
     return cal.xml.evalXPathFirst(aNode, aExpr, icsNSResolver, aType);
 }
 
 function calICSCalendar() {
@@ -647,34 +647,34 @@ calICSCalendar.prototype = {
         // but we don't use that file. All we want is a filename, to be used
         // in the call to copyTo later. So we create a file, get the filename,
         // and never use the file again, but write over it.
         // Using createUnique anyway, because I don't feel like
         // re-implementing it
         function makeDailyFileName() {
             let dailyBackupFile = backupDir.clone();
             dailyBackupFile.append(makeName("day"));
-            dailyBackupFile.createUnique(CI.nsIFile.NORMAL_FILE_TYPE,
+            dailyBackupFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE,
                                          parseInt("0600", 8));
             dailyBackupFileName = dailyBackupFile.leafName;
 
             // Remove the reference to the nsIFile, because we need to
             // write over the file later, and you never know what happens
             // if something still has a reference.
             // Also makes it explicit that we don't need the file itself,
             // just the name.
             dailyBackupFile = null;
 
             return dailyBackupFileName;
         }
 
         function purgeBackupsByType(files, type) {
             // filter out backups of the type we care about.
             let filteredFiles = files.filter(
-                v => v.name.includes("calBackupData_" + pseudoID + "_" + type)
+                file => file.name.includes("calBackupData_" + pseudoID + "_" + type)
             );
             // Sort by lastmodifed
             filteredFiles.sort((a, b) => a.lastmodified - b.lastmodified);
             // And delete the oldest files, and keep the desired number of
             // old backups
             for (let i = 0; i < filteredFiles.length - numBackupFiles; ++i) {
                 let file = backupDir.clone();
                 file.append(filteredFiles[i].name);
@@ -690,17 +690,17 @@ calICSCalendar.prototype = {
             return;
         }
 
         function purgeOldBackups() {
             // Enumerate files in the backupdir for expiry of old backups
             let dirEnum = backupDir.directoryEntries;
             let files = [];
             while (dirEnum.hasMoreElements()) {
-                let file = dirEnum.getNext().QueryInterface(CI.nsIFile);
+                let file = dirEnum.getNext().QueryInterface(Ci.nsIFile);
                 if (file.isFile()) {
                     files.push({ name: file.leafName, lastmodified: file.lastModifiedTime });
                 }
             }
 
             if (doDailyBackup) {
                 purgeBackupsByType(files, "day");
             } else {
@@ -729,17 +729,17 @@ calICSCalendar.prototype = {
         let backupDays = Preferences.get("calendar.backup.days", 1);
         let numBackupFiles = Preferences.get("calendar.backup.filenum", 3);
 
         let backupDir;
         try {
             backupDir = cal.getCalendarDirectory();
             backupDir.append("backup");
             if (!backupDir.exists()) {
-                backupDir.create(CI.nsIFile.DIRECTORY_TYPE, parseInt("0755", 8));
+                backupDir.create(Ci.nsIFile.DIRECTORY_TYPE, parseInt("0755", 8));
             }
         } catch (e) {
             // Backup dir wasn't found. Likely because we are running in
             // xpcshell. Don't die, but continue the upload.
             cal.ERROR("[calICSCalendar] Backup failed, no backupdir:" + e);
             aCallback.call(this);
             return;
         }
@@ -777,32 +777,32 @@ calICSCalendar.prototype = {
 
         let dailyBackupFileName;
         if (doDailyBackup) {
             dailyBackupFileName = makeDailyFileName(backupDir);
         }
 
         let backupFile = backupDir.clone();
         backupFile.append(makeName("edit"));
-        backupFile.createUnique(CI.nsIFile.NORMAL_FILE_TYPE, parseInt("0600", 8));
+        backupFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, parseInt("0600", 8));
 
         purgeOldBackups();
 
         // Now go download the remote file, and store it somewhere local.
         let channel = Services.io.newChannelFromURI2(this.mUri,
                                                      null,
                                                      Services.scriptSecurityManager.getSystemPrincipal(),
                                                      null,
                                                      Components.interfaces.nsILoadInfo.SEC_NORMAL,
                                                      Components.interfaces.nsIContentPolicy.TYPE_OTHER);
         channel.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE;
         channel.notificationCallbacks = this;
 
         let downloader = Components.classes["@mozilla.org/network/downloader;1"]
-                                   .createInstance(CI.nsIDownloader);
+                                   .createInstance(Ci.nsIDownloader);
 
         let self = this;
         let listener = {
             onDownloadComplete: function(opdownloader, request, ctxt, status, result) {
                 if (doInitialBackup) {
                     copyToOverwriting(result, backupDir, makeName("initial"));
                 }
                 if (doDailyBackup) {
--- a/calendar/providers/storage/calStorageCalendar.js
+++ b/calendar/providers/storage/calStorageCalendar.js
@@ -802,36 +802,36 @@ calStorageCalendar.prototype = {
                 return true;
             }
 
             return false;
         }
 
         // First fetch all the events
         if (wantEvents) {
-            let sp;             // stmt params
+            let params;             // stmt params
             let resultItems = [];
 
             // first get non-recurring events that happen to fall within the range
             //
             try {
                 this.prepareStatement(this.mSelectNonRecurringEventsByRange);
-                sp = this.mSelectNonRecurringEventsByRange.params;
-                sp.range_start = startTime;
-                sp.range_end = endTime;
-                sp.start_offset = aRangeStart ? aRangeStart.timezoneOffset * USECS_PER_SECOND : 0;
-                sp.end_offset = aRangeEnd ? aRangeEnd.timezoneOffset * USECS_PER_SECOND : 0;
-                sp.offline_journal = null;
+                params = this.mSelectNonRecurringEventsByRange.params;
+                params.range_start = startTime;
+                params.range_end = endTime;
+                params.start_offset = aRangeStart ? aRangeStart.timezoneOffset * USECS_PER_SECOND : 0;
+                params.end_offset = aRangeEnd ? aRangeEnd.timezoneOffset * USECS_PER_SECOND : 0;
+                params.offline_journal = null;
 
                 if (wantOfflineDeletedItems) {
-                    sp.offline_journal = cICL.OFFLINE_FLAG_DELETED_RECORD;
+                    params.offline_journal = cICL.OFFLINE_FLAG_DELETED_RECORD;
                 } else if (wantOfflineCreatedItems) {
-                    sp.offline_journal = cICL.OFFLINE_FLAG_CREATED_RECORD;
+                    params.offline_journal = cICL.OFFLINE_FLAG_CREATED_RECORD;
                 } else if (wantOfflineModifiedItems) {
-                    sp.offline_journal = cICL.OFFLINE_FLAG_MODIFIED_RECORD;
+                    params.offline_journal = cICL.OFFLINE_FLAG_MODIFIED_RECORD;
                 }
 
                 while (this.mSelectNonRecurringEventsByRange.executeStep()) {
                     let row = this.mSelectNonRecurringEventsByRange.row;
                     resultItems.push(this.getEventFromRow(row, {}));
                 }
             } catch (e) {
                 this.logError("Error selecting non recurring events by range!\n", e);
@@ -846,50 +846,50 @@ calStorageCalendar.prototype = {
                     return;
                 }
             }
 
             // Process the recurring events from the cache
             for (let id in this.mRecEventCache) {
                 let evitem = this.mRecEventCache[id];
                 let offline_journal_flag = this.mRecEventCacheOfflineFlags[evitem.id] || null;
-                // No need to return flagged unless asked i.e. sp.offline_journal == offline_journal_flag
-                // Return created and modified offline records if sp.offline_journal is null alongwith events that have no flag
-                if ((sp.offline_journal == null && offline_journal_flag != cICL.OFFLINE_FLAG_DELETED_RECORD) ||
-                    (sp.offline_journal != null && offline_journal_flag == sp.offline_journal)) {
+                // No need to return flagged unless asked i.e. params.offline_journal == offline_journal_flag
+                // Return created and modified offline records if params.offline_journal is null alongwith events that have no flag
+                if ((params.offline_journal == null && offline_journal_flag != cICL.OFFLINE_FLAG_DELETED_RECORD) ||
+                    (params.offline_journal != null && offline_journal_flag == params.offline_journal)) {
                     count += handleResultItem(evitem, Components.interfaces.calIEvent);
                     if (checkCount()) {
                         return;
                     }
                 }
             }
         }
 
         // if todos are wanted, do them next
         if (wantTodos) {
-            let sp;             // stmt params
+            let params;             // stmt params
             let resultItems = [];
 
             // first get non-recurring todos that happen to fall within the range
             try {
                 this.prepareStatement(this.mSelectNonRecurringTodosByRange);
-                sp = this.mSelectNonRecurringTodosByRange.params;
-                sp.range_start = startTime;
-                sp.range_end = endTime;
-                sp.start_offset = aRangeStart ? aRangeStart.timezoneOffset * USECS_PER_SECOND : 0;
-                sp.end_offset = aRangeEnd ? aRangeEnd.timezoneOffset * USECS_PER_SECOND : 0;
-                sp.offline_journal = null;
+                params = this.mSelectNonRecurringTodosByRange.params;
+                params.range_start = startTime;
+                params.range_end = endTime;
+                params.start_offset = aRangeStart ? aRangeStart.timezoneOffset * USECS_PER_SECOND : 0;
+                params.end_offset = aRangeEnd ? aRangeEnd.timezoneOffset * USECS_PER_SECOND : 0;
+                params.offline_journal = null;
                 if (wantOfflineCreatedItems) {
-                    sp.offline_journal = cICL.OFFLINE_FLAG_CREATED_RECORD;
+                    params.offline_journal = cICL.OFFLINE_FLAG_CREATED_RECORD;
                 }
                 if (wantOfflineDeletedItems) {
-                    sp.offline_journal = cICL.OFFLINE_FLAG_DELETED_RECORD;
+                    params.offline_journal = cICL.OFFLINE_FLAG_DELETED_RECORD;
                 }
                 if (wantOfflineModifiedItems) {
-                    sp.offline_journal = cICL.OFFLINE_FLAG_MODIFIED_RECORD;
+                    params.offline_journal = cICL.OFFLINE_FLAG_MODIFIED_RECORD;
                 }
 
                 while (this.mSelectNonRecurringTodosByRange.executeStep()) {
                     let row = this.mSelectNonRecurringTodosByRange.row;
                     resultItems.push(this.getTodoFromRow(row, {}));
                 }
             } catch (e) {
                 this.logError("Error selecting non recurring todos by range", e);
@@ -908,22 +908,22 @@ calStorageCalendar.prototype = {
             // Note: Reading the code, completed *occurrences* seems to be broken, because
             //       only the parent item has been filtered; I fixed that.
             //       Moreover item.todo_complete etc seems to be a leftover...
 
             // process the recurring todos from the cache
             for (let id in this.mRecTodoCache) {
                 let todoitem = this.mRecTodoCache[id];
                 let offline_journal_flag = this.mRecTodoCacheOfflineFlags[todoitem.id] || null;
-                if ((sp.offline_journal == null &&
+                if ((params.offline_journal == null &&
                      (offline_journal_flag == cICL.OFFLINE_FLAG_MODIFIED_RECORD ||
                       offline_journal_flag == cICL.OFFLINE_FLAG_CREATED_RECORD ||
                       offline_journal_flag == null)) ||
-                    (sp.offline_journal != null &&
-                     (offline_journal_flag == sp.offline_journal))) {
+                    (params.offline_journal != null &&
+                     (offline_journal_flag == params.offline_journal))) {
                     count += handleResultItem(todoitem,
                                               Components.interfaces.calITodo,
                                               checkCompleted);
                     if (checkCount()) {
                         return;
                     }
                 }
             }
@@ -1948,22 +1948,22 @@ calStorageCalendar.prototype = {
 
     //
     // database writing functions
     //
 
     setDateParamHelper: function(params, entryname, cdt) {
         if (cdt) {
             params[entryname] = cdt.nativeTime;
-            let tz = cdt.timezone;
-            let ownTz = cal.getTimezoneService().getTimezone(tz.tzid);
+            let timezone = cdt.timezone;
+            let ownTz = cal.getTimezoneService().getTimezone(timezone.tzid);
             if (ownTz) { // if we know that TZID, we use it
                 params[entryname + "_tz"] = ownTz.tzid;
-            } else if (tz.icalComponent) { // foreign one
-                params[entryname + "_tz"] = tz.icalComponent.serializeToICS();
+            } else if (timezone.icalComponent) { // foreign one
+                params[entryname + "_tz"] = timezone.icalComponent.serializeToICS();
             } else { // timezone component missing
                 params[entryname + "_tz"] = "floating";
             }
         } else {
             params[entryname] = null;
             params[entryname + "_tz"] = null;
         }
     },
@@ -2008,142 +2008,142 @@ calStorageCalendar.prototype = {
         } else {
             throw Components.results.NS_ERROR_UNEXPECTED;
         }
     },
 
     writeEvent: function(item, olditem, flags) {
         try {
             this.prepareStatement(this.mInsertEvent);
-            let ip = this.mInsertEvent.params;
-            this.setupItemBaseParams(item, olditem, ip);
+            let params = this.mInsertEvent.params;
+            this.setupItemBaseParams(item, olditem, params);
 
-            this.setDateParamHelper(ip, "event_start", item.startDate);
-            this.setDateParamHelper(ip, "event_end", item.endDate);
+            this.setDateParamHelper(params, "event_start", item.startDate);
+            this.setDateParamHelper(params, "event_end", item.endDate);
             let dtstamp = item.stampTime;
             if (dtstamp) {
-                ip.event_stamp = dtstamp.nativeTime;
+                params.event_stamp = dtstamp.nativeTime;
             }
 
             if (item.startDate.isDate) {
                 flags |= CAL_ITEM_FLAG.EVENT_ALLDAY;
             }
 
-            ip.flags = flags;
+            params.flags = flags;
 
             this.mInsertEvent.executeStep();
         } finally {
             this.mInsertEvent.reset();
         }
     },
 
     writeTodo: function(item, olditem, flags) {
         try {
             this.prepareStatement(this.mInsertTodo);
-            let ip = this.mInsertTodo.params;
+            let params = this.mInsertTodo.params;
 
-            this.setupItemBaseParams(item, olditem, ip);
+            this.setupItemBaseParams(item, olditem, params);
 
-            this.setDateParamHelper(ip, "todo_entry", item.entryDate);
-            this.setDateParamHelper(ip, "todo_due", item.dueDate);
+            this.setDateParamHelper(params, "todo_entry", item.entryDate);
+            this.setDateParamHelper(params, "todo_due", item.dueDate);
             let dtstamp = item.stampTime;
             if (dtstamp) {
-                ip.todo_stamp = dtstamp.nativeTime;
+                params.todo_stamp = dtstamp.nativeTime;
             }
-            this.setDateParamHelper(ip, "todo_completed", item.getProperty("COMPLETED"));
+            this.setDateParamHelper(params, "todo_completed", item.getProperty("COMPLETED"));
 
-            ip.todo_complete = item.getProperty("PERCENT-COMPLETED");
+            params.todo_complete = item.getProperty("PERCENT-COMPLETED");
 
             let someDate = item.entryDate || item.dueDate;
             if (someDate && someDate.isDate) {
                 flags |= CAL_ITEM_FLAG.EVENT_ALLDAY;
             }
 
-            ip.flags = flags;
+            params.flags = flags;
 
             this.mInsertTodo.executeStep();
         } finally {
             this.mInsertTodo.reset();
         }
     },
 
-    setupItemBaseParams: function(item, olditem, ip) {
-        ip.id = item.id;
+    setupItemBaseParams: function(item, olditem, params) {
+        params.id = item.id;
 
         if (item.recurrenceId) {
-            this.setDateParamHelper(ip, "recurrence_id", item.recurrenceId);
+            this.setDateParamHelper(params, "recurrence_id", item.recurrenceId);
         }
 
         let tmp;
 
         if ((tmp = item.getProperty("CREATED"))) {
-            ip.time_created = tmp.nativeTime;
+            params.time_created = tmp.nativeTime;
         }
         if ((tmp = item.getProperty("LAST-MODIFIED"))) {
-            ip.last_modified = tmp.nativeTime;
+            params.last_modified = tmp.nativeTime;
         }
 
-        ip.title = item.getProperty("SUMMARY");
-        ip.priority = item.getProperty("PRIORITY");
-        ip.privacy = item.getProperty("CLASS");
-        ip.ical_status = item.getProperty("STATUS");
+        params.title = item.getProperty("SUMMARY");
+        params.priority = item.getProperty("PRIORITY");
+        params.privacy = item.getProperty("CLASS");
+        params.ical_status = item.getProperty("STATUS");
 
         if (item.alarmLastAck) {
-            ip.alarm_last_ack = item.alarmLastAck.nativeTime;
+            params.alarm_last_ack = item.alarmLastAck.nativeTime;
         }
     },
 
     writeAttendees: function(item, olditem) {
         let attendees = item.getAttendees({});
         if (item.organizer) {
             attendees = attendees.concat([]);
             attendees.push(item.organizer);
         }
         if (attendees.length > 0) {
             for (let att of attendees) {
-                let ap = this.mInsertAttendee.params;
-                ap.item_id = item.id;
+                let params = this.mInsertAttendee.params;
+                params.item_id = item.id;
                 try {
                     this.prepareStatement(this.mInsertAttendee);
-                    this.setDateParamHelper(ap, "recurrence_id", item.recurrenceId);
-                    ap.icalString = att.icalString;
+                    this.setDateParamHelper(params, "recurrence_id", item.recurrenceId);
+                    params.icalString = att.icalString;
                     this.mInsertAttendee.executeStep();
                 } finally {
                     this.mInsertAttendee.reset();
                 }
             }
 
             return CAL_ITEM_FLAG.HAS_ATTENDEES;
         }
 
         return 0;
     },
 
     writeProperty: function(item, propName, propValue) {
         try {
             this.prepareStatement(this.mInsertProperty);
-            let pp = this.mInsertProperty.params;
-            pp.key = propName;
+            let params = this.mInsertProperty.params;
+            params.key = propName;
             let wPropValue = cal.wrapInstance(propValue, Components.interfaces.calIDateTime);
             if (wPropValue) {
-                pp.value = wPropValue.nativeTime;
+                params.value = wPropValue.nativeTime;
             } else {
                 try {
-                    pp.value = propValue;
+                    params.value = propValue;
                 } catch (e) {
                     // The storage service throws an NS_ERROR_ILLEGAL_VALUE in
                     // case pval is something complex (i.e not a string or
                     // number). Swallow this error, leaving the value empty.
                     if (e.result != Components.results.NS_ERROR_ILLEGAL_VALUE) {
                         throw e;
                     }
                 }
             }
-            pp.item_id = item.id;
-            this.setDateParamHelper(pp, "recurrence_id", item.recurrenceId);
+            params.item_id = item.id;
+            this.setDateParamHelper(params, "recurrence_id", item.recurrenceId);
             this.mInsertProperty.executeStep();
         } finally {
             this.mInsertProperty.reset();
         }
     },
 
     writeProperties: function(item, olditem) {
         let ret = 0;
@@ -2169,21 +2169,21 @@ calStorageCalendar.prototype = {
     writeRecurrence: function(item, olditem) {
         let flags = 0;
 
         let rec = item.recurrenceInfo;
         if (rec) {
             flags = CAL_ITEM_FLAG.HAS_RECURRENCE;
             let ritems = rec.getRecurrenceItems({});
             for (let ritem of ritems) {
-                let ap = this.mInsertRecurrence.params;
+                let params = this.mInsertRecurrence.params;
                 try {
                     this.prepareStatement(this.mInsertRecurrence);
-                    ap.item_id = item.id;
-                    ap.icalString = ritem.icalString;
+                    params.item_id = item.id;
+                    params.icalString = ritem.icalString;
                     this.mInsertRecurrence.executeStep();
                 } finally {
                     this.mInsertRecurrence.reset();
                 }
             }
 
             let exceptions = rec.getExceptionIds({});
             if (exceptions.length > 0) {
@@ -2206,43 +2206,43 @@ calStorageCalendar.prototype = {
 
         return flags;
     },
 
     writeAttachments: function(item, olditem) {
         let attachments = item.getAttachments({});
         if (attachments && attachments.length > 0) {
             for (let att of attachments) {
-                let ap = this.mInsertAttachment.params;
+                let params = this.mInsertAttachment.params;
                 try {
                     this.prepareStatement(this.mInsertAttachment);
-                    this.setDateParamHelper(ap, "recurrence_id", item.recurrenceId);
-                    ap.item_id = item.id;
-                    ap.icalString = att.icalString;
+                    this.setDateParamHelper(params, "recurrence_id", item.recurrenceId);
+                    params.item_id = item.id;
+                    params.icalString = att.icalString;
 
                     this.mInsertAttachment.executeStep();
                 } finally {
                     this.mInsertAttachment.reset();
                 }
             }
             return CAL_ITEM_FLAG.HAS_ATTACHMENTS;
         }
         return 0;
     },
 
     writeRelations: function(item, olditem) {
         let relations = item.getRelations({});
         if (relations && relations.length > 0) {
             for (let rel of relations) {
-                let rp = this.mInsertRelation.params;
+                let params = this.mInsertRelation.params;
                 try {
                     this.prepareStatement(this.mInsertRelation);
-                    this.setDateParamHelper(rp, "recurrence_id", item.recurrenceId);
-                    rp.item_id = item.id;
-                    rp.icalString = rel.icalString;
+                    this.setDateParamHelper(params, "recurrence_id", item.recurrenceId);
+                    params.item_id = item.id;
+                    params.icalString = rel.icalString;
 
                     this.mInsertRelation.executeStep();
                 } finally {
                     this.mInsertRelation.reset();
                 }
             }
             return CAL_ITEM_FLAG.HAS_RELATIONS;
         }
@@ -2251,22 +2251,22 @@ calStorageCalendar.prototype = {
 
     writeAlarms: function(item, olditem) {
         let alarms = item.getAlarms({});
         if (alarms.length < 1) {
             return 0;
         }
 
         for (let alarm of alarms) {
-            let pp = this.mInsertAlarm.params;
+            let params = this.mInsertAlarm.params;
             try {
                 this.prepareStatement(this.mInsertAlarm);
-                this.setDateParamHelper(pp, "recurrence_id", item.recurrenceId);
-                pp.item_id = item.id;
-                pp.icalString = alarm.icalString;
+                this.setDateParamHelper(params, "recurrence_id", item.recurrenceId);
+                params.item_id = item.id;
+                params.icalString = alarm.icalString;
                 this.mInsertAlarm.executeStep();
             } catch (e) {
                 this.logError("Error writing alarm for item " + item.title + " (" + item.id + ")", e);
             } finally {
                 this.mInsertAlarm.reset();
             }
         }
 
@@ -2329,19 +2329,19 @@ calStorageCalendar.prototype = {
     //
     // calISyncWriteCalendar interface
     //
 
     setMetaData: function(id, value) {
         this.executeItemStatement(this.mDeleteMetaData, "item_id", id);
         try {
             this.prepareStatement(this.mInsertMetaData);
-            let sp = this.mInsertMetaData.params;
-            sp.item_id = id;
-            sp.value = value;
+            let params = this.mInsertMetaData.params;
+            params.item_id = id;
+            params.value = value;
             this.mInsertMetaData.executeStep();
         } catch (e) {
             if (e.result == Components.results.NS_ERROR_ILLEGAL_VALUE) {
                 this.logError("Unknown error!", e);
             } else {
                 // The storage service throws an NS_ERROR_ILLEGAL_VALUE in
                 // case pval is something complex (i.e not a string or
                 // number). Swallow this error, leaving the value empty.
--- a/calendar/providers/storage/calStorageHelpers.jsm
+++ b/calendar/providers/storage/calStorageHelpers.jsm
@@ -36,79 +36,79 @@ var CAL_ITEM_FLAG = {
 
 // The cache of foreign timezones
 var gForeignTimezonesCache = {};
 
 /**
  * Returns the passed date in UTC, unless it is floating. In this case, it is
  * kept floating.
  *
- * @param dt        The calIDateTime to convert.
+ * @param date      The calIDateTime to convert.
  * @return          The possibly converted calIDateTime.
  */
-function getInUtcOrKeepFloating(dt) {
-    let tz = dt.timezone;
-    if (tz.isFloating || tz.isUTC) {
-        return dt;
+function getInUtcOrKeepFloating(date) {
+    let timezone = date.timezone;
+    if (timezone.isFloating || timezone.isUTC) {
+        return date;
     } else {
-        return dt.getInTimezone(cal.UTC());
+        return date.getInTimezone(cal.UTC());
     }
 }
 
 /**
  * Transforms a date object to a text which is suitable for the database
  *
- * @param d     The calIDateTime to transform.
+ * @param date  The calIDateTime to transform.
  * @return      The string representation of the date object.
  */
-function dateToText(d) {
+function dateToText(date) {
     let zonestr;
-    if (d.timezone.isFloating) {
+    if (date.timezone.isFloating) {
         zonestr = "L";
-    } else if (d.timezone.isUTC) {
+    } else if (date.timezone.isUTC) {
         zonestr = "U";
     } else {
         zonestr = "Z";
     }
 
-    let datestr = zonestr + (d.isDate ? "D" : "T") + d.nativeTime;
-    if (!d.timezone.isFloating && !d.timezone.isUTC) {
-        datestr += ":" + d.timezone.tzid.replace(/%/g, "%%").replace(/:/g, "%:");
+    let datestr = zonestr + (date.isDate ? "D" : "T") + date.nativeTime;
+    if (!date.timezone.isFloating && !date.timezone.isUTC) {
+        datestr += ":" + date.timezone.tzid.replace(/%/g, "%%").replace(/:/g, "%:");
     }
     return datestr;
 }
 
 /**
  * Transforms the text representation of this date object to a calIDateTime
  * object.
  *
- * @param d     The text to transform.
+ * @param text  The text to transform.
  * @return      The resulting calIDateTime.
  */
-function textToDate(d) {
-    let dval;
-    let tz = "UTC";
+function textToDate(text) {
+    let textval;
+    let timezone = "UTC";
 
-    if (d[0] == "Z") {
-        let strs = d.substr(2).split(":");
-        dval = parseInt(strs[0], 10);
-        tz = strs[1].replace(/%:/g, ":").replace(/%%/g, "%");
+    if (text[0] == "Z") {
+        let strs = text.substr(2).split(":");
+        textval = parseInt(strs[0], 10);
+        timezone = strs[1].replace(/%:/g, ":").replace(/%%/g, "%");
     } else {
-        dval = parseInt(d.substr(2), 10);
+        textval = parseInt(text.substr(2), 10);
     }
 
     let date;
-    if (d[0] == "U" || d[0] == "Z") {
-        date = newDateTime(dval, tz);
-    } else if (d[0] == "L") {
+    if (text[0] == "U" || text[0] == "Z") {
+        date = newDateTime(textval, timezone);
+    } else if (text[0] == "L") {
         // is local time
-        date = newDateTime(dval, "floating");
+        date = newDateTime(textval, "floating");
     }
 
-    if (d[1] == "D") {
+    if (text[1] == "D") {
         date.isDate = true;
     }
     return date;
 }
 
 //
 // other helpers
 //
@@ -135,61 +135,61 @@ calStorageTimezone.prototype = {
 
 /**
  * Gets the timezone for the given definition or identifier
  *
  * @param aTimezone     The timezone data
  * @return              The calITimezone object
  */
 function getTimezone(aTimezone) {
-    let tz = null;
+    let timezone = null;
     if (aTimezone.indexOf("BEGIN:VTIMEZONE") == 0) {
-        tz = gForeignTimezonesCache[aTimezone]; // using full definition as key
-        if (!tz) {
+        timezone = gForeignTimezonesCache[aTimezone]; // using full definition as key
+        if (!timezone) {
             try {
                 // cannot cope without parent VCALENDAR:
                 let comp = cal.getIcsService().parseICS("BEGIN:VCALENDAR\n" + aTimezone + "\nEND:VCALENDAR", null);
-                tz = new calStorageTimezone(comp.getFirstSubcomponent("VTIMEZONE"));
-                gForeignTimezonesCache[aTimezone] = tz;
+                timezone = new calStorageTimezone(comp.getFirstSubcomponent("VTIMEZONE"));
+                gForeignTimezonesCache[aTimezone] = timezone;
             } catch (e) {
                 cal.ASSERT(false, e);
             }
         }
     } else {
-        tz = cal.getTimezoneService().getTimezone(aTimezone);
+        timezone = cal.getTimezoneService().getTimezone(aTimezone);
     }
-    return tz;
+    return timezone;
 }
 
 /**
  * Creates a new calIDateTime from the given native time and optionally
  * the passed timezone. The timezone can either be the TZID of the timezone (in
  * this case the timezone service will be asked for the definition), or a string
  * representation of the timezone component (i.e a VTIMEZONE component).
  *
  * @param aNativeTime       The native time, in microseconds
  * @param aTimezone         The timezone identifier or definition.
  */
 function newDateTime(aNativeTime, aTimezone) {
-    let t = cal.createDateTime();
+    let date = cal.createDateTime();
 
     // Bug 751821 - Dates before 1970 were incorrectly stored with an unsigned nativeTime value, we need to
     // convert back to a negative value
     if (aNativeTime > 0x7fffffffffffffff) {
         cal.WARN("[calStorageCalendar] Converting invalid native time value: " + aNativeTime);
         aNativeTime = -0x7fffffffffffffff + (aNativeTime - 0x7fffffffffffffff);
         // Round to nearest second to fix microsecond rounding errors
         aNativeTime = Math.round(aNativeTime / 1000000) * 1000000;
     }
 
-    t.nativeTime = aNativeTime;
+    date.nativeTime = aNativeTime;
     if (aTimezone) {
-        let tz = getTimezone(aTimezone);
-        if (tz) {
-            t = t.getInTimezone(tz);
+        let timezone = getTimezone(aTimezone);
+        if (timezone) {
+            date = date.getInTimezone(timezone);
         } else {
             cal.ASSERT(false, "Timezone not available: " + aTimezone);
         }
     } else {
-        t.timezone = cal.floating();
+        date.timezone = cal.floating();
     }
-    return t;
+    return date;
 }
--- a/calendar/providers/storage/calStorageUpgrade.jsm
+++ b/calendar/providers/storage/calStorageUpgrade.jsm
@@ -386,19 +386,19 @@ function ensureUpdatedTimezones(db) {
             "SELECT recurrence_id_tz AS zone FROM cal_alarms       WHERE recurrence_id_tz IS NOT NULL UNION " +
             "SELECT recurrence_id_tz AS zone FROM cal_relations    WHERE recurrence_id_tz IS NOT NULL UNION " +
             "SELECT recurrence_id_tz AS zone FROM cal_attachments  WHERE recurrence_id_tz IS NOT NULL" +
             ");");
         try {
             while (getZones.executeStep()) {
                 let zone = getZones.row.zone;
                 // Send the timezones off to the timezone service to attempt conversion:
-                let tz = getTimezone(zone);
-                if (tz) {
-                    let refTz = cal.getTimezoneService().getTimezone(tz.tzid);
+                let timezone = getTimezone(zone);
+                if (timezone) {
+                    let refTz = cal.getTimezoneService().getTimezone(timezone.tzid);
                     if (refTz && refTz.tzid != zone) {
                         zonesToUpdate.push({ oldTzId: zone, newTzId: refTz.tzid });
                     }
                 }
             }
         } catch (e) {
             cal.ERROR("Error updating timezones: " + e +
                       "\nDB Error " + lastErrorString(db));
@@ -636,17 +636,17 @@ var upgrade = {};
  * Returns the initial storage database schema. Note this is not the current
  * schema, it will be modified by the upgrade.vNN() functions. This function
  * returns the initial v1 with modifications from v2 applied.
  *
  * No bug - new recurrence system. exceptions supported now, along with
  * everything else ical can throw at us. I hope.
  * p=vlad
  */
-upgrade.v2 = upgrade.v1 = function(db, version) {
+upgrade.v2 = upgrade.v1 = function(db, version) { // eslint-disable-line id-length
     LOGdb(db, "Storage: Upgrading to v1/v2");
     let tblData = {
       cal_calendar_schema_version: { version: "INTEGER" },
 
     /* While this table is in v1, actually keeping it in the sql object will
      * cause problems when migrating from storage.sdb to local.sqlite. There,
      * all tables from storage.sdb will be moved to local.sqlite and so starting
      * sunbird again afterwards causes a borked upgrade since its missing tables
@@ -728,17 +728,17 @@ upgrade.v2 = upgrade.v1 = function(db, v
 };
 
 /**
  * Upgrade to version 3.
  * Bug 293707, updates to storage provider; calendar manager database locked
  * fix, r=shaver, p=vlad
  * p=vlad
  */
-upgrade.v3 = function(db, version) {
+upgrade.v3 = function(db, version) { // eslint-disable-line id-length
     function updateSql(tbl, field) {
         executeSimpleSQL(db, "UPDATE " + tbl + " SET " + field + "_tz='UTC'" +
                              " WHERE " + field + " IS NOT NULL");
     }
 
     let tbl = upgrade.v2(version < 2 && db, version);
     LOGdb(db, "Storage: Upgrading to v3");
 
@@ -798,17 +798,17 @@ upgrade.v3 = function(db, version) {
     return tbl;
 };
 
 /**
  * Upgrade to version 4.
  * Bug 293183 - implement exception support for recurrence.
  * r=shaver,p=vlad
  */
-upgrade.v4 = function(db, version) {
+upgrade.v4 = function(db, version) { // eslint-disable-line id-length
     let tbl = upgrade.v3(version < 3 && db, version);
     LOGdb(db, "Storage: Upgrading to v4");
 
     beginTransaction(db);
     try {
         for (let tblid of ["events", "todos", "attendees", "properties"]) {
             addColumn(tbl, "cal_" + tblid, "recurrence_id", "INTEGER", db);
             addColumn(tbl, "cal_" + tblid, "recurrence_id_tz", "VARCHAR", db);
@@ -821,17 +821,17 @@ upgrade.v4 = function(db, version) {
     return tbl;
 };
 
 /**
  * Bug 315051 - Switch to storing alarms based on offsets from start/end time
  * rather than as absolute times. Ensure that missed alarms are fired.
  * r=dmose, p=jminta
  */
-upgrade.v5 = function(db, version) {
+upgrade.v5 = function(db, version) { // eslint-disable-line id-length
     let tbl = upgrade.v4(version < 4 && db, version);
     LOGdb(db, "Storage: Upgrading to v5");
 
     beginTransaction(db);
     try {
         for (let tblid of ["events", "todos"]) {
             addColumn(tbl, "cal_" + tblid, "alarm_offset", "INTEGER", db);
             addColumn(tbl, "cal_" + tblid, "alarm_related", "INTEGER", db);
@@ -845,17 +845,17 @@ upgrade.v5 = function(db, version) {
     return tbl;
 };
 
 /**
  * Bug 333688 - Converts STRING and VARCHAR columns to TEXT to avoid SQLite's
  * auto-conversion of strings to numbers (10e4 to 10000)
  * r=ctalbert,jminta p=lilmatt
  */
-upgrade.v6 = function(db, version) {
+upgrade.v6 = function(db, version) { // eslint-disable-line id-length
     let tbl = upgrade.v5(version < 5 && db, version);
     LOGdb(db, "Storage: Upgrading to v6");
 
     beginTransaction(db);
     try {
         let eventCols = ["id", "title", "privacy", "ical_status",
                          "recurrence_id_tz", "event_start_tz",
                          "event_end_tz", "alarm_time_tz"];
@@ -885,39 +885,39 @@ upgrade.v6 = function(db, version) {
 
     return tbl;
 };
 
 /**
  * Bug 369010: Migrate all old tzids in storage to new one.
  * r=ctalbert,dmose p=lilmatt
  */
-upgrade.v7 = function(db, version) {
+upgrade.v7 = function(db, version) { // eslint-disable-line id-length
     // No schema changes in v7
     let tbl = upgrade.v6(db, version);
     LOGdb(db, "Storage: Upgrading to v7");
     return tbl;
 };
 
 /**
  * Bug 410931 - Update internal timezone definitions
  * r=ctalbert, p=dbo,nth10sd,hb
  */
-upgrade.v8 = function(db, version) {
+upgrade.v8 = function(db, version) { // eslint-disable-line id-length
     // No schema changes in v8
     let tbl = upgrade.v7(db, version);
     LOGdb(db, "Storage: Upgrading to v8");
     return tbl;
 };
 
 /**
  * Bug 363191 - Handle Timezones more efficiently (Timezone Database)
  * r=philipp,ctalbert, p=dbo
  */
-upgrade.v9 = function(db, version) {
+upgrade.v9 = function(db, version) { // eslint-disable-line id-length
     // No schema changes in v9
     let tbl = upgrade.v8(db, version);
     LOGdb(db, "Storage: Upgrading to v9");
     return tbl;
 };
 
 /**
  * Bug 413908 – Events using internal timezones are no longer updated to
--- a/calendar/providers/wcap/calWcapCalendar.js
+++ b/calendar/providers/wcap/calWcapCalendar.js
@@ -243,49 +243,49 @@ calWcapCalendar.prototype = {
     },
 
     m_calId: null,
     get calId() {
         return this.m_calId || this.session.defaultCalId;
     },
 
     get ownerId() {
-        let ar = this.getCalendarProperties("X-NSCP-CALPROPS-PRIMARY-OWNER");
-        if (ar.length == 0) {
+        let owner = this.getCalendarProperties("X-NSCP-CALPROPS-PRIMARY-OWNER");
+        if (owner.length == 0) {
             let calId = this.calId;
             log("cannot determine primary owner of calendar " + calId, this);
             // fallback to calId prefix:
             let nColon = calId.indexOf(":");
             if (nColon >= 0) {
                 calId = calId.substring(0, nColon);
             }
             return calId;
         }
-        return ar[0];
+        return owner[0];
     },
 
     get description() {
-        let ar = this.getCalendarProperties("X-NSCP-CALPROPS-DESCRIPTION");
-        if (ar.length == 0) {
+        let descr = this.getCalendarProperties("X-NSCP-CALPROPS-DESCRIPTION");
+        if (descr.length == 0) {
             // fallback to display name:
             return this.displayName;
         }
-        return ar[0];
+        return descr[0];
     },
 
     get displayName() {
-        let ar = this.getCalendarProperties("X-NSCP-CALPROPS-NAME");
-        if (ar.length == 0) {
+        let displayName = this.getCalendarProperties("X-NSCP-CALPROPS-NAME");
+        if (displayName.length == 0) {
             // fallback to common name:
-            ar = this.getCalendarProperties("X-S1CS-CALPROPS-COMMON-NAME");
-            if (ar.length == 0) {
-                ar = [this.calId];
+            displayName = this.getCalendarProperties("X-S1CS-CALPROPS-COMMON-NAME");
+            if (displayName.length == 0) {
+                displayName = [this.calId];
             }
         }
-        return ar[0];
+        return displayName[0];
     },
 
     get isOwnedCalendar() {
         if (this.isDefaultCalendar) {
             return true; // default calendar is owned
         }
         return (this.ownerId == this.session.userId);
     },
@@ -313,20 +313,20 @@ calWcapCalendar.prototype = {
         } else {
             logWarning("defaultTimezone: cannot get X-NSCP-CALPROPS-TZID!", this);
             // try to use local one if supported:
             tzid = cal.getTimezoneService().defaultTimezone.tzid;
             return (this.session.getTimezone(tzid) ? tzid : "UTC");
         }
     },
 
-    getAlignedTzid: function(tz) {
-        let tzid = tz.tzid;
+    getAlignedTzid: function(timezone) {
+        let tzid = timezone.tzid;
         // check whether it is one cs supports:
-        if (tz.isFloating || !this.session.getTimezone(tzid)) {
+        if (timezone.isFloating || !this.session.getTimezone(tzid)) {
             log("not a supported timezone: " + tzid);
             // bug 435436:
             // xxx todo: we could further on search for a matching region,
             //           e.g. CET (in TZNAME), but for now stick to
             //           user's default if not supported directly
             let ret = this.defaultTimezone;
             // use calendar's default:
             log(tzid + " not supported, falling back to default: " + ret, this);
--- a/calendar/providers/wcap/calWcapCalendarItems.js
+++ b/calendar/providers/wcap/calWcapCalendarItems.js
@@ -20,19 +20,19 @@ calWcapCalendar.prototype.encodeAttendee
             }
             params += encodeURIComponent(val);
         }
         return params;
     }
     let params = encodeAttr(att.rsvp, "RSVP", "");
     params = encodeAttr(att.participationStatus, "PARTSTAT", params);
     params = encodeAttr(att.role, "ROLE", params);
-    let cn = att.commonName;
-    if (cn) {
-        params = encodeAttr(cn.replace(/[;:]/g, " "), "CN", params); // remove ';' and ':' from CN
+    let commonName = att.commonName;
+    if (commonName) {
+        params = encodeAttr(commonName.replace(/[;:]/g, " "), "CN", params); // remove ';' and ':' from CN
     }
     return encodeAttr(att.id, null, params);
 };
 
 calWcapCalendar.prototype.getRecurrenceParams = function(item, out_rrules, out_rdates, out_exrules, out_exdates) {
     // recurrences:
     out_rrules.value = [];
     out_rdates.value = [];
@@ -195,19 +195,19 @@ calWcapCalendar.prototype.isInvitation =
         return false;
     }
     return (this.getInvitedAttendee(item) != null);
 };
 
 calWcapCalendar.prototype.getInvitedAttendee = function(item) {
     let att = getAttendeeByCalId(item.getAttendees({}), this.calId);
     if (!att) { // try to find mail address
-        let ar = this.session.getUserPreferences("X-NSCP-WCAP-PREF-mail");
-        if (ar.length > 0 && ar[0].length > 0) {
-            att = item.getAttendeeById("mailto:" + ar[0]);
+        let prefMail = this.session.getUserPreferences("X-NSCP-WCAP-PREF-mail");
+        if (prefMail.length > 0 && prefMail[0].length > 0) {
+            att = item.getAttendeeById("mailto:" + prefMail[0]);
         }
     }
     return att;
 };
 
 calWcapCalendar.prototype.canNotify = function(method, item) {
     if (!this.session.isLoggedIn) {
         return false;
@@ -777,42 +777,42 @@ calWcapCalendar.prototype.deleteItem = f
                                  params, calIWcapCalendar.AC_COMP_WRITE);
     } catch (exc) {
         request.execRespFunc(exc);
     }
     return request;
 };
 
 calWcapCalendar.prototype.patchTimezone = function(subComp, attr, xpropOrTz) {
-    let dt = subComp[attr];
+    let date = subComp[attr];
     // if TZID parameter present (all-day items), it takes precedence:
-    if (dt && (dt.timezone.isUTC || dt.timezone.isFloating)) {
+    if (date && (date.timezone.isUTC || date.timezone.isFloating)) {
         if (LOG_LEVEL > 2) {
-            log(attr + " is " + dt, this);
+            log(attr + " is " + date, this);
         }
-        let tz;
+        let timezone;
         if (typeof xpropOrTz == "string") {
             let tzid = subComp.getFirstProperty(xpropOrTz);
             if (tzid) {
-                tz = this.session.getTimezone(tzid.value);
-                ASSERT(tz, "timezone not found: " + tzid);
+                timezone = this.session.getTimezone(tzid.value);
+                ASSERT(timezone, "timezone not found: " + tzid);
             }
         } else {
-            tz = xpropOrTz;
+            timezone = xpropOrTz;
         }
-        if (tz) {
+        if (timezone) {
             if (LOG_LEVEL > 2) {
                 log("patching " + xpropOrTz + ": from " +
-                    dt + " to " + dt.getInTimezone(tz), this);
+                    date + " to " + date.getInTimezone(timezone), this);
             }
-            dt = dt.getInTimezone(tz);
-            subComp[attr] = dt;
+            date = date.getInTimezone(timezone);
+            subComp[attr] = date;
         }
     }
-    return dt;
+    return date;
 };
 
 calWcapCalendar.prototype.parseItems = function(
     icalRootComp, itemFilter, maxResults, rangeStart, rangeEnd, bLeaveMutable) {
     let items = [];
     let unexpandedItems = [];
     let uid2parent = {};
     let excItems = [];
--- a/calendar/providers/wcap/calWcapSession.js
+++ b/calendar/providers/wcap/calWcapSession.js
@@ -19,18 +19,18 @@ function calWcapTimezone(tzProvider, tzi
     this.isFloating = false;
     this.latitude = null;
     this.longitude = null;
 }
 calWcapTimezone.prototype = {
     get displayName() {
         if (this.mDisplayName === undefined) {
             // used l10n'ed display name if available:
-            let tz = cal.getTimezoneService().getTimezone(this.tzid);
-            this.mDisplayName = (tz ? tz.displayName : this.tzid);
+            let timezone = cal.getTimezoneService().getTimezone(this.tzid);
+            this.mDisplayName = (timezone ? timezone.displayName : this.tzid);
         }
         return this.mDisplayName;
     },
     toString: function() {
         return this.icalComponent.toString();
     }
 };
 
@@ -302,30 +302,30 @@ calWcapSession.prototype = {
                     } else if (loginerr) {
                         respFunc(loginerr);
                     } else {
                         if (outSavePW.value) {
                             // so try to remove old pw from db first:
                             cal.auth.passwordManagerSave(outUser.value, outPW.value, this.uri.spec, "wcap login");
                         }
                         this.credentials.userId = outUser.value;
-                        this.credentials.pw = outPW.value;
+                        this.credentials.pw = outPW.value; // eslint-disable-line id-length
                         this.setupSession(sessionId, request, (setuperr) => respFunc(setuperr, sessionId));
                     }
                 };
 
                 if (outPW.value) {
                     this.login(request, promptAndLoginLoop_resp, outUser.value, outPW.value);
                 } else {
                     promptAndLoginLoop_resp(calIWcapErrors.WCAP_LOGIN_FAILED);
                 }
             });
     },
 
-    login: function(request, respFunc, user, pw) {
+    login: function(request, respFunc, user, password) {
         issueNetworkRequest(
             request,
             (err, str) => {
                 let sessionId;
                 try {
                     if (err) {
                         throw err;
                     }
@@ -355,17 +355,17 @@ calWcapSession.prototype = {
                         // server seems unavailable:
                         err = new Components.Exception(cal.calGetString("wcap", "accessingServerFailedError.text",
                                                                         [this.sessionUri.hostPort]), exc);
                     }
                 }
                 respFunc(err, sessionId);
             },
             this.sessionUri.spec + "login.wcap?fmt-out=text%2Fcalendar&user=" +
-            encodeURIComponent(user) + "&password=" + encodeURIComponent(pw),
+            encodeURIComponent(user) + "&password=" + encodeURIComponent(password),
             false /* no logging */);
     },
 
     logout: function(listener) {
         let request = new calWcapRequest(
             (oprequest, err) => {
                 if (err) {
                     logError(err, this);
@@ -489,22 +489,22 @@ calWcapSession.prototype = {
                     let defaultCal = this.defaultCalendar;
                     if (defaultCal && cals[defaultCal.calId] && // default calendar is registered
                         getPref("calendar.wcap.subscriptions", true) &&
                         !defaultCal.getProperty("subscriptions_registered")) {
                         let hasSubscriptions = false;
                         // post register subscribed calendars:
                         let list = this.getUserPreferences("X-NSCP-WCAP-PREF-icsSubscribed");
                         for (let item of list) {
-                            let ar = item.split(",");
+                            let itemparts = item.split(",");
                             // ',', '$' are not encoded. ',' can be handled here. WTF.
-                            for (let a of ar) {
-                                let dollar = a.indexOf("$");
+                            for (let part of itemparts) {
+                                let dollar = part.indexOf("$");
                                 if (dollar >= 0) {
-                                    let calId = a.substring(0, dollar);
+                                    let calId = part.substring(0, dollar);
                                     if (calId != this.defaultCalId) {
                                         cals[calId] = null;
                                         hasSubscriptions = true;
                                     }
                                 }
                             }
                         }
 
@@ -555,19 +555,19 @@ calWcapSession.prototype = {
                                                calIWcapErrors.WCAP_LOGIN_FAILED);
             }
             let xml = getDomParser().parseFromString(data, "text/xml");
             let nodeList = xml.getElementsByTagName("iCal");
             for (let i = 0; i < nodeList.length; ++i) {
                 try {
                     let node = nodeList.item(i);
                     checkWcapXmlErrno(node);
-                    let ar = filterXmlNodes("X-NSCP-CALPROPS-RELATIVE-CALID", node);
-                    if (ar.length > 0) {
-                        let calId = ar[0];
+                    let calid = filterXmlNodes("X-NSCP-CALPROPS-RELATIVE-CALID", node);
+                    if (calid.length > 0) {
+                        let calId = calid[0];
                         let calendar = cals[calId];
                         if (calendar === null) {
                             calendar = new calWcapCalendar(this);
                             let uri = this.uri.clone();
                             uri.path += "?calid=" + encodeURIComponent(calId);
                             calendar.uri = uri;
                         }
                         if (calendar) {
@@ -818,32 +818,32 @@ calWcapSession.prototype = {
 
     getUserPreferences: function(prefName) {
         let prefs = filterXmlNodes(prefName, this.credentials.userPrefs);
         return prefs;
     },
 
     get defaultAlarmStart() {
         let alarmStart = null;
-        let ar = this.getUserPreferences("X-NSCP-WCAP-PREF-ceDefaultAlarmStart");
-        if (ar.length > 0 && ar[0].length > 0) {
+        let alarmStartPref = this.getUserPreferences("X-NSCP-WCAP-PREF-ceDefaultAlarmStart");
+        if (alarmStartPref.length > 0 && alarmStartPref[0].length > 0) {
             // workarounding cs duration bug, missing "T":
-            let dur = ar[0].replace(/(^P)(\d+[HMS]$)/, "$1T$2");
+            let dur = alarmStartPref[0].replace(/(^P)(\d+[HMS]$)/, "$1T$2");
             alarmStart = cal.createDuration(dur);
             alarmStart.isNegative = !alarmStart.isNegative;
         }
         return alarmStart;
     },
 
     getDefaultAlarmEmails: function(out_count) {
         let ret = [];
-        let ar = this.getUserPreferences("X-NSCP-WCAP-PREF-ceDefaultAlarmEmail");
-        if (ar.length > 0 && ar[0].length > 0) {
-            for (let i of ar) {
-                ret = ret.concat(i.split(/[;,]/).map(String.trim));
+        let alarmEmails = this.getUserPreferences("X-NSCP-WCAP-PREF-ceDefaultAlarmEmail");
+        if (alarmEmails.length > 0 && alarmEmails[0].length > 0) {
+            for (let email of alarmEmails) {
+                ret = ret.concat(email.split(/[;,]/).map(String.trim));
             }
         }
         out_count.value = ret.length;
         return ret;
     },
 
     // calICalendarSearchProvider:
     searchForCalendars: function(searchString, hints, maxResults, listener) {
@@ -881,19 +881,19 @@ calWcapSession.prototype = {
                     }
                     let xml = getDomParser().parseFromString(data, "text/xml");
                     let ret = [];
                     let nodeList = xml.getElementsByTagName("iCal");
                     for (let i = 0; i < nodeList.length; ++i) {
                         let node = nodeList.item(i);
                         try {
                             checkWcapXmlErrno(node);
-                            let ar = filterXmlNodes("X-NSCP-CALPROPS-RELATIVE-CALID", node);
-                            if (ar.length > 0) {
-                                let calId = ar[0];
+                            let calIdNodes = filterXmlNodes("X-NSCP-CALPROPS-RELATIVE-CALID", node);
+                            if (calIdNodes.length > 0) {
+                                let calId = calIdNodes[0];
                                 let calendar = registeredCalendars[calId];
                                 if (calendar) {
                                     calendar.m_calProps = node; // update calprops
                                 } else {
                                     calendar = new calWcapCalendar(this, node);
                                     let uri = this.uri.clone();
                                     uri.path += "?calid=" + encodeURIComponent(calId);
                                     calendar.uri = uri;
@@ -1092,18 +1092,18 @@ calWcapSession.prototype = {
 };
 
 function confirmInsecureLogin(uri) {
     if (!confirmInsecureLogin.m_confirmedHttpLogins) {
         confirmInsecureLogin.m_confirmedHttpLogins = {};
         let confirmedHttpLogins = getPref("calendar.wcap.confirmed_http_logins", "");
         let tuples = confirmedHttpLogins.split(",");
         for (let tuple of tuples) {
-            let ar = tuple.split(":");
-            confirmInsecureLogin.m_confirmedHttpLogins[ar[0]] = ar[1];
+            let part = tuple.split(":");
+            confirmInsecureLogin.m_confirmedHttpLogins[part[0]] = part[1];
         }
     }
 
     let bConfirmed = false;
 
     let host = uri.hostPort;
     let encodedHost = encodeURIComponent(host);
     let confirmedEntry = confirmInsecureLogin.m_confirmedHttpLogins[encodedHost];
--- a/calendar/providers/wcap/calWcapUtils.js
+++ b/calendar/providers/wcap/calWcapUtils.js
@@ -178,37 +178,37 @@ function filterXmlNodes(name, rootNode) 
 
 function getTime() {
     if (g_bShutdown) {
         return null;
     }
     return cal.jsDateToDateTime(new Date());
 }
 
-function getIcalUTC(dt) {
-    if (!dt || !dt.isValid) {
+function getIcalUTC(date) {
+    if (!date || !date.isValid) {
         return "0";
     } else {
-        let dtz = dt.timezone;
+        let dtz = date.timezone;
         if (dtz.isUTC || dtz.isFloating) {
-            return dt.icalString;
+            return date.icalString;
         } else {
-            return dt.getInTimezone(UTC()).icalString;
+            return date.getInTimezone(UTC()).icalString;
         }
     }
 }
 
 function getDatetimeFromIcalString(val) {
     if (!val || val.length == 0 || val == "0") {
         return null;
     }
     // assuming timezone is known:
-    let dt = createDateTime();
-    dt.icalString = val;
-    return dt;
+    let date = createDateTime();
+    date.icalString = val;
+    return date;
 }
 
 function getDatetimeFromIcalProp(prop) {
     if (!prop) {
         return null;
     }
     return getDatetimeFromIcalString(prop.valueAsIcalString);
 }
--- a/calendar/resources/content/calendarCreation.js
+++ b/calendar/resources/content/calendarCreation.js
@@ -225,17 +225,17 @@ function parseUri(aUri) {
         uri = makeURL(aUri);
     } catch (ex) {
         return [errorConstants.INVALID_URI, null];
     }
 
     let calManager = cal.getCalendarManager();
     let cals = calManager.getCalendars({});
     let type = document.getElementById("calendar-type").selectedItem.value;
-    if (type != "local" && cals.some(c => c.uri.spec == uri.spec)) {
+    if (type != "local" && cals.some(calendar => calendar.uri.spec == uri.spec)) {
         // If the calendar is not local, we check if there is already a calendar
         // with the same uri spec. Storage calendars all have the same uri, so
         // we have to specialcase them.
         return [errorConstants.ALREADY_EXISTS, null];
     }
 
     return [errorConstants.SUCCESS, uri];
 }
--- a/calendar/resources/content/datetimepickers/datetimepickers.xml
+++ b/calendar/resources/content/datetimepickers/datetimepickers.xml
@@ -1630,19 +1630,19 @@
               // regexp derived from the Alphabetic ranges in
               // http://www.unicode.org/Public/UNIDATA/DerivedCoreProperties.txt)
               // (.*)? binds to null if no suffix.
               let parseAlphShortDateRegex = /^\s*(\d+|[^\d\W]+)\W{0,2}(\d+|[^\d\W]+)\W{0,2}(\d+|[^\d\W]+)(.*)?$/;
               let datePartsArray = parseAlphShortDateRegex.exec(aValue);
               if (datePartsArray != null) {
                 year = Number(datePartsArray[this.yearIndex]);
                 let monthString = datePartsArray[this.monthIndex].toUpperCase();
-                for (let m = 0; m < this.alphaMonths.length; m++) {
-                  if (monthString == this.alphaMonths[m]) {
-                    month = m;
+                for (let monthIdx = 0; monthIdx < this.alphaMonths.length; monthIdx++) {
+                  if (monthString == this.alphaMonths[monthIdx]) {
+                    month = monthIdx;
                     break;
                   }
                 }
                 day = Number(datePartsArray[this.dayIndex]);
                 timeString = datePartsArray[4];
               }
             }
             if (year != Number.MIN_VALUE && month != -1 && day != -1) {
@@ -1829,22 +1829,22 @@
                     case 4: this.dayIndex = j; break;
                     default: this.monthIndex = j; break;
                   }
                 }
                 if (this.yearIndex != -1 && this.dayIndex != -1 && this.monthIndex != -1) {
                   this.probeSucceeded = true;
                   // Fill this.alphaMonths with month names.
                   this.alphaMonths = new Array(12);
-                  for (let m = 0; m < 12; m++) {
-                    probeDate.setMonth(m);
+                  for (let monthIdx = 0; monthIdx < 12; monthIdx++) {
+                    probeDate.setMonth(monthIdx);
                     probeString = this.formatDate(probeDate);
                     probeArray = this.parseShortDateRegex.exec(probeString);
                     if (probeArray) {
-                      this.alphaMonths[m] = probeArray[this.monthIndex].toUpperCase();
+                      this.alphaMonths[monthIdx] = probeArray[this.monthIndex].toUpperCase();
                     } else {
                       this.probeSucceeded = false;
                     }
                   }
                 }
               }
             }
             if (!this.probeSucceeded) {
--- a/calendar/test/mozmill/eventDialog/testEventDialog.js
+++ b/calendar/test/mozmill/eventDialog/testEventDialog.js
@@ -113,18 +113,18 @@ var testEventDialog = function() {
 
   // repeat daily
   event.click(new elementslib.ID(event.window.document, "repeat-daily-menuitem"));
 
   // add reminder
   event.click(new elementslib.ID(event.window.document, "reminder-5minutes-menuitem"));
 
   // add an attendee and verify added
-  let md = new modalDialog.modalDialog(event.window);
-  md.start(handleAttendees);
+  let dialog = new modalDialog.modalDialog(event.window);
+  dialog.start(handleAttendees);
   event.click(new elementslib.ID(event.window.document, "button-attendees"));
   event.assertValue(new elementslib.ID(event.window.document, "attendee-list"),
     attendee);
 
   // make it private and verify label visible
   event.click(new elementslib.ID(event.window.document, "button-privacy"));
   event.click(new elementslib.ID(event.window.document, "event-privacy-private-menuitem"));
   let label = new elementslib.ID(event.window.document, "status-privacy-private-box");
--- a/calendar/test/mozmill/eventDialog/testEventDialogModificationPrompt.js
+++ b/calendar/test/mozmill/eventDialog/testEventDialogModificationPrompt.js
@@ -87,46 +87,46 @@ var testEventDialogModificationPrompt = 
     '/{"tooltip":"itemTooltip"}');
   controller.waitForElement(eventBox);
   controller.doubleClick(eventBox);
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
 
   // modal dialog setup
-  let md = new modalDialog.modalDialog(event.window);
-  md.start(handleSavePrompt);
+  let dialog = new modalDialog.modalDialog(event.window);
+  dialog.start(handleSavePrompt);
 
   // escape the event window, there should be no prompt to save event
   event.keypress(undefined, "VK_ESCAPE", {});
   controller.sleep(sleep);
-  md.stop();
+  dialog.stop();
 
   // open
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, 8) +
     '/{"tooltip":"itemTooltip"}'));
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
 
   // change all values
   calUtils.setData(event, data[1]);
 
   // edit all values back to original
   calUtils.setData(event, data[0]);
 
   // this is set up after data entry because otherwise it tries to handle attachment dialog
-  md = new modalDialog.modalDialog(event.window);
-  md.start(handleSavePrompt);
+  dialog = new modalDialog.modalDialog(event.window);
+  dialog.start(handleSavePrompt);
 
   // escape the event window, there should be no prompt to save event
   event.keypress(undefined, "VK_ESCAPE", {});
   controller.sleep(sleep);
-  md.stop();
+  dialog.stop();
 
   // delete event
   controller.click(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, 8)));
   controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
     "VK_DELETE", {});
   controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, 8)));
@@ -145,21 +145,21 @@ var testEventDialogModificationPrompt = 
     eventBox = new elementslib.Lookup(controller.window.document,
       calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, 8) +
       '/{"tooltip":"itemTooltip"}');
     controller.waitForElement(eventBox);
     controller.doubleClick(eventBox);
     controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
     event = new mozmill.controller.MozMillController(mozmill.utils
       .getWindows("Calendar:EventDialog")[0]);
-    md = new modalDialog.modalDialog(event.window);
-    md.start(handleSavePrompt);
+    dialog = new modalDialog.modalDialog(event.window);
+    dialog.start(handleSavePrompt);
     event.keypress(undefined, "VK_ESCAPE", {});
     controller.sleep(sleep);
-    md.stop();
+    dialog.stop();
 
     // delete it
     // XXX somehow the event is selected at this point, this didn't use to be the case
     // and can't be reproduced manually
     controller.keypress(new elementslib.ID(controller.window.document, "day-view"),
       "VK_DELETE", {});
     controller.waitForElementNotPresent(new elementslib.Lookup(controller.window.document,
       calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, 8)));
--- a/calendar/test/mozmill/recurrence/testLastDayOfMonthRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testLastDayOfMonthRecurrence.js
@@ -22,18 +22,18 @@ var testLastDayOfMonthRecurrence = funct
 
   // create monthly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
 
-  let md = new modalDialog.modalDialog(event.window);
-  md.start(setRecurrence);
+  let dialog = new modalDialog.modalDialog(event.window);
+  dialog.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "custom");
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   //                        date     correct row in month view
--- a/calendar/test/mozmill/recurrence/testWeeklyNRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testWeeklyNRecurrence.js
@@ -22,18 +22,18 @@ var testWeeklyNRecurrence = function() {
   calUtils.goToDate(controller, 2009, 1, 5);
 
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
-  let md = new modalDialog.modalDialog(event.window);
-  md.start(setRecurrence);
+  let dialog = new modalDialog.modalDialog(event.window);
+  dialog.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
 
   // check day view
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour) +
     eventPath;
--- a/calendar/test/mozmill/recurrence/testWeeklyUntilRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testWeeklyUntilRecurrence.js
@@ -24,18 +24,18 @@ var testWeeklyUntilRecurrence = function
   calUtils.goToDate(controller, 2009, 1, 5); // Monday
 
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
-  let md = new modalDialog.modalDialog(event.window);
-  md.start(setRecurrence);
+  let dialog = new modalDialog.modalDialog(event.window);
+  dialog.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour) +
     eventPath;
--- a/calendar/test/mozmill/recurrence/testWeeklyWithExceptionRecurrence.js
+++ b/calendar/test/mozmill/recurrence/testWeeklyWithExceptionRecurrence.js
@@ -23,18 +23,18 @@ var testWeeklyWithExceptionRecurrence = 
   calUtils.goToDate(controller, 2009, 1, 5);
 
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
-  let md = new modalDialog.modalDialog(event.window);
-  md.start(setRecurrence);
+  let dialog = new modalDialog.modalDialog(event.window);
+  dialog.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   // move 5th January occurrence to 6th January
   calUtils.handleOccurrenceModification(controller, false);
@@ -74,18 +74,18 @@ var testWeeklyWithExceptionRecurrence = 
   calUtils.goToDate(controller, 2009, 1, 7);
   calUtils.handleParentModification(controller, false);
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour) +
       eventPath));
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
-  md = new modalDialog.modalDialog(event.window);
-  md.start(changeRecurrence);
+  dialog = new modalDialog.modalDialog(event.window);
+  dialog.start(changeRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   // check two weeks
   // day view
--- a/calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testLastDayOfMonthRecurrence.js
@@ -29,18 +29,18 @@ var testLastDayOfMonthRecurrence = funct
 
   // create monthly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils
     .getWindows("Calendar:EventDialog")[0]);
 
-  let md = new modalDialog.modalDialog(event.window);
-  md.start(setRecurrence);
+  let dialog = new modalDialog.modalDialog(event.window);
+  dialog.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined,
     "custom");
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   //                      date      correct row in month view
--- a/calendar/test/mozmill/recurrenceRotated/testWeeklyNRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testWeeklyNRecurrence.js
@@ -29,18 +29,18 @@ var testWeeklyNRecurrence = function() {
   });
 
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
-  let md = new modalDialog.modalDialog(event.window);
-  md.start(setRecurrence);
+  let dialog = new modalDialog.modalDialog(event.window);
+  dialog.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
 
   // check day view
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour) +
     eventPath;
--- a/calendar/test/mozmill/recurrenceRotated/testWeeklyUntilRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testWeeklyUntilRecurrence.js
@@ -30,18 +30,18 @@ var testWeeklyUntilRecurrence = function
   });
 
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
-  let md = new modalDialog.modalDialog(event.window);
-  md.start(setRecurrence);
+  let dialog = new modalDialog.modalDialog(event.window);
+  dialog.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   let box = calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour) +
     eventPath;
--- a/calendar/test/mozmill/recurrenceRotated/testWeeklyWithExceptionRecurrence.js
+++ b/calendar/test/mozmill/recurrenceRotated/testWeeklyWithExceptionRecurrence.js
@@ -30,18 +30,18 @@ var testWeeklyWithExceptionRecurrence = 
   });
 
   // create weekly recurring event
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.CANVAS_BOX, undefined, 1, hour)), 1, 1);
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   let event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
-  let md = new modalDialog.modalDialog(event.window);
-  md.start(setRecurrence);
+  let dialog = new modalDialog.modalDialog(event.window);
+  dialog.start(setRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
 
   // move 5th January occurrence to 6th January
   calUtils.handleOccurrenceModification(controller, false);
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
@@ -80,18 +80,18 @@ var testWeeklyWithExceptionRecurrence = 
   calUtils.goToDate(controller, 2009, 1, 7);
   calUtils.handleParentModification(controller, false);
   controller.doubleClick(new elementslib.Lookup(controller.window.document,
     calUtils.getEventBoxPath(controller, "day", calUtils.EVENT_BOX, undefined, 1, hour) +
       eventPath));
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length > 0, sleep);
   event = new mozmill.controller.MozMillController(mozmill.utils.getWindows("Calendar:EventDialog")[0]);
 
-  md = new modalDialog.modalDialog(event.window);
-  md.start(changeRecurrence);
+  dialog = new modalDialog.modalDialog(event.window);
+  dialog.start(changeRecurrence);
   event.waitForElement(new elementslib.ID(event.window.document, "item-repeat"));
   event.select(new elementslib.ID(event.window.document, "item-repeat"), undefined, undefined, "custom");
 
   event.click(new elementslib.ID(event.window.document, "button-save"));
   controller.waitFor(() => mozmill.utils.getWindows("Calendar:EventDialog").length == 0);
 
   // check two weeks
   // day view
--- a/calendar/test/mozmill/shared-modules/calendar-utils.js
+++ b/calendar/test/mozmill/shared-modules/calendar-utils.js
@@ -48,37 +48,37 @@ function handleAddingAttachment(controll
 }
 
 /**
  *  Choose to delete just one occurrence of a repeating event
  *  @param controller - Mozmill window controller
  *  @param attendees - whether there are attendees that can be notified or not
  */
 function handleOccurrenceDeletion(controller, attendees) {
-  let md = new modalDialog.modalDialog(controller.window);
-  md.start((dialog) => {
+  let dialog = new modalDialog.modalDialog(controller.window);
+  dialog.start((dialogController) => {
     if (attendees) {
       acceptSendingNotificationMail();
     }
-    dialog.waitThenClick(new elementslib.ID(dialog.window.document, "accept-occurrence-button"));
+    dialogController.waitThenClick(new elementslib.ID(dialog.window.document, "accept-occurrence-button"));
   });
 }
 
 /**
  *  Choose to delete all occurrences of a repeating event
  *  @param controller - Mozmill window controller
  *  @param attendees - whether there are attendees that can be notified or not
  */
 function handleParentDeletion(controller, attendees) {
-  let md = new modalDialog.modalDialog(controller.window);
-  md.start((dialog) => {
+  let dialog = new modalDialog.modalDialog(controller.window);
+  dialog.start((dialogController) => {
     if (attendees) {
       acceptSendingNotificationMail();
     }
-    dialog.waitThenClick(new elementslib.ID(dialog.window.document, "accept-parent-button"));
+    dialogController.waitThenClick(new elementslib.ID(dialog.window.document, "accept-parent-button"));
   });
 }
 
 /**
  *  Choose to modify just one occurrence of a repeating event
  *  @param controller - Mozmill window controller
  *  @param attendees - whether there are attendees that can be notified or not
  */
--- a/calendar/test/mozmill/shared-modules/timezone-utils.js
+++ b/calendar/test/mozmill/shared-modules/timezone-utils.js
@@ -26,22 +26,22 @@ function verify(controller, dates, timez
      a spacer is added to push the event to it's correct location.             |__event_box___|
      But timeline can be used to retrieve the position of a particular hour    |day continues |
      on screen and it can be compared against the position of the event.       ----------------
   */
   for (let date = 0; date < dates.length; date++) {
     calUtils.goToDate(controller, dates[date][0], dates[date][1], dates[date][2]);
 
     // find event with timezone tz
-    for (let tz = 0; tz < timezones.length; tz++) {
+    for (let tzIdx = 0; tzIdx < timezones.length; tzIdx++) {
       let found = false;
 
-      let correctHour = times[date][tz][0];
-      let minutes = times[date][tz][1];
-      let day = times[date][tz][2];
+      let correctHour = times[date][tzIdx][0];
+      let minutes = times[date][tzIdx][1];
+      let day = times[date][tzIdx][2];
 
       let timeNode = (new elementslib.Lookup(controller.window.document,
                                              timeLine + "[" + correctHour + "]")).getNode();
       let timeY = timeNode.boxObject.y;
       timeY += timeNode.boxObject.height * (minutes / 60);
 
       let stackNode;
       let eventNodes = [];
@@ -62,17 +62,17 @@ function verify(controller, dates, timez
         calUtils.back(controller, 1);
         stackNode = (new elementslib.Lookup(controller.window.document, dayStack)).getNode();
       }
 
       calUtils.findEventsInNode(stackNode, eventNodes);
 
       for (let node of eventNodes) {
         if (Math.abs(timeY - node.boxObject.y) < allowedDifference &&
-                     timezones[tz] == node.mOccurrence.title) {
+                     timezones[tzIdx] == node.mOccurrence.title) {
           found = true;
           break;
         }
       }
 
       if (day != undefined && day == 1) {
         calUtils.back(controller, 1);
       }
--- a/calendar/test/unit/head_consts.js
+++ b/calendar/test/unit/head_consts.js
@@ -28,27 +28,27 @@ var { classes: Cc, interfaces: Ci, resul
 
 Components.utils.import("resource://calendar/modules/calUtils.jsm");
 
 // we might want to use calUtils.jsm only in the future throughout all tests,
 // but for now source in good old calUtils.js:
 cal.loadScripts(["calUtils.js"], Components.utils.getGlobalForObject(Cc));
 
 function createDate(aYear, aMonth, aDay, aHasTime, aHour, aMinute, aSecond, aTimezone) {
-    let cd = Cc["@mozilla.org/calendar/datetime;1"]
-             .createInstance(Ci.calIDateTime);
-    cd.resetTo(aYear,
+    let date = Cc["@mozilla.org/calendar/datetime;1"]
+               .createInstance(Ci.calIDateTime);
+    date.resetTo(aYear,
                aMonth,
                aDay,
                aHour || 0,
                aMinute || 0,
                aSecond || 0,
                aTimezone || UTC());
-    cd.isDate = !aHasTime;
-    return cd;
+    date.isDate = !aHasTime;
+    return date;
 }
 
 function createEventFromIcalString(icalString) {
     if (/^BEGIN:VCALENDAR/.test(icalString)) {
         let parser = Components.classes["@mozilla.org/calendar/ics-parser;1"]
                                .createInstance(Components.interfaces.calIIcsParser);
         parser.parseString(icalString);
         let items = parser.getItems({});
@@ -234,20 +234,20 @@ function do_calendar_startup(callback) {
     let obs = {
       observe: function() {
         Services.obs.removeObserver(this, "calendar-startup-done");
         do_test_finished();
         do_execute_soon(callback);
       }
     };
 
-    let ss = Components.classes["@mozilla.org/calendar/startup-service;1"]
-                       .getService(Components.interfaces.nsISupports).wrappedJSObject;
+    let startupService = Components.classes["@mozilla.org/calendar/startup-service;1"]
+                                   .getService(Components.interfaces.nsISupports).wrappedJSObject;
 
-    if (ss.started) {
+    if (startupService.started) {
         callback();
     } else {
         do_test_pending();
         Services.obs.addObserver(obs, "calendar-startup-done", false);
         if (_profileInitialized) {
             Services.obs.notifyObservers(null, "profile-after-change", "xpcshell-do-get-profile");
         } else {
             do_get_profile(true);
--- a/calendar/test/unit/test_alarm.js
+++ b/calendar/test/unit/test_alarm.js
@@ -285,44 +285,44 @@ function test_repeat() {
     // Check repeatDate
     alarm = cal.createAlarm();
     alarm.related = Components.interfaces.calIAlarm.ALARM_RELATED_ABSOLUTE;
     alarm.alarmDate = cal.createDateTime();
     alarm.repeat = 1;
     alarm.repeatOffset = cal.createDuration();
     alarm.repeatOffset.inSeconds = 3600;
 
-    let dt = alarm.alarmDate.clone();
-    dt.second += 3600;
-    equal(alarm.repeatDate.icalString, dt.icalString);
+    let date = alarm.alarmDate.clone();
+    date.second += 3600;
+    equal(alarm.repeatDate.icalString, date.icalString);
 
     dump("Done\n");
 }
 
 function test_xprop() {
     dump("Testing X-Props...");
     let alarm = cal.createAlarm();
     alarm.setProperty("X-PROP", "X-VALUE");
     ok(alarm.hasProperty("X-PROP"));
     equal(alarm.getProperty("X-PROP"), "X-VALUE");
     alarm.deleteProperty("X-PROP");
     ok(!alarm.hasProperty("X-PROP"));
     equal(alarm.getProperty("X-PROP"), null);
 
     // also check X-MOZ-LASTACK prop
-    let dt = cal.createDateTime();
-    alarm.setProperty("X-MOZ-LASTACK", dt.icalString);
+    let date = cal.createDateTime();
+    alarm.setProperty("X-MOZ-LASTACK", date.icalString);
     alarm.action = "DISPLAY";
     alarm.description = "test";
     alarm.related = Ci.calIAlarm.ALARM_RELATED_START;
     alarm.offset = createDuration("-PT5M");
-    ok(alarm.icalComponent.serializeToICS().includes(dt.icalString));
+    ok(alarm.icalComponent.serializeToICS().includes(date.icalString));
 
     alarm.deleteProperty("X-MOZ-LASTACK");
-    ok(!alarm.icalComponent.serializeToICS().includes(dt.icalString));
+    ok(!alarm.icalComponent.serializeToICS().includes(date.icalString));
     dump("Done\n");
 }
 
 function test_dates() {
     dump("Testing alarm dates...");
     let passed;
     // Initial value
     let alarm = cal.createAlarm();
@@ -468,18 +468,18 @@ function test_clone() {
         notEqual(alarm[prop], newAlarm[prop]);
         dump("OK!\n");
         break;
     }
 
     // Check x props
     alarm.setProperty("X-FOO", "BAR");
     equal(alarm.getProperty("X-FOO"), "BAR");
-    let dt = alarm.getProperty("X-DATEPROP");
-    equal(dt.isMutable, true);
+    let date = alarm.getProperty("X-DATEPROP");
+    equal(date.isMutable, true);
 
     // Test xprop params
     alarm.icalString =
         "BEGIN:VALARM\n" +
         "ACTION:DISPLAY\n" +
         "TRIGGER:-PT15M\n" +
         "X-FOO;X-PARAM=PARAMVAL:BAR\n" +
         "DESCRIPTION:TEST\n" +
@@ -495,20 +495,20 @@ function test_serialize() {
     // most checks done by other tests, these don't fit into categories
     let alarm = cal.createAlarm();
     let srv = cal.getIcsService();
 
     throws(() => {
         alarm.icalComponent = srv.createIcalComponent("BARF");
     }, /0x80070057/, "Invalid Argument");
 
-    function addProp(k, v) {
-        let p = srv.createIcalProperty(k);
-        p.value = v;
-        comp.addProperty(p);
+    function addProp(name, value) {
+        let prop = srv.createIcalProperty(name);
+        prop.value = value;
+        comp.addProperty(prop);
     }
     function addActionDisplay() { addProp("ACTION", "DISPLAY"); }
     function addActionEmail() { addProp("ACTION", "EMAIL"); }
     function addTrigger() { addProp("TRIGGER", "-PT15M"); }
     function addDescr() { addProp("DESCRIPTION", "TEST"); }
     function addDuration() { addProp("DURATION", "-PT15M"); }
     function addRepeat() { addProp("REPEAT", "1"); }
     function addAttendee() { addProp("ATTENDEE", "mailto:horst"); }
--- a/calendar/test/unit/test_alarmservice.js
+++ b/calendar/test/unit/test_alarmservice.js
@@ -59,22 +59,22 @@ var alarmObserver = {
     expectResult: function(aCalendar, aItem, aAlarm, aExpected) {
         this.expectedMap[aCalendar.id] = this.expectedMap[aCalendar.id] || {};
         this.expectedMap[aCalendar.id][aItem.hashId] = this.expectedMap[aCalendar.id][aItem.hashId] || {};
         this.expectedMap[aCalendar.id][aItem.hashId][aAlarm.icalString] = aExpected;
     },
 
     expectOccurrences: function(aCalendar, aItem, aAlarm, aExpectedArray) {
         // we need to be earlier than the first occurrence
-        let dt = aItem.startDate.clone();
-        dt.second -= 1;
+        let date = aItem.startDate.clone();
+        date.second -= 1;
 
         for (let expected of aExpectedArray) {
-            let occ = aItem.recurrenceInfo.getNextOccurrence(dt);
-            dt = occ.startDate;
+            let occ = aItem.recurrenceInfo.getNextOccurrence(date);
+            date = occ.startDate;
             this.expectResult(aCalendar, occ, aAlarm, expected);
         }
     },
 
     checkExpected: function() {
         for (let calId in this.expectedMap) {
             for (let id in this.expectedMap[calId]) {
                 for (let icalString in this.expectedMap[calId][id]) {
@@ -168,117 +168,117 @@ function createEventWithAlarm(aCalendar,
     }
     return [item, alarm];
 }
 
 function addTestItems(aCalendar) {
     let item, alarm;
 
     // alarm on an item starting more than a month in the past should not fire
-    let dt = cal.now();
-    dt.day -= 32;
-    [item, alarm] = createEventWithAlarm(aCalendar, dt, dt, "P7D");
+    let date = cal.now();
+    date.day -= 32;
+    [item, alarm] = createEventWithAlarm(aCalendar, date, date, "P7D");
     alarmObserver.expectResult(aCalendar, item, alarm, EXPECT_NONE);
     aCalendar.addItem(item, null);
 
     // alarm 15 minutes ago should fire
-    dt = cal.now();
-    [item, alarm] = createEventWithAlarm(aCalendar, dt, dt, "-PT15M");
+    date = cal.now();
+    [item, alarm] = createEventWithAlarm(aCalendar, date, date, "-PT15M");
     alarmObserver.expectResult(aCalendar, item, alarm, EXPECT_FIRED);
     aCalendar.addItem(item, null);
 
     // alarm within 6 hours should have a timer set
-    [item, alarm] = createEventWithAlarm(aCalendar, dt, dt, "PT1H");
+    [item, alarm] = createEventWithAlarm(aCalendar, date, date, "PT1H");
     alarmObserver.expectResult(aCalendar, item, alarm, EXPECT_TIMER);
     aCalendar.addItem(item, null);
 
     // alarm more than 6 hours in the future should not have a timer set
-    [item, alarm] = createEventWithAlarm(aCalendar, dt, dt, "PT7H");
+    [item, alarm] = createEventWithAlarm(aCalendar, date, date, "PT7H");
     alarmObserver.expectResult(aCalendar, item, alarm, EXPECT_NONE);
     aCalendar.addItem(item, null);
 
     // test multiple alarms on an item
-    [item, alarm] = createEventWithAlarm(aCalendar, dt, dt);
+    [item, alarm] = createEventWithAlarm(aCalendar, date, date);
     [["-PT1H", EXPECT_FIRED], ["-PT15M", EXPECT_FIRED], ["PT1H", EXPECT_TIMER],
      ["PT7H", EXPECT_NONE], ["P7D", EXPECT_NONE]].forEach(([offset, expected]) => {
         alarm = createAlarmFromDuration(offset);
         item.addAlarm(alarm);
         alarmObserver.expectResult(aCalendar, item, alarm, expected);
     });
     aCalendar.addItem(item, null);
 
     // daily repeating event starting almost 2 full days ago. The alarms on the first 2 occurrences
     // should fire, and a timer should be set for the next occurrence only
-    dt = cal.now();
-    dt.hour -= 47;
-    [item, alarm] = createEventWithAlarm(aCalendar, dt, dt, "-PT15M", "RRULE:FREQ=DAILY");
+    date = cal.now();
+    date.hour -= 47;
+    [item, alarm] = createEventWithAlarm(aCalendar, date, date, "-PT15M", "RRULE:FREQ=DAILY");
     alarmObserver.expectOccurrences(aCalendar, item, alarm,
                                    [EXPECT_FIRED, EXPECT_FIRED, EXPECT_TIMER,
                                     EXPECT_NONE, EXPECT_NONE]);
     aCalendar.addItem(item, null);
 
     // monthly repeating event starting 2 months and a day ago. The alarms on the first 2 occurrences
     // should be ignored, the alarm on the next occurrence only should fire
-    dt = cal.now();
-    dt.month -= 2;
-    dt.day -= 1;
-    [item, alarm] = createEventWithAlarm(aCalendar, dt, dt, "-PT15M", "RRULE:FREQ=MONTHLY");
+    date = cal.now();
+    date.month -= 2;
+    date.day -= 1;
+    [item, alarm] = createEventWithAlarm(aCalendar, date, date, "-PT15M", "RRULE:FREQ=MONTHLY");
     alarmObserver.expectOccurrences(aCalendar, item, alarm,
                                    [EXPECT_NONE, EXPECT_NONE, EXPECT_FIRED,
                                     EXPECT_NONE, EXPECT_NONE]);
     aCalendar.addItem(item, null);
 }
 
 function doModifyItemTest(aCalendar) {
     let item, alarm;
 
     // begin with item starting before the alarm date range
-    let dt = cal.now();
-    dt.day -= 32;
-    [item, alarm] = createEventWithAlarm(aCalendar, dt, dt, "PT0S");
+    let date = cal.now();
+    date.day -= 32;
+    [item, alarm] = createEventWithAlarm(aCalendar, date, date, "PT0S");
     aCalendar.addItem(item, null);
     alarmObserver.expectResult(aCalendar, item, alarm, EXPECT_NONE);
     alarmObserver.checkExpected();
 
     // move event into the fired range
     let oldItem = item.clone();
-    dt.day += 31;
-    item.startDate = dt.clone();
+    date.day += 31;
+    item.startDate = date.clone();
     item.generation++;
     aCalendar.modifyItem(item, oldItem, null);
     alarmObserver.expectResult(aCalendar, item, alarm, EXPECT_FIRED);
     alarmObserver.checkExpected();
 
     // move event into the timer range
     oldItem = item.clone();
-    dt.hour += 25;
-    item.startDate = dt.clone();
+    date.hour += 25;
+    item.startDate = date.clone();
     item.generation++;
     aCalendar.modifyItem(item, oldItem, null);
     alarmObserver.expectResult(aCalendar, item, alarm, EXPECT_TIMER);
     alarmObserver.checkExpected();
 
     // move event past the timer range
     oldItem = item.clone();
-    dt.hour += 6;
-    item.startDate = dt.clone();
+    date.hour += 6;
+    item.startDate = date.clone();
     item.generation++;
     aCalendar.modifyItem(item, oldItem, null);
     alarmObserver.expectResult(aCalendar, item, alarm, EXPECT_NONE);
     alarmObserver.checkExpected();
 }
 
 function doDeleteItemTest(aCalendar) {
     let item, alarm;
     let item2, alarm2;
 
     // create a fired alarm and a timer
-    let dt = cal.now();
-    [item, alarm] = createEventWithAlarm(aCalendar, dt, dt, "-PT5M");
-    [item2, alarm2] = createEventWithAlarm(aCalendar, dt, dt, "PT1H");
+    let date = cal.now();
+    [item, alarm] = createEventWithAlarm(aCalendar, date, date, "-PT5M");
+    [item2, alarm2] = createEventWithAlarm(aCalendar, date, date, "PT1H");
     aCalendar.addItem(item, null);
     aCalendar.addItem(item2, null);
     alarmObserver.expectResult(aCalendar, item, alarm, EXPECT_FIRED);
     alarmObserver.expectResult(aCalendar, item2, alarm2, EXPECT_TIMER);
     alarmObserver.checkExpected();
 
     // item deletion should clear the fired alarm and timer
     aCalendar.deleteItem(item, null);
@@ -288,19 +288,19 @@ function doDeleteItemTest(aCalendar) {
     alarmObserver.checkExpected();
 }
 
 function doAcknowledgeTest(aCalendar) {
     let item, alarm;
     let item2, alarm2;
 
     // create the fired alarms
-    let dt = cal.now();
-    [item, alarm] = createEventWithAlarm(aCalendar, dt, dt, "-PT5M");
-    [item2, alarm2] = createEventWithAlarm(aCalendar, dt, dt, "-PT5M");
+    let date = cal.now();
+    [item, alarm] = createEventWithAlarm(aCalendar, date, date, "-PT5M");
+    [item2, alarm2] = createEventWithAlarm(aCalendar, date, date, "-PT5M");
     aCalendar.addItem(item, null);
     aCalendar.addItem(item2, null);
     alarmObserver.expectResult(aCalendar, item, alarm, EXPECT_FIRED);
     alarmObserver.expectResult(aCalendar, item2, alarm2, EXPECT_FIRED);
     alarmObserver.checkExpected();
 
     // test snooze alarm
     alarmObserver.service.snoozeAlarm(item, alarm, cal.createDuration("PT1H"));
--- a/calendar/test/unit/test_attendee.js
+++ b/calendar/test/unit/test_attendee.js
@@ -43,75 +43,75 @@ function test_values() {
                 a[properties[i]] = old + 1;
             }, /Can not modify immutable data container/);
 
             equal(a[properties[i]], old);
         }
     }
 
     // Create Attendee
-    let a1 = cal.createAttendee();
+    let attendee1 = cal.createAttendee();
     // Testing attendee set/get.
     let properties = ["id", "commonName", "rsvp", "role", "participationStatus",
                       "userType"];
     let values = ["myid", "mycn", "TRUE", "CHAIR", "DECLINED", "RESOURCE"];
     // Make sure test is valid
     equal(properties.length, values.length);
 
     for (let i = 0; i < properties.length; i++) {
-        a1[properties[i]] = values[i];
-        equal(a1[properties[i]], values[i]);
+        attendee1[properties[i]] = values[i];
+        equal(attendee1[properties[i]], values[i]);
     }
 
     // Create event
     let event = cal.createEvent();
 
     // Add attendee to event
-    event.addAttendee(a1);
+    event.addAttendee(attendee1);
 
     // Add 2nd attendee to event.
-    let a2 = cal.createAttendee();
-    a2.id = "myid2";
-    event.addAttendee(a2);
+    let attendee2 = cal.createAttendee();
+    attendee2.id = "myid2";
+    event.addAttendee(attendee2);
 
     // Finding by ID
-    findById(event, "myid", a1);
-    findById(event, "myid2", a2);
+    findById(event, "myid", attendee1);
+    findById(event, "myid2", attendee2);
 
-    findAttendeesInResults(event, [a1, a2]);
+    findAttendeesInResults(event, [attendee1, attendee2]);
 
     // Making attendee immutable
-    a1.makeImmutable();
-    testImmutability(a1, properties);
+    attendee1.makeImmutable();
+    testImmutability(attendee1, properties);
     // Testing cascaded immutability (event -> attendee)
     event.makeImmutable();
-    testImmutability(a2, properties);
+    testImmutability(attendee2, properties);
 
     // Testing cloning
-    let ec = event.clone();
-    let clonedatts = ec.getAttendees({});
+    let eventClone = event.clone();
+    let clonedatts = eventClone.getAttendees({});
     let atts = event.getAttendees({});
     equal(atts.length, clonedatts.length);
 
     for (let i = 0; i < clonedatts.length; i++) {
         // The attributes should not be equal
         notEqual(atts[i], clonedatts[i]);
         // But the ids should
         equal(atts[i].id, clonedatts[i].id);
     }
 
     // Make sure organizers are also cloned correctly
-    let a3 = cal.createAttendee();
-    a3.id = "horst";
-    a3.isOrganizer = true;
-    let a4 = a3.clone();
+    let attendee3 = cal.createAttendee();
+    attendee3.id = "horst";
+    attendee3.isOrganizer = true;
+    let attendee4 = attendee3.clone();
 
-    ok(a4.isOrganizer);
-    a3.isOrganizer = false;
-    ok(a4.isOrganizer);
+    ok(attendee4.isOrganizer);
+    attendee3.isOrganizer = false;
+    ok(attendee4.isOrganizer);
 }
 
 function test_serialize() {
     let a = cal.createAttendee();
 
     throws(() => {
         // eslint-disable-next-line no-unused-expressions
         a.icalProperty;
--- a/calendar/test/unit/test_bug1204255.js
+++ b/calendar/test/unit/test_bug1204255.js
@@ -8,65 +8,65 @@ function run_test() {
     // Test attendee duplicate handling for bug 1204255
     test_newAttendee();
     test_fromICS();
 }
 
 function test_newAttendee() {
     let data = [{
         input: [
-            { id: "user2@example.net", partstat: "NEEDS-ACTION", cn: "NOT PREFIXED" },
-            { id: "mailto:user2@example.net", partstat: "NEEDS-ACTION", cn: "PREFIXED" }
+            { id: "user2@example.net", partstat: "NEEDS-ACTION", cname: "NOT PREFIXED" },
+            { id: "mailto:user2@example.net", partstat: "NEEDS-ACTION", cname: "PREFIXED" }
         ],
-        expected: { id: "mailto:user2@example.net", partstat: "NEEDS-ACTION", cn: "PREFIXED" }
+        expected: { id: "mailto:user2@example.net", partstat: "NEEDS-ACTION", cname: "PREFIXED" }
     }, {
         input: [
-            { id: "mailto:user3@example.net", partstat: "NEEDS-ACTION", cn: "PREFIXED" },
-            { id: "user3@example.net", partstat: "NEEDS-ACTION", cn: "NOT PREFIXED" }
+            { id: "mailto:user3@example.net", partstat: "NEEDS-ACTION", cname: "PREFIXED" },
+            { id: "user3@example.net", partstat: "NEEDS-ACTION", cname: "NOT PREFIXED" }
         ],
-        expected: { id: "mailto:user3@example.net", partstat: "NEEDS-ACTION", cn: "NOT PREFIXED" }
+        expected: { id: "mailto:user3@example.net", partstat: "NEEDS-ACTION", cname: "NOT PREFIXED" }
     }, {
         input: [
-            { id: "mailto:user4@example.net", partstat: "ACCEPTED", cn: "PREFIXED" },
-            { id: "user4@example.net", partstat: "TENTATIVE", cn: "NOT PREFIXED" }
+            { id: "mailto:user4@example.net", partstat: "ACCEPTED", cname: "PREFIXED" },
+            { id: "user4@example.net", partstat: "TENTATIVE", cname: "NOT PREFIXED" }
         ],
-        expected: { id: "mailto:user4@example.net", partstat: "ACCEPTED", cn: "PREFIXED" }
+        expected: { id: "mailto:user4@example.net", partstat: "ACCEPTED", cname: "PREFIXED" }
     }, {
         input: [
-            { id: "user5@example.net", partstat: "TENTATIVE", cn: "NOT PREFIXED" },
-            { id: "mailto:user5@example.net", partstat: "ACCEPTED", cn: "PREFIXED" }
+            { id: "user5@example.net", partstat: "TENTATIVE", cname: "NOT PREFIXED" },
+            { id: "mailto:user5@example.net", partstat: "ACCEPTED", cname: "PREFIXED" }
         ],
-        expected: { id: "mailto:user5@example.net", partstat: "TENTATIVE", cn: "NOT PREFIXED" }
+        expected: { id: "mailto:user5@example.net", partstat: "TENTATIVE", cname: "NOT PREFIXED" }
     }, {
         input: [
-            { id: "user6@example.net", partstat: "DECLINED", cn: "NOT PREFIXED" },
-            { id: "mailto:user6@example.net", partstat: "TENTATIVE", cn: "PREFIXED" }
+            { id: "user6@example.net", partstat: "DECLINED", cname: "NOT PREFIXED" },
+            { id: "mailto:user6@example.net", partstat: "TENTATIVE", cname: "PREFIXED" }
         ],
-        expected: { id: "mailto:user6@example.net", partstat: "DECLINED", cn: "NOT PREFIXED" }
+        expected: { id: "mailto:user6@example.net", partstat: "DECLINED", cname: "NOT PREFIXED" }
     }, {
         input: [
-            { id: "user7@example.net", partstat: "TENTATIVE", cn: "NOT PREFIXED" },
-            { id: "mailto:user7@example.net", partstat: "DECLINED", cn: "PREFIXED" }
+            { id: "user7@example.net", partstat: "TENTATIVE", cname: "NOT PREFIXED" },
+            { id: "mailto:user7@example.net", partstat: "DECLINED", cname: "PREFIXED" }
         ],
-        expected: { id: "mailto:user7@example.net", partstat: "DECLINED", cn: "PREFIXED" }
+        expected: { id: "mailto:user7@example.net", partstat: "DECLINED", cname: "PREFIXED" }
     }];
 
     let event = cal.createEvent();
     for (let test of data) {
         for (let input of test.input) {
             let attendee = cal.createAttendee();
             attendee.id = input.id;
             attendee.participationStatus = input.partstat;
-            attendee.commonName = input.cn;
+            attendee.commonName = input.cname;
             event.addAttendee(attendee);
         }
         let readAttendee = event.getAttendeeById(cal.prependMailTo(test.expected.id));
         equal(readAttendee.id, test.expected.id);
         equal(readAttendee.participationStatus, test.expected.partstat, "partstat matches for " + test.expected.id);
-        equal(readAttendee.commonName, test.expected.cn, "cn matches for " + test.expected.id);
+        equal(readAttendee.commonName, test.expected.cname, "commonName matches for " + test.expected.id);
     }
 }
 
 function test_fromICS() {
     let ics = [
         "BEGIN:VCALENDAR",
         "PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN",
         "VERSION:2.0",
@@ -94,32 +94,32 @@ function test_fromICS() {
 
         'ATTENDEE;RSVP=TRUE;PARTSTAT=TENTATIVE;CN="NOT PREFIXED";ROLE=REQ-PARTICIPANT:user7@example.net',
         'ATTENDEE;RSVP=TRUE;PARTSTAT=DECLINED;CN="PREFIXED";ROLE=REQ-PARTICIPANT:mailto:user7@example.net',
         "END:VEVENT",
         "END:VCALENDAR"
     ].join("\n");
 
     let expected = [
-        { id: "mailto:user2@example.net", partstat: "NEEDS-ACTION", cn: "PREFIXED" },
-        { id: "mailto:user3@example.net", partstat: "NEEDS-ACTION", cn: "NOT PREFIXED" },
-        { id: "mailto:user4@example.net", partstat: "ACCEPTED", cn: "PREFIXED" },
-        { id: "mailto:user5@example.net", partstat: "TENTATIVE", cn: "NOT PREFIXED" },
-        { id: "mailto:user6@example.net", partstat: "DECLINED", cn: "NOT PREFIXED" },
-        { id: "mailto:user7@example.net", partstat: "DECLINED", cn: "PREFIXED" }
+        { id: "mailto:user2@example.net", partstat: "NEEDS-ACTION", cname: "PREFIXED" },
+        { id: "mailto:user3@example.net", partstat: "NEEDS-ACTION", cname: "NOT PREFIXED" },
+        { id: "mailto:user4@example.net", partstat: "ACCEPTED", cname: "PREFIXED" },
+        { id: "mailto:user5@example.net", partstat: "TENTATIVE", cname: "NOT PREFIXED" },
+        { id: "mailto:user6@example.net", partstat: "DECLINED", cname: "NOT PREFIXED" },
+        { id: "mailto:user7@example.net", partstat: "DECLINED", cname: "PREFIXED" }
     ];
     let event = createEventFromIcalString(ics);
     let attendees = event.getAttendees({});
 
     // check whether all attendees get returned as expected
     equal(attendees.length, expected.length);
     let count = 0;
     for (let attendee of attendees) {
         for (let exp of expected) {
             if (attendee.id == exp.id) {
                 equal(attendee.participationStatus, exp.partstat, "partstat matches for " + exp.id);
-                equal(attendee.commonName, exp.cn, "cn matches for " + exp.id);
+                equal(attendee.commonName, exp.cname, "commonName matches for " + exp.id);
                 count++;
             }
         }
     }
     equal(count, expected.length, "all attendees were processed");
 }
--- a/calendar/test/unit/test_bug1209399.js
+++ b/calendar/test/unit/test_bug1209399.js
@@ -7,56 +7,56 @@ Components.utils.import("resource://cale
 function run_test() {
     // Test handling for multiple double quotes leading/trailing to attendee CN for bug 1209399
     test_newAttendee();
     test_fromICS();
 }
 
 function test_newAttendee() {
     let data = [{
-        input: { cn: null, id: "mailto:user1@example.net" },
-        expected: { cn: null }
+        input: { cname: null, id: "mailto:user1@example.net" },
+        expected: { cname: null }
     }, {
-        input: { cn: "Test2", id: "mailto:user2@example.net" },
-        expected: { cn: "Test2" }
+        input: { cname: "Test2", id: "mailto:user2@example.net" },
+        expected: { cname: "Test2" }
     }, {
-        input: { cn: '"Test3"', id: "mailto:user3@example.net" },
-        expected: { cn: "Test3" }
+        input: { cname: '"Test3"', id: "mailto:user3@example.net" },
+        expected: { cname: "Test3" }
     }, {
-        input: { cn: '""Test4""', id: "mailto:user4@example.net" },
-        expected: { cn: "Test4" }
+        input: { cname: '""Test4""', id: "mailto:user4@example.net" },
+        expected: { cname: "Test4" }
     }, {
-        input: { cn: '""Test5"', id: "mailto:user5@example.net" },
-        expected: { cn: "Test5" }
+        input: { cname: '""Test5"', id: "mailto:user5@example.net" },
+        expected: { cname: "Test5" }
     }, {
-        input: { cn: '"Test6""', id: "mailto:user6@example.net" },
-        expected: { cn: "Test6" }
+        input: { cname: '"Test6""', id: "mailto:user6@example.net" },
+        expected: { cname: "Test6" }
     }, {
-        input: { cn: "", id: "mailto:user7@example.net" },
-        expected: { cn: "" }
+        input: { cname: "", id: "mailto:user7@example.net" },
+        expected: { cname: "" }
     }, {
-        input: { cn: '""', id: "mailto:user8@example.net" },
-        expected: { cn: null }
+        input: { cname: '""', id: "mailto:user8@example.net" },
+        expected: { cname: null }
     }, {
-        input: { cn: '""""', id: "mailto:user9@example.net" },
-        expected: { cn: null }
+        input: { cname: '""""', id: "mailto:user9@example.net" },
+        expected: { cname: null }
     }];
 
     let i = 0;
     let event = cal.createEvent();
     for (let test of data) {
         i++;
         let attendee = cal.createAttendee();
         attendee.id = test.input.id;
-        attendee.commonName = test.input.cn;
+        attendee.commonName = test.input.cname;
 
         event.addAttendee(attendee);
         let readAttendee = event.getAttendeeById(test.input.id);
-        equal(readAttendee.commonName, test.expected.cn,
-              "Test #" + i + " for cn matching of " + test.input.id);
+        equal(readAttendee.commonName, test.expected.cname,
+              "Test #" + i + " for commonName matching of " + test.input.id);
     }
 }
 
 function test_fromICS() {
     let ics = [
         "BEGIN:VCALENDAR",
         "PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN",
         "VERSION:2.0",
@@ -75,24 +75,24 @@ function test_fromICS() {
         'ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;CN="";ROLE=REQ-PARTICIPANT:mailto:user7@example.net',
         'ATTENDEE;RSVP=TRUE;PARTSTAT=NEEDS-ACTION;CN="""";ROLE=REQ-PARTICIPANT:mailto:user8@example.net',
 
         "END:VEVENT",
         "END:VCALENDAR"
     ].join("\n");
 
     let expected = [
-        { id: "mailto:user2@example.net", cn: "Test2" },
-        { id: "mailto:user3@example.net", cn: "Test3" },
-        { id: "mailto:user4@example.net", cn: "" },
-        { id: "mailto:user5@example.net", cn: "" },
-        { id: "mailto:user6@example.net", cn: null },
-        { id: "mailto:user7@example.net", cn: "" },
-        { id: "mailto:user8@example.net", cn: "" }
+        { id: "mailto:user2@example.net", cname: "Test2" },
+        { id: "mailto:user3@example.net", cname: "Test3" },
+        { id: "mailto:user4@example.net", cname: "" },
+        { id: "mailto:user5@example.net", cname: "" },
+        { id: "mailto:user6@example.net", cname: null },
+        { id: "mailto:user7@example.net", cname: "" },
+        { id: "mailto:user8@example.net", cname: "" }
     ];
     let event = createEventFromIcalString(ics);
 
     equal(event.getAttendees({}).length, expected.length, "Check test consistency");
     for (let exp of expected) {
         let attendee = event.getAttendeeById(exp.id);
-        equal(attendee.commonName, exp.cn, "Test for cn matching of " + exp.id);
+        equal(attendee.commonName, exp.cname, "Test for commonName matching of " + exp.id);
     }
 }
--- a/calendar/test/unit/test_bug759324.js
+++ b/calendar/test/unit/test_bug759324.js
@@ -22,46 +22,46 @@ function run_test() {
     let rid = cal.createDateTime("20120101T010101Z");
     let rec = item.recurrenceInfo.getOccurrenceFor(rid);
     rec.title = "changed";
     item.recurrenceInfo.modifyException(rec, true);
 
     do_test_pending();
     storage.addItem(item, { onOperationComplete: checkAddedItem });
 
-    function checkAddedItem(c, s, o, i, addedItem) {
+    function checkAddedItem(calendar, status, opType, id, addedItem) {
         let seq = addedItem.getProperty("SEQUENCE");
         let occ = addedItem.recurrenceInfo.getOccurrenceFor(rid);
 
         equal(seq, 3);
         equal(occ.getProperty("SEQUENCE"), seq);
 
         let changedItem = addedItem.clone();
         changedItem.setProperty("SEQUENCE", parseInt(seq, 10) + 1);
 
         storage.modifyItem(changedItem, addedItem, { onOperationComplete: checkModifiedItem });
     }
 
-    function checkModifiedItem(c, s, o, i, changedItem) {
+    function checkModifiedItem(calendar, status, opType, id, changedItem) {
         let seq = changedItem.getProperty("SEQUENCE");
         let occ = changedItem.recurrenceInfo.getOccurrenceFor(rid);
 
         equal(seq, 4);
         equal(occ.getProperty("SEQUENCE"), seq);
 
         // Now check with the pref off
         storage.deleteProperty("capabilities.propagate-sequence");
 
         let changedItem2 = changedItem.clone();
         changedItem2.setProperty("SEQUENCE", parseInt(seq, 10) + 1);
 
         storage.modifyItem(changedItem2, changedItem, { onOperationComplete: checkNormalItem });
     }
 
-    function checkNormalItem(c, s, o, i, changedItem) {
+    function checkNormalItem(calendar, status, opType, id, changedItem) {
         let seq = changedItem.getProperty("SEQUENCE");
         let occ = changedItem.recurrenceInfo.getOccurrenceFor(rid);
 
         equal(seq, 5);
         equal(occ.getProperty("SEQUENCE"), 4);
         completeTest();
     }
 
--- a/calendar/test/unit/test_calutils.js
+++ b/calendar/test/unit/test_calutils.js
@@ -12,97 +12,97 @@ function run_test() {
     resolveDelegation_test();
     validateRecipientList_test();
 }
 
 // tests for calUtils.jsm
 
 function getAttendeeEmail_test() {
     let data = [{
-        input: { id: "mailto:first.last@example.net", cn: "Last, First", email: null, useCn: true },
+        input: { id: "mailto:first.last@example.net", cname: "Last, First", email: null, useCn: true },
         expected: "\"Last, First\" <first.last@example.net>"
     }, {
-        input: { id: "mailto:first.last@example.net", cn: "Last; First", email: null, useCn: true },
+        input: { id: "mailto:first.last@example.net", cname: "Last; First", email: null, useCn: true },
         expected: "\"Last; First\" <first.last@example.net>"
     }, {
-        input: { id: "mailto:first.last@example.net", cn: "First Last", email: null, useCn: true },
+        input: { id: "mailto:first.last@example.net", cname: "First Last", email: null, useCn: true },
         expected: "First Last <first.last@example.net>"
     }, {
-        input: { id: "mailto:first.last@example.net", cn: "Last, First", email: null, useCn: false },
+        input: { id: "mailto:first.last@example.net", cname: "Last, First", email: null, useCn: false },
         expected: "first.last@example.net"
     }, {
-        input: { id: "mailto:first.last@example.net", cn: null, email: null, useCn: true },
+        input: { id: "mailto:first.last@example.net", cname: null, email: null, useCn: true },
         expected: "first.last@example.net"
     }, {
-        input: { id: "urn:uuid:first.last.example.net", cn: null, email: "first.last@example.net", useCn: false },
+        input: { id: "urn:uuid:first.last.example.net", cname: null, email: "first.last@example.net", useCn: false },
         expected: "first.last@example.net"
     }, {
-        input: { id: "urn:uuid:first.last.example.net", cn: null, email: "first.last@example.net", useCn: true },
+        input: { id: "urn:uuid:first.last.example.net", cname: null, email: "first.last@example.net", useCn: true },
         expected: "first.last@example.net"
     }, {
-        input: { id: "urn:uuid:first.last.example.net", cn: "First Last", email: "first.last@example.net", useCn: true },
+        input: { id: "urn:uuid:first.last.example.net", cname: "First Last", email: "first.last@example.net", useCn: true },
         expected: "First Last <first.last@example.net>"
     }, {
-        input: { id: "urn:uuid:first.last.example.net", cn: null, email: null, useCn: false },
+        input: { id: "urn:uuid:first.last.example.net", cname: null, email: null, useCn: false },
         expected: ""
     }];
     let i = 0;
     for (let test of data) {
         i++;
         let attendee = cal.createAttendee();
         attendee.id = test.input.id;
-        if (test.input.cn) {
-            attendee.commonName = test.input.cn;
+        if (test.input.cname) {
+            attendee.commonName = test.input.cname;
         }
         if (test.input.email) {
             attendee.setProperty("EMAIL", test.input.email);
         }
         equal(cal.getAttendeeEmail(attendee, test.input.useCn), test.expected, "(test #" + i + ")");
     }
 }
 
 function getRecipientList_test() {
     let data = [{
-        input: [{ id: "mailto:first@example.net", cn: null },
-                { id: "mailto:second@example.net", cn: null },
-                { id: "mailto:third@example.net", cn: null }],
+        input: [{ id: "mailto:first@example.net", cname: null },
+                { id: "mailto:second@example.net", cname: null },
+                { id: "mailto:third@example.net", cname: null }],
         expected: "first@example.net, second@example.net, third@example.net"
     }, {
-        input: [{ id: "mailto:first@example.net", cn: "first example" },
-                { id: "mailto:second@example.net", cn: "second example" },
-                { id: "mailto:third@example.net", cn: "third example" }],
+        input: [{ id: "mailto:first@example.net", cname: "first example" },
+                { id: "mailto:second@example.net", cname: "second example" },
+                { id: "mailto:third@example.net", cname: "third example" }],
         expected: "first example <first@example.net>, second example <second@example.net>, " +
                   "third example <third@example.net>"
     }, {
-        input: [{ id: "mailto:first@example.net", cn: "example, first" },
-                { id: "mailto:second@example.net", cn: "example, second" },
-                { id: "mailto:third@example.net", cn: "example, third" }],
+        input: [{ id: "mailto:first@example.net", cname: "example, first" },
+                { id: "mailto:second@example.net", cname: "example, second" },
+                { id: "mailto:third@example.net", cname: "example, third" }],
         expected: "\"example, first\" <first@example.net>, \"example, second\" <second@example.net>, " +
                   "\"example, third\" <third@example.net>"
     }, {
-        input: [{ id: "mailto:first@example.net", cn: null },
-                { id: "urn:uuid:second.example.net", cn: null },
-                { id: "mailto:third@example.net", cn: null }],
+        input: [{ id: "mailto:first@example.net", cname: null },
+                { id: "urn:uuid:second.example.net", cname: null },
+                { id: "mailto:third@example.net", cname: null }],
         expected: "first@example.net, third@example.net"
     }, {
-        input: [{ id: "mailto:first@example.net", cn: "first" },
-                { id: "urn:uuid:second.example.net", cn: "second" },
-                { id: "mailto:third@example.net", cn: "third" }],
+        input: [{ id: "mailto:first@example.net", cname: "first" },
+                { id: "urn:uuid:second.example.net", cname: "second" },
+                { id: "mailto:third@example.net", cname: "third" }],
         expected: "first <first@example.net>, third <third@example.net>"
     }];
 
     let i = 0;
     for (let test of data) {
         i++;
         let attendees = [];
         for (let att of test.input) {
             let attendee = cal.createAttendee();
             attendee.id = att.id;
-            if (att.cn) {
-                attendee.commonName = att.cn;
+            if (att.cname) {
+                attendee.commonName = att.cname;
             }
             attendees.push(attendee);
         }
         equal(cal.getRecipientList(attendees), test.expected, "(test #" + i + ")");
     }
 }
 
 function prependMailTo_test() {
--- a/calendar/test/unit/test_datetime.js
+++ b/calendar/test/unit/test_datetime.js
@@ -6,55 +6,55 @@ function run_test() {
     do_calendar_startup(really_run_test);
 }
 
 function really_run_test() {
     function getMozTimezone(tzid) {
         return cal.getTimezoneService().getTimezone(tzid);
     }
 
-    let cd = cal.createDateTime();
-    cd.resetTo(2005, 10, 13,
-               10, 0, 0,
-               getMozTimezone("/mozilla.org/20050126_1/America/Bogota"));
+    let date = cal.createDateTime();
+    date.resetTo(2005, 10, 13,
+                 10, 0, 0,
+                 getMozTimezone("/mozilla.org/20050126_1/America/Bogota"));
 
-    equal(cd.hour, 10);
-    equal(cd.icalString, "20051113T100000");
+    equal(date.hour, 10);
+    equal(date.icalString, "20051113T100000");
 
-    let cd_floating = cd.getInTimezone(cal.floating());
-    equal(cd_floating.hour, 10);
+    let date_floating = date.getInTimezone(cal.floating());
+    equal(date_floating.hour, 10);
 
 
-    let cd_utc = cd.getInTimezone(cal.UTC());
-    equal(cd_utc.hour, 15);
-    equal(cd_utc.icalString, "20051113T150000Z");
+    let date_utc = date.getInTimezone(cal.UTC());
+    equal(date_utc.hour, 15);
+    equal(date_utc.icalString, "20051113T150000Z");
 
-    cd.hour = 25;
-    equal(cd.hour, 1);
-    equal(cd.day, 14);
+    date.hour = 25;
+    equal(date.hour, 1);
+    equal(date.day, 14);
 
 
     // Test nativeTime on dates
     // setting .isDate to be true on a date should not change its nativeTime
     // bug 315954,
-    cd.hour = 0;
-    let cd_allday = cd.clone();
-    cd_allday.isDate = true;
-    equal(cd.nativeTime, cd_allday.nativeTime);
+    date.hour = 0;
+    let date_allday = date.clone();
+    date_allday.isDate = true;
+    equal(date.nativeTime, date_allday.nativeTime);
 
     // Daylight savings test
-    cd.resetTo(2006, 2, 26,
+    date.resetTo(2006, 2, 26,
                1, 0, 0,
                getMozTimezone("/mozilla.org/20050126_1/Europe/Amsterdam"));
 
-    equal(cd.weekday, 0);
-    equal(cd.timezoneOffset, 1 * 3600);
+    equal(date.weekday, 0);
+    equal(date.timezoneOffset, 1 * 3600);
 
-    cd.day += 1;
-    equal(cd.timezoneOffset, 2 * 3600);
+    date.day += 1;
+    equal(date.timezoneOffset, 2 * 3600);
 
     // Bug 398724 - Problems with floating all-day items
     let event = cal.createEvent("BEGIN:VEVENT\nUID:45674d53-229f-48c6-9f3b-f2b601e7ae4d\nSUMMARY:New Event\nDTSTART;VALUE=DATE:20071003\nDTEND;VALUE=DATE:20071004\nEND:VEVENT");
     ok(event.startDate.timezone.isFloating);
     ok(event.endDate.timezone.isFloating);
 
     // Bug 392853 - Same times, different timezones, but subtractDate says times are PT0S apart
     const zeroLength = cal.createDuration();
--- a/calendar/test/unit/test_freebusy_service.js
+++ b/calendar/test/unit/test_freebusy_service.js
@@ -109,17 +109,17 @@ function test_cancel() {
     _clearProviders();
 
     let provider = {
         QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIFreeBusyProvider, Components.interfaces.calIOperation]),
         getFreeBusyIntervals: function(aCalId, aStart, aEnd, aTypes, aListener) {
             Services.tm.currentThread.dispatch({
                 run: function() {
                     dump("Cancelling freebusy query...");
-                    op.cancel();
+                    operation.cancel();
                 }
             }, Components.interfaces.nsIEventTarget.DISPATCH_NORMAL);
 
             // No listener call, we emulate a long running search
             // Do return the operation though
             return this;
         },
 
@@ -140,21 +140,21 @@ function test_cancel() {
             ok(!provider.cancelCalled);
             do_test_finished();
         }
     };
 
     freebusy.addProvider(provider);
 
     do_test_pending();
-    let op = freebusy.getFreeBusyIntervals("email",
-                                           cal.createDateTime("20120101T010101"),
-                                           cal.createDateTime("20120102T010101"),
-                                           cIFI.BUSY_ALL,
-                                           listener);
+    let operation = freebusy.getFreeBusyIntervals("email",
+                                                  cal.createDateTime("20120101T010101"),
+                                                  cal.createDateTime("20120102T010101"),
+                                                  cIFI.BUSY_ALL,
+                                                  listener);
 }
 
 // The following functions are not in the interface description and probably
 // don't need to be. Make assumptions about the implementation instead.
 
 function _clearProviders() {
     freebusy.wrappedJSObject.mProviders = new calInterfaceBag(Components.interfaces.calIFreeBusyProvider);
 }
--- a/calendar/test/unit/test_gdata_provider.js
+++ b/calendar/test/unit/test_gdata_provider.js
@@ -90,19 +90,19 @@ function GDataServer(calendarId, tasksId
     this.resetRequest();
 
     let sessionMgr = getGoogleSessionManager();
     this.session = sessionMgr.getSessionById("xpcshell", true);
     this.session.oauth = {
         accessToken: "accessToken",
         refreshToken: "refreshToken",
         tokenExpires: Number.MAX_VALUE,
-        connect: function(succ, fail, ui, refresh) {
+        connect: function(success, failure, withUi, refresh) {
             this.accessToken = "accessToken";
-            succ();
+            success();
         }
     };
 }
 
 GDataServer.prototype = {
     items: null,
 
     get baseUri() { return "http://localhost:" + this.server.identity.primaryPort + "/"; },
@@ -198,20 +198,20 @@ GDataServer.prototype = {
         let calmgr = cal.getCalendarManager();
         let client = calmgr.createCalendar("gdata", Services.io.newURI(uri, null, null));
         let uclient = client.wrappedJSObject;
         client.name = "xpcshell";
 
         // Make sure we catch the last error message in case sync fails
         monkeyPatch(uclient, "replayChangesOn", (protofunc, aListener) => {
             protofunc({
-              onResult: function(op, detail) {
-                uclient._lastStatus = op.status;
+              onResult: function(operation, detail) {
+                uclient._lastStatus = operation.status;
                 uclient._lastMessage = detail;
-                aListener.onResult(op, detail);
+                aListener.onResult(operation, detail);
               }
            });
         });
 
         calmgr.registerCalendar(client);
         uclient.mThrottleLimits = {};
         MockConflictPrompt.register();
 
@@ -219,17 +219,17 @@ GDataServer.prototype = {
         return this.waitForLoad(cachedCalendar);
     },
 
     router: function(nextHandler, request, response) {
         try {
             let method = request.hasHeader("X-HTTP-Method-Override")
                          ? request.getHeader("X-HTTP-Method-Override")
                          : request.method;
-            let parameters = new Map(request.queryString.split("&").map(p => p.split("=", 2)));
+            let parameters = new Map(request.queryString.split("&").map(part => part.split("=", 2)));
 
             let body;
             try {
                 body = JSON.parse(NetUtil.readInputStreamToString(request.bodyInputStream,
                                   request.bodyInputStream.available()));
             } catch (e) {
                 // Don't bail if json parsing failed.
             }
@@ -471,22 +471,22 @@ function findKey(container, key, searchK
         }
     }
 
     let foundItem = foundIndex == -1 ? null : container[foundIndex];
     return [foundIndex, foundItem];
 }
 
 function generateID() {
-    let c = "abcdefghijklmnopqrstuvwxyz0123456789";
-    let s = "";
+    let chars = "abcdefghijklmnopqrstuvwxyz0123456789";
+    let str = "";
     for (let i = 26; i; i--) {
-      s += c[Math.floor(Math.random() * c.length)];
+      str += chars[Math.floor(Math.random() * chars.length)];
     }
-    return s;
+    return str;
 }
 
 function getAllMeta(calendar) {
     let keys = {}, values = {};
     calendar.getAllMetaData({}, keys, values);
     return new Map(keys.value.map((k, i) => [k, values.value[i]]));
 }
 
@@ -605,86 +605,86 @@ add_task(function* test_dateToJSON() {
 
         let parser = Components.classes["@mozilla.org/calendar/ics-parser;1"]
                                .createInstance(Components.interfaces.calIIcsParser);
         parser.parseString(ics);
         let items = parser.getItems({});
         return items[0].startDate;
     }
 
-    let dt;
+    let date;
 
     // no timezone
-    dt = _createDateTime(cal.floating());
-    deepEqual(dateToJSON(dt), { dateTime: "2015-01-30T12:00:00-00:00" });
+    date = _createDateTime(cal.floating());
+    deepEqual(dateToJSON(date), { dateTime: "2015-01-30T12:00:00-00:00" });
 
     // valid non-Olson tz name
-    dt = _createDateTime("Eastern Standard Time");
-    deepEqual(dateToJSON(dt), { dateTime: "2015-01-30T12:00:00", timeZone: "America/New_York" });
+    date = _createDateTime("Eastern Standard Time");
+    deepEqual(dateToJSON(date), { dateTime: "2015-01-30T12:00:00", timeZone: "America/New_York" });
 
     // valid continent/city Olson tz
-    dt = _createDateTime("America/New_York");
-    deepEqual(dateToJSON(dt), { dateTime: "2015-01-30T12:00:00", timeZone: "America/New_York" });
+    date = _createDateTime("America/New_York");
+    deepEqual(dateToJSON(date), { dateTime: "2015-01-30T12:00:00", timeZone: "America/New_York" });
 
     // valid continent/region/city Olson tz
-    dt = _createDateTime("America/Argentina/Buenos_Aires");
-    deepEqual(dateToJSON(dt), { dateTime: "2015-01-30T12:00:00", timeZone: "America/Argentina/Buenos_Aires" });
+    date = _createDateTime("America/Argentina/Buenos_Aires");
+    deepEqual(dateToJSON(date), { dateTime: "2015-01-30T12:00:00", timeZone: "America/Argentina/Buenos_Aires" });
 
     // ical.js and libical currently have slightly different timezone handling.
     if (Preferences.get("calendar.icaljs", false)) {
         // unknown but formal valid Olson tz. ical.js assumes floating
-        dt = _createDateTime("Unknown/Olson/Timezone");
-        deepEqual(dateToJSON(dt), { dateTime: "2015-01-30T12:00:00-00:00" });
+        date = _createDateTime("Unknown/Olson/Timezone");
+        deepEqual(dateToJSON(date), { dateTime: "2015-01-30T12:00:00-00:00" });
 
         // Etc with offset. ical.js doesn't understand third party zones and uses floating
-        dt = _createDateTime("ThirdPartyZone", 5);
-        deepEqual(dateToJSON(dt), { dateTime: "2015-01-30T12:00:00-00:00" });
+        date = _createDateTime("ThirdPartyZone", 5);
+        deepEqual(dateToJSON(date), { dateTime: "2015-01-30T12:00:00-00:00" });
 
         // Etc with zero offset. ical.js doesn't understand third party zones and uses floating
-        dt = _createDateTime("ThirdPartyZone", 0);
-        deepEqual(dateToJSON(dt), { dateTime: "2015-01-30T12:00:00-00:00" });
+        date = _createDateTime("ThirdPartyZone", 0);
+        deepEqual(dateToJSON(date), { dateTime: "2015-01-30T12:00:00-00:00" });
     } else {
         // This causes an assertion failure.
         if (!mozinfo.debug) {
             // unknown but formal valid Olson tz
-            dt = _createDateTime("Unknown/Olson/Timezone");
-            deepEqual(dateToJSON(dt), { dateTime: "2015-01-30T12:00:00", timeZone: "Unknown/Olson/Timezone" });
+            date = _createDateTime("Unknown/Olson/Timezone");
+            deepEqual(dateToJSON(date), { dateTime: "2015-01-30T12:00:00", timeZone: "Unknown/Olson/Timezone" });
         }
 
         // Etc with offset
-        dt = _createDateTime("ThirdPartyZone", 5);
-        deepEqual(dateToJSON(dt), { dateTime: "2015-01-30T12:00:00", timeZone: "Etc/GMT-5" });
+        date = _createDateTime("ThirdPartyZone", 5);
+        deepEqual(dateToJSON(date), { dateTime: "2015-01-30T12:00:00", timeZone: "Etc/GMT-5" });
 
         // Etc with zero offset
-        dt = _createDateTime("ThirdPartyZone", 0);
-        deepEqual(dateToJSON(dt), { dateTime: "2015-01-30T12:00:00Z", timeZone: "UTC" });
+        date = _createDateTime("ThirdPartyZone", 0);
+        deepEqual(dateToJSON(date), { dateTime: "2015-01-30T12:00:00Z", timeZone: "UTC" });
     }
 
     // This causes an assertion failure.
     if (!mozinfo.debug) {
         // invalid non-Olson tz
-        dt = _createDateTime("InvalidTimeZone");
-        notEqual(dateToJSON(dt), { dateTime: "2015-01-30T12:00:00", timeZone: "InvalidTimeZone" });
+        date = _createDateTime("InvalidTimeZone");
+        notEqual(dateToJSON(date), { dateTime: "2015-01-30T12:00:00", timeZone: "InvalidTimeZone" });
     }
 
     // Zone with 0 offset but not UTC
-    dt = _createDateTime("Europe/London");
-    deepEqual(dateToJSON(dt), { dateTime: "2015-01-30T12:00:00", timeZone: "Europe/London" });
+    date = _createDateTime("Europe/London");
+    deepEqual(dateToJSON(date), { dateTime: "2015-01-30T12:00:00", timeZone: "Europe/London" });
 
     // date only
-    dt.isDate = true;
-    deepEqual(dateToJSON(dt), { date: "2015-01-30" });
+    date.isDate = true;
+    deepEqual(dateToJSON(date), { date: "2015-01-30" });
 });
 
 add_task(function* test_JSONToDate() {
     function convert(aEntry, aTimezone="Europe/Berlin") {
         let tzs = cal.getTimezoneService();
         let calendarTz = tzs.getTimezone(aTimezone);
-        let dt = JSONToDate(aEntry, calendarTz);
-        return dt ? dt.icalString + " in " + dt.timezone.tzid : null;
+        let date = JSONToDate(aEntry, calendarTz);
+        return date ? date.icalString + " in " + date.timezone.tzid : null;
     }
 
     // A date, using the passed in default timezone
     equal(convert({ date: "2015-01-02" }), "20150102 in Europe/Berlin");
 
     // A date, with a timezone that has zero offset
     equal(convert({ date: "2015-01-02", timeZone: "Africa/Accra" }), "20150102 in Africa/Accra");
 
--- a/calendar/test/unit/test_hashedarray.js
+++ b/calendar/test/unit/test_hashedarray.js
@@ -47,23 +47,23 @@ function titleComptor(a, b) {
  * items array.
  *
  * @param har           The Hashed Array
  * @param testItems     The array of test items
  * @param itemAccessor  The accessor func to retrieve the items
  * @throws Exception    If the arrays are not the same.
  */
 function checkConsistancy(har, testItems, itemAccessor) {
-    itemAccessor = itemAccessor || function(o) { return o; };
+    itemAccessor = itemAccessor || function(item) { return item; };
     for (let idx in testItems) {
-        let ti = itemAccessor(testItems[idx]);
+        let testItem = itemAccessor(testItems[idx]);
         equal(itemAccessor(har.itemByIndex(idx)).title,
-                    ti.title);
-        equal(itemAccessor(har.itemById(ti.hashId)).title,
-                    ti.title);
+                    testItem.title);
+        equal(itemAccessor(har.itemById(testItem.hashId)).title,
+                    testItem.title);
         equal(har.indexOf(testItems[idx]), idx);
     }
 }
 
 /**
  * Man, this function is really hard to keep general enough, I'm almost tempted
  * to duplicate the code. It checks if the remove and modify operations work for
  * the given hashed array.
@@ -75,17 +75,17 @@ function checkConsistancy(har, testItems
  * @param itemAccessor      (optional) The function to access the item for an
  *                            array element.
  * @param itemCreator       (optional) Function to create a new item for the
  *                            array.
  */
 function testRemoveModify(har, testItems, postprocessFunc, itemAccessor, itemCreator) {
     postprocessFunc = postprocessFunc || function(a, b) { return [a, b]; };
     itemCreator = itemCreator || (title => hashedCreateItem(title));
-    itemAccessor = itemAccessor || function(o) { return o; };
+    itemAccessor = itemAccessor || function(item) { return item; };
 
     // Now, delete the second item and check again
     har.removeById(itemAccessor(testItems[1]).hashId);
     testItems.splice(1, 1);
     [har, testItems] = postprocessFunc(har, testItems);
 
     checkConsistancy(har, testItems, itemAccessor);
 
--- a/calendar/test/unit/test_ics_service.js
+++ b/calendar/test/unit/test_ics_service.js
@@ -167,24 +167,24 @@ function test_icalcomponent() {
     let alarm = svc.createIcalComponent("VALARM");
     event.addSubcomponent(alarm);
 
     // Check that the parent works and does not appear on cloned instances
     let alarm2 = alarm.clone();
     equal(alarm.parent.toString(), event.toString());
     equal(alarm2.parent, null);
 
-    function check_getset(k, v) {
-        dump("Checking " + k + " = " + v + "\n");
-        event[k] = v;
-        let vstring = v.icalString || v;
-        equal(event[k].icalString || event[k], vstring);
-        equal(event.serializeToICS().match(new RegExp(vstring, "g")).length, 1);
-        event[k] = v;
-        equal(event.serializeToICS().match(new RegExp(vstring, "g")).length, 1);
+    function check_getset(key, value) {
+        dump("Checking " + key + " = " + value + "\n");
+        event[key] = value;
+        let valuestring = value.icalString || value;
+        equal(event[key].icalString || event[key], valuestring);
+        equal(event.serializeToICS().match(new RegExp(valuestring, "g")).length, 1);
+        event[key] = value;
+        equal(event.serializeToICS().match(new RegExp(valuestring, "g")).length, 1);
     }
 
     let props = [
        ["uid", "123"],
        ["prodid", "//abc/123"],
        ["version", "2.0"],
        ["method", "REQUEST"],
        ["status", "TENTATIVE"],
@@ -233,56 +233,56 @@ function test_iterator() {
     let comp = svc.createIcalComponent("VEVENT");
     let propNames = ["X-ONE", "X-TWO"];
     for (let i = 0; i < propNames.length; i++) {
         let prop = svc.createIcalProperty(propNames[i]);
         prop.value = "" + (i + 1);
         comp.addProperty(prop);
     }
 
-    for (let p = comp.getFirstProperty("ANY");
-         p;
-         p = comp.getNextProperty("ANY")) {
-        equal(p.propertyName, propNames.shift());
-        equal(p.parent.toString(), comp.toString());
+    for (let prop = comp.getFirstProperty("ANY");
+         prop;
+         prop = comp.getNextProperty("ANY")) {
+        equal(prop.propertyName, propNames.shift());
+        equal(prop.parent.toString(), comp.toString());
     }
     propNames = ["X-ONE", "X-TWO"];
-    for (let p = comp.getNextProperty("ANY");
-         p;
-         p = comp.getNextProperty("ANY")) {
-        equal(p.propertyName, propNames.shift());
-        equal(p.parent.toString(), comp.toString());
+    for (let prop = comp.getNextProperty("ANY");
+         prop;
+         prop = comp.getNextProperty("ANY")) {
+        equal(prop.propertyName, propNames.shift());
+        equal(prop.parent.toString(), comp.toString());
     }
 
     // Property iterator with multiple values
     comp = svc.parseICS("BEGIN:VEVENT\r\n" +
                         "CATEGORIES:a,b,c\r\n" +
                         "END:VEVENT", null);
     let propValues = ["a", "b", "c"];
-    for (let p = comp.getFirstProperty("CATEGORIES");
-         p;
-         p = comp.getNextProperty("CATEGORIES")) {
-        equal(p.propertyName, "CATEGORIES");
-        equal(p.value, propValues.shift());
-        equal(p.parent.toString(), comp.toString());
+    for (let prop = comp.getFirstProperty("CATEGORIES");
+         prop;
+         prop = comp.getNextProperty("CATEGORIES")) {
+        equal(prop.propertyName, "CATEGORIES");
+        equal(prop.value, propValues.shift());
+        equal(prop.parent.toString(), comp.toString());
     }
 
     // Param iterator
-    let prop = svc.createIcalProperty("DTSTART");
+    let dtstart = svc.createIcalProperty("DTSTART");
     let params = ["X-ONE", "X-TWO"];
     for (let i = 0; i < params.length; i++) {
-        prop.setParameter(params[i], "" + (i + 1));
+        dtstart.setParameter(params[i], "" + (i + 1));
     }
 
-    for (let p = prop.getFirstParameterName();
-         p;
-         p = prop.getNextParameterName()) {
-        equal(p, params.shift());
+    for (let prop = dtstart.getFirstParameterName();
+         prop;
+         prop = dtstart.getNextParameterName()) {
+        equal(prop, params.shift());
     }
 
     // Now try again, but start with next. Should act like first
     params = ["X-ONE", "X-TWO"];
-    for (let p = prop.getNextParameterName();
-         p;
-         p = prop.getNextParameterName()) {
-        equal(p, params.shift());
+    for (let param = dtstart.getNextParameterName();
+         param;
+         param = dtstart.getNextParameterName()) {
+        equal(param, params.shift());
     }
 }
--- a/calendar/test/unit/test_items.js
+++ b/calendar/test/unit/test_items.js
@@ -37,55 +37,55 @@ function test_aclmanager() {
     let itemEntry = {
         QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calIItemACLEntry]),
         userCanModify: true,
         userCanRespond: false,
         userCanViewAll: true,
         userCanViewDateAndTime: false,
     };
 
-    let e = cal.createEvent();
-    e.id = "withentry";
-    e.calendar = mockCalendar;
+    let event = cal.createEvent();
+    event.id = "withentry";
+    event.calendar = mockCalendar;
 
-    equal(e.aclEntry.userCanModify, itemEntry.userCanModify);
-    equal(e.aclEntry.userCanRespond, itemEntry.userCanRespond);
-    equal(e.aclEntry.userCanViewAll, itemEntry.userCanViewAll);
-    equal(e.aclEntry.userCanViewDateAndTime, itemEntry.userCanViewDateAndTime);
+    equal(event.aclEntry.userCanModify, itemEntry.userCanModify);
+    equal(event.aclEntry.userCanRespond, itemEntry.userCanRespond);
+    equal(event.aclEntry.userCanViewAll, itemEntry.userCanViewAll);
+    equal(event.aclEntry.userCanViewDateAndTime, itemEntry.userCanViewDateAndTime);
 
-    let pe = cal.createEvent();
-    pe.id = "parententry";
-    pe.calendar = mockCalendar;
-    pe.parentItem = e;
+    let parentEntry = cal.createEvent();
+    parentEntry.id = "parententry";
+    parentEntry.calendar = mockCalendar;
+    parentEntry.parentItem = event;
 
-    equal(pe.aclEntry.userCanModify, itemEntry.userCanModify);
-    equal(pe.aclEntry.userCanRespond, itemEntry.userCanRespond);
-    equal(pe.aclEntry.userCanViewAll, itemEntry.userCanViewAll);
-    equal(pe.aclEntry.userCanViewDateAndTime, itemEntry.userCanViewDateAndTime);
+    equal(parentEntry.aclEntry.userCanModify, itemEntry.userCanModify);
+    equal(parentEntry.aclEntry.userCanRespond, itemEntry.userCanRespond);
+    equal(parentEntry.aclEntry.userCanViewAll, itemEntry.userCanViewAll);
+    equal(parentEntry.aclEntry.userCanViewDateAndTime, itemEntry.userCanViewDateAndTime);
 
-    e = cal.createEvent();
-    e.id = "noentry";
-    e.calendar = mockCalendar;
-    equal(e.aclEntry, null);
+    event = cal.createEvent();
+    event.id = "noentry";
+    event.calendar = mockCalendar;
+    equal(event.aclEntry, null);
 }
 
 function test_calendar() {
-    let e = cal.createEvent();
-    let pe = cal.createEvent();
+    let event = cal.createEvent();
+    let parentEntry = cal.createEvent();
 
     let mockCalendar = {
         QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICalendar]),
         id: "one"
     };
 
-    pe.calendar = mockCalendar;
-    e.parentItem = pe;
+    parentEntry.calendar = mockCalendar;
+    event.parentItem = parentEntry;
 
-    notEqual(e.calendar, null);
-    equal(e.calendar.id, "one");
+    notEqual(event.calendar, null);
+    equal(event.calendar.id, "one");
 }
 
 function test_attachment() {
     let e = cal.createEvent();
 
     let a = cal.createAttachment();
     a.rawData = "horst";
 
@@ -181,73 +181,73 @@ function test_alarm() {
     equal(e.getAlarms({}).length, 1);
     equal(e.getAlarms({})[0], alarm2);
 
     e.clearAlarms();
     equal(e.getAlarms({}).length, 0);
 }
 
 function test_immutable() {
-    let e = cal.createEvent();
+    let event = cal.createEvent();
 
-    let dt = cal.createDateTime();
-    dt.timezone = cal.getTimezoneService().getTimezone("Europe/Berlin");
-    e.alarmLastAck = dt;
+    let date = cal.createDateTime();
+    date.timezone = cal.getTimezoneService().getTimezone("Europe/Berlin");
+    event.alarmLastAck = date;
 
     let org = cal.createAttendee();
     org.id = "one";
-    e.organizer = org;
+    event.organizer = org;
 
     let alarm = cal.createAlarm();
     alarm.action = "DISPLAY";
     alarm.description = "foo";
     alarm.related = alarm.ALARM_RELATED_START;
     alarm.offset = cal.createDuration("PT1S");
-    e.addAlarm(alarm);
+    event.addAlarm(alarm);
 
-    e.setProperty("X-NAME", "X-VALUE");
-    e.setPropertyParameter("X-NAME", "X-PARAM", "X-PARAMVAL");
+    event.setProperty("X-NAME", "X-VALUE");
+    event.setPropertyParameter("X-NAME", "X-PARAM", "X-PARAMVAL");
 
-    e.setCategories(3, ["a", "b", "c"]);
+    event.setCategories(3, ["a", "b", "c"]);
 
-    equal(e.alarmLastAck.timezone.tzid, cal.UTC().tzid);
+    equal(event.alarmLastAck.timezone.tzid, cal.UTC().tzid);
 
-    e.makeImmutable();
+    event.makeImmutable();
 
     // call again, should not throw
-    e.makeImmutable();
+    event.makeImmutable();
 
-    ok(!e.alarmLastAck.isMutable);
+    ok(!event.alarmLastAck.isMutable);
     ok(!org.isMutable);
     ok(!alarm.isMutable);
 
     throws(() => {
-        e.alarmLastAck = cal.createDateTime();
+        event.alarmLastAck = cal.createDateTime();
     }, /Can not modify immutable data container/);
     throws(() => {
-        e.calendar = null;
+        event.calendar = null;
     }, /Can not modify immutable data container/);
     throws(() => {
-        e.parentItem = null;
+        event.parentItem = null;
     }, /Can not modify immutable data container/);
     throws(() => {
-        e.setCategories(3, ["d", "e", "f"]);
+        event.setCategories(3, ["d", "e", "f"]);
     }, /Can not modify immutable data container/);
 
-    let e2 = e.clone();
-    e2.organizer.id = "two";
+    let event2 = event.clone();
+    event2.organizer.id = "two";
 
     equal(org.id, "one");
-    equal(e2.organizer.id, "two");
+    equal(event2.organizer.id, "two");
 
-    equal(e2.getProperty("X-NAME"), "X-VALUE");
-    equal(e2.getPropertyParameter("X-NAME", "X-PARAM"), "X-PARAMVAL");
+    equal(event2.getProperty("X-NAME"), "X-VALUE");
+    equal(event2.getPropertyParameter("X-NAME", "X-PARAM"), "X-PARAMVAL");
 
-    e2.setPropertyParameter("X-NAME", "X-PARAM", null);
-    equal(e2.getPropertyParameter("X-NAME", "X-PARAM"), null);
+    event2.setPropertyParameter("X-NAME", "X-PARAM", null);
+    equal(event2.getPropertyParameter("X-NAME", "X-PARAM"), null);
 
     // TODO more clone checks
 }
 
 function test_lastack() {
     let e = cal.createEvent();
 
     e.alarmLastAck = cal.createDateTime("20120101T010101");
--- a/calendar/test/unit/test_ltninvitationutils.js
+++ b/calendar/test/unit/test_ltninvitationutils.js
@@ -697,50 +697,50 @@ add_task(function* encodeMimeHeader_test
         equal(ltn.invitation.encodeMimeHeader(test.input.header, test.input.isEmail), test.expected,
               "(test #" + i + ")");
     }
 });
 
 add_task(function* getRfc5322FormattedDate_test() {
     let data = {
         input: [{
-            dt: null,
-            dtz: "America/New_York"
+            date: null,
+            timezone: "America/New_York"
         }, {
-            dt: "Sat, 24 Jan 2015 09:24:49 +0100",
-            dtz: "America/New_York"
+            date: "Sat, 24 Jan 2015 09:24:49 +0100",
+            timezone: "America/New_York"
         }, {
-            dt: "Sat, 24 Jan 2015 09:24:49 GMT+0100",
-            dtz: "America/New_York"
+            date: "Sat, 24 Jan 2015 09:24:49 GMT+0100",
+            timezone: "America/New_York"
         }, {
-            dt: "Sat, 24 Jan 2015 09:24:49 GMT",
-            dtz: "America/New_York"
+            date: "Sat, 24 Jan 2015 09:24:49 GMT",
+            timezone: "America/New_York"
         }, {
-            dt: "Sat, 24 Jan 2015 09:24:49",
-            dtz: "America/New_York"
+            date: "Sat, 24 Jan 2015 09:24:49",
+            timezone: "America/New_York"
         }, {
-            dt: "Sat, 24 Jan 2015 09:24:49",
-            dtz: null
+            date: "Sat, 24 Jan 2015 09:24:49",
+            timezone: null
         }, {
-            dt: "Sat, 24 Jan 2015 09:24:49",
-            dtz: "UTC"
+            date: "Sat, 24 Jan 2015 09:24:49",
+            timezone: "UTC"
         }, {
-            dt: "Sat, 24 Jan 2015 09:24:49",
-            dtz: "floating"
+            date: "Sat, 24 Jan 2015 09:24:49",
+            timezone: "floating"
         }],
         expected: /^\w{3}, \d{2} \w{3} \d{4} \d{2}:\d{2}:\d{2} [+-]\d{4}$/
     };
 
     let i = 0;
-    let dtz = Preferences.get("calendar.timezone.local", null);
+    let timezone = Preferences.get("calendar.timezone.local", null);
     for (let test of data.input) {
         i++;
-        if (test.dtz) {
-            Preferences.set("calendar.timezone.local", test.dtz);
+        if (test.timezone) {
+            Preferences.set("calendar.timezone.local", test.timezone);
         } else {
             Preferences.reset("calendar.timezone.local");
         }
-        let dt = test.dt ? new Date(test.dt) : null;
-        let r = new RegExp(data.expected);
-        ok(r.test(ltn.invitation.getRfc5322FormattedDate(dt)), "(test #" + i + ")");
+        let date = test.date ? new Date(test.date) : null;
+        let re = new RegExp(data.expected);
+        ok(re.test(ltn.invitation.getRfc5322FormattedDate(date)), "(test #" + i + ")");
     }
-    Preferences.set("calendar.timezone.local", dtz);
+    Preferences.set("calendar.timezone.local", timezone);
 });
--- a/calendar/test/unit/test_recur.js
+++ b/calendar/test/unit/test_recur.js
@@ -34,18 +34,18 @@ function test_rules() {
         // Check number of items
         dump("Expected " + expected.length + " occurrences\n");
         dump("Got: " + recdates.map(x => x.toString()) + "\n");
         equal(recdates.length, expected.length);
         let fmt = cal.getDateFormatter();
 
         for (let i = 0; i < expected.length; i++) {
             // Check each date
-            let ed = cal.createDateTime(expected[i]);
-            dump("Expecting instance at " + ed + "(" + fmt.dayName(ed.weekday) + ")\n");
+            let expectedDate = cal.createDateTime(expected[i]);
+            dump("Expecting instance at " + expectedDate + "(" + fmt.dayName(expectedDate.weekday) + ")\n");
             dump("Recdate:");
             equal(recdates[i].icalString, expected[i]);
 
             // Make sure occurrences are correct
             dump("Occurrence:");
             equal(occurrences[i].startDate.icalString, expected[i]);
 
             if (ignoreNextOccCheck) {
@@ -511,17 +511,17 @@ function test_interface() {
     let rinfo = item.recurrenceInfo;
     ok(compareObjects(rinfo.item, item, Components.interfaces.calIEvent));
 
     // getRecurrenceItems
     let ritems = rinfo.getRecurrenceItems({});
     equal(ritems.length, 3);
 
     let checkritems = new Map(ritems.map(ritem => [ritem.icalProperty.propertyName, ritem.icalProperty]));
-    let rparts = new Map(checkritems.get("RRULE").value.split(";").map(v => v.split("=", 2)));
+    let rparts = new Map(checkritems.get("RRULE").value.split(";").map(value => value.split("=", 2)));
     equal(rparts.size, 3);
     equal(rparts.get("FREQ"), "WEEKLY");
     equal(rparts.get("COUNT"), "6");
     equal(rparts.get("BYDAY"), "TU,WE");
     equal(checkritems.get("EXDATE").value, "20020403T114500Z");
     equal(checkritems.get("RDATE").value, "20020401T114500Z");
 
     // setRecurrenceItems
--- a/calendar/test/unit/test_relation.js
+++ b/calendar/test/unit/test_relation.js
@@ -1,48 +1,48 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 function run_test() {
     // Create Relation
-    let r1 = cal.createRelation();
+    let relation1 = cal.createRelation();
 
     // Create Items
-    let e1 = cal.createEvent();
-    let e2 = cal.createEvent();
+    let event1 = cal.createEvent();
+    let event2 = cal.createEvent();
 
     // Testing relation set/get.
     let properties = {
         relType: "PARENT",
-        relId: e2.id
+        relId: event2.id
     };
 
     for (let [property, value] in Iterator(properties)) {
-        r1[property] = value;
-        equal(r1[property], value);
+        relation1[property] = value;
+        equal(relation1[property], value);
     }
 
     // Add relation to event
-    e1.addRelation(r1);
+    event1.addRelation(relation1);
 
     // Add 2nd relation to event.
-    let r2 = cal.createRelation();
-    r2.relId = "myid2";
-    e1.addRelation(r2);
+    let relation2 = cal.createRelation();
+    relation2.relId = "myid2";
+    event1.addRelation(relation2);
 
     // Check the item functions
-    checkRelations(e1, [r1, r2]);
+    checkRelations(event1, [relation1, relation2]);
 
     // modify the Relations
-    modifyRelations(e1, [r1, r2]);
+    modifyRelations(event1, [relation1, relation2]);
 
     // test icalproperty
     // eslint-disable-next-line no-unused-expressions
-    r2.icalProperty;
+    relation2.icalProperty;
 
     test_icalprop();
 }
 
 function checkRelations(event, expRel) {
     let countObj = {};
     let allRel = event.getRelations(countObj);
     equal(countObj.value, allRel.length);
--- a/calendar/test/unit/test_search_service.js
+++ b/calendar/test/unit/test_search_service.js
@@ -94,17 +94,17 @@ function test_cancel() {
     search.getProviders({}).forEach(search.removeProvider, search);
 
     let provider = {
         QueryInterface: XPCOMUtils.generateQI([Components.interfaces.calICalendarSearchProvider, Components.interfaces.calIOperation]),
         searchForCalendars: function(aStr, aHint, aMax, aListener) {
             Services.tm.currentThread.dispatch({
                 run: function() {
                     dump("Cancelling search...");
-                    op.cancel();
+                    operation.cancel();
                 }
             }, Components.interfaces.nsIEventTarget.DISPATCH_NORMAL);
 
             // No listener call, we emulate a long running search
             // Do return the operation though
             return this;
         },
 
@@ -125,10 +125,10 @@ function test_cancel() {
             ok(!provider.cancelCalled);
             do_test_finished();
         }
     };
 
     search.addProvider(provider);
 
     do_test_pending();
-    let op = search.searchForCalendars("str", HINT_EXACT_MATCH, 0, listener);
+    let operation = search.searchForCalendars("str", HINT_EXACT_MATCH, 0, listener);
 }
--- a/calendar/test/unit/test_storage.js
+++ b/calendar/test/unit/test_storage.js
@@ -18,28 +18,28 @@ function testAttachRoundtrip() {
                "RDATE:20120201T010101Z",
                "EXDATE:20120301T010101Z",
                "END:VEVENT"].join("\r\n");
 
     let storageItem = createEventFromIcalString(str);
 
     do_test_pending();
     storage.addItem(storageItem, {
-        onOperationComplete: function(c, s, o, i, addedItem) {
+        onOperationComplete: function(calendar, status, opType, id, addedItem) {
             do_execute_soon(() => {
                 // Make sure the cache is cleared, otherwise we'll get the cached item.
                 delete storage.wrappedJSObject.mItemCache[addedItem.id];
                 storage.getItem(addedItem.id, retrieveItem);
             });
         }
     });
 
     let retrieveItem = {
         found: false,
-        onGetResult: function(ca, st, ty, de, co, items) {
+        onGetResult: function(calendar, status, type, detail, count, items) {
             let item = items[0];
 
             // Check start date
             equal(item.startDate.compare(cal.createDateTime("20120101T010101Z")), 0);
 
             // Check attachment
             let attaches = item.getAttachments({});
             let attach = attaches[0];
--- a/calendar/test/unit/test_timezone.js
+++ b/calendar/test/unit/test_timezone.js
@@ -8,17 +8,17 @@ function run_test() {
         onResult: function() {
             really_run_test();
             do_test_finished();
         }
     });
 }
 
 function really_run_test() {
-    let f = cal.createEvent();
+    let event = cal.createEvent();
 
     let str =
          ["BEGIN:VCALENDAR",
           "PRODID:-//RDU Software//NONSGML HandCal//EN",
           "VERSION:2.0",
           "BEGIN:VTIMEZONE",
           "TZID:America/New_York",
           "BEGIN:STANDARD",
@@ -67,17 +67,17 @@ function really_run_test() {
           "TZOFFSETTO:-0400",
           "TZNAME:EDT",
           "END:DAYLIGHT",
           "END:VTIMEZONE",
           ""].join("\r\n");
 
     let tzs = cal.getTimezoneService();
 
-    f.icalString = str;
+    event.icalString = str;
 
-    let g = f.startDate;
-    let h = f.endDate;
+    let startDate = event.startDate;
+    let endDate = event.endDate;
 
-    g.timezone = tzs.getTimezone(g.timezone.tzid);
-    h.timezone = tzs.getTimezone(h.timezone.tzid);
-    notEqual(strTz, g.timezone.toString());
+    startDate.timezone = tzs.getTimezone(startDate.timezone.tzid);
+    endDate.timezone = tzs.getTimezone(endDate.timezone.tzid);
+    notEqual(strTz, startDate.timezone.toString());
 }
--- a/calendar/test/unit/test_timezone_definition.js
+++ b/calendar/test/unit/test_timezone_definition.js
@@ -19,40 +19,40 @@ function valid_tz_version(aVersionString
 add_task(function* version_test() {
     let tzs = cal.getTimezoneService();
     ok(valid_tz_version(tzs.version), "timezone version");
 });
 
 // check whether all tz definitions have all properties
 add_task(function* zone_test() {
     function resolveZone(aZoneId) {
-        let tz = tzs.getTimezone(aZoneId);
-        equal(aZoneId, tz.tzid, "Zone test " + aZoneId);
-        ok(tz.icalComponent.serializeToICS().startsWith("BEGIN:VTIMEZONE"),
+        let timezone = tzs.getTimezone(aZoneId);
+        equal(aZoneId, timezone.tzid, "Zone test " + aZoneId);
+        ok(timezone.icalComponent.serializeToICS().startsWith("BEGIN:VTIMEZONE"),
            "VTIMEZONE test " + aZoneId);
-        ok(tz.latitude && !!tz.latitude.match(/^[+-]\d{7}$/), "Latitude test " + aZoneId);
-        ok(tz.longitude && !!tz.longitude.match(/^[+-]\d{7}$/), "Longitude test " + aZoneId);
+        ok(timezone.latitude && !!timezone.latitude.match(/^[+-]\d{7}$/), "Latitude test " + aZoneId);
+        ok(timezone.longitude && !!timezone.longitude.match(/^[+-]\d{7}$/), "Longitude test " + aZoneId);
     }
 
     let tzs = cal.getTimezoneService();
     let zones = tzs.timezoneIds;
     let foundZone = false;
     while (zones.hasMore()) {
         foundZone = true;
         resolveZone(zones.getNext());
     }
 
     ok(foundZone, "There is at least one timezone");
 });
 
 // check whether all tz aliases resolve to a tz definition
 add_task(function* alias_test() {
     function resolveAlias(aAliasId) {
-        let tz = tzs.getTimezone(aAliasId);
-        let tzid = tz && tz.tzid ? tz.tzid : "";
+        let timezone = tzs.getTimezone(aAliasId);
+        let tzid = timezone && timezone.tzid ? timezone.tzid : "";
         notEqual(tzid, "", "Alias resolution " + aAliasId + " -> " + tzid);
     }
 
     let tzs = cal.getTimezoneService();
     let aliases = tzs.aliasIds;
     let foundAlias = false;
     while (aliases.hasMore()) {
         foundAlias = true;
--- a/calendar/test/unit/test_utils.js
+++ b/calendar/test/unit/test_utils.js
@@ -66,39 +66,40 @@ function test_attendeeMatchesAddresses()
 
     a = cal.createAttendee("ATTENDEE;EMAIL=\"horst\":urn:uuid:horst");
     ok(cal.attendeeMatchesAddresses(a, ["HORST", "peter"]));
     ok(!cal.attendeeMatchesAddresses(a, ["HORSTpeter", "peter"]));
     ok(!cal.attendeeMatchesAddresses(a, ["peter"]));
 }
 
 function test_getDefaultStartDate() {
-    function tt(n, t) {
-        now = cal.createDateTime(n);
-        return cal.getDefaultStartDate(t ? cal.createDateTime(t) : null);
+    function transform(nowString, refDateString) {
+        now = cal.createDateTime(nowString);
+        let refDate = refDateString ? cal.createDateTime(refDateString) : null;
+        return cal.getDefaultStartDate(refDate);
     }
 
     let oldNow = cal.now;
     let now = cal.createDateTime("20120101T000000");
     cal.now = function() {
         return now;
     };
 
     dump("TT: " + cal.createDateTime("20120101T000000") + "\n");
     dump("TT: " + cal.getDefaultStartDate(cal.createDateTime("20120101T000000")) + "\n");
 
-    equal(tt("20120101T000000").icalString, "20120101T010000");
-    equal(tt("20120101T015959").icalString, "20120101T020000");
-    equal(tt("20120101T230000").icalString, "20120101T230000");
-    equal(tt("20120101T235959").icalString, "20120101T230000");
+    equal(transform("20120101T000000").icalString, "20120101T010000");
+    equal(transform("20120101T015959").icalString, "20120101T020000");
+    equal(transform("20120101T230000").icalString, "20120101T230000");
+    equal(transform("20120101T235959").icalString, "20120101T230000");
 
-    equal(tt("20120101T000000", "20120202").icalString, "20120202T010000");
-    equal(tt("20120101T015959", "20120202").icalString, "20120202T020000");
-    equal(tt("20120101T230000", "20120202").icalString, "20120202T230000");
-    equal(tt("20120101T235959", "20120202").icalString, "20120202T230000");
+    equal(transform("20120101T000000", "20120202").icalString, "20120202T010000");
+    equal(transform("20120101T015959", "20120202").icalString, "20120202T020000");
+    equal(transform("20120101T230000", "20120202").icalString, "20120202T230000");
+    equal(transform("20120101T235959", "20120202").icalString, "20120202T230000");
 
     let event = cal.createEvent();
     now = cal.createDateTime("20120101T015959");
     cal.setDefaultStartEndHour(event, cal.createDateTime("20120202"));
     equal(event.startDate.icalString, "20120202T020000");
     equal(event.endDate.icalString, "20120202T030000");
 
     let todo = cal.createTodo();
@@ -166,22 +167,22 @@ function test_calOperationGroup() {
 
     equal(group.status, Components.interfaces.calIErrors.OPERATION_CANCELLED);
     ok(!group.isPending);
     ok(cancelCalled);
     ok(pendingOp2.cancelCalled);
 }
 
 function test_sameDay() {
-    let dt = cal.createDateTime;
+    let createDate = cal.createDateTime.bind(cal);
 
-    ok(cal.sameDay(dt("20120101"), dt("20120101T120000")));
-    ok(cal.sameDay(dt("20120101"), dt("20120101")));
-    ok(!cal.sameDay(dt("20120101"), dt("20120102")));
-    ok(!cal.sameDay(dt("20120101T120000"), dt("20120102T120000")));
+    ok(cal.sameDay(createDate("20120101"), createDate("20120101T120000")));
+    ok(cal.sameDay(createDate("20120101"), createDate("20120101")));
+    ok(!cal.sameDay(createDate("20120101"), createDate("20120102")));
+    ok(!cal.sameDay(createDate("20120101T120000"), createDate("20120102T120000")));
 }
 
 function test_binarySearch() {
     let arr = [2, 5, 7, 9, 20, 27, 34, 39, 41, 53, 62];
     equal(binarySearch(arr, 27), 5); // Center
     equal(binarySearch(arr, 2), 0); // Left most
     equal(binarySearch(arr, 62), 11); // Right most