Bug 1593921 - Use eslint-disable-next-line to disable complexity checks in DevTools r=pbro

Using next-line is less error prone for refactorings than wrapping methods with enable/disable blocks.

Differential Revision: https://phabricator.services.mozilla.com/D51782
This commit is contained in:
Julian Descottes
2019-11-05 14:29:04 +00:00
parent cd92f0ff8a
commit 03cdcd7b0a
44 changed files with 63 additions and 125 deletions

View File

@@ -101,7 +101,7 @@ function getUniqueIdentifiers(identifiers) {
return newIdentifiers; return newIdentifiers;
} }
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function extractSymbol(path: SimplePath, symbols, state) { function extractSymbol(path: SimplePath, symbols, state) {
if (isFunction(path)) { if (isFunction(path)) {
const name = getFunctionName(path.node, path.parent); const name = getFunctionName(path.node, path.parent);
@@ -263,8 +263,6 @@ function extractSymbol(path: SimplePath, symbols, state) {
} }
} }
/* eslint-enable complexity */
function extractSymbols(sourceId): SymbolDeclarations { function extractSymbols(sourceId): SymbolDeclarations {
const symbols = { const symbols = {
functions: [], functions: [],

View File

@@ -198,7 +198,7 @@ const reducers = {
* - when changes cancel each other out leaving the rule unchanged, the rule is removed * - when changes cancel each other out leaving the rule unchanged, the rule is removed
* from the store. Its parent rule is removed as well if it too ends up unchanged. * from the store. Its parent rule is removed as well if it too ends up unchanged.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
[TRACK_CHANGE](state, { change }) { [TRACK_CHANGE](state, { change }) {
const defaults = { const defaults = {
selector: null, selector: null,
@@ -363,7 +363,6 @@ const reducers = {
return state; return state;
}, },
/* eslint-enable complexity */
[RESET_CHANGES](state) { [RESET_CHANGES](state) {
return INITIAL_STATE; return INITIAL_STATE;

View File

@@ -383,7 +383,7 @@ CssComputedView.prototype = {
* - value {Object} Depends on the type of the node * - value {Object} Depends on the type of the node
* returns null if the node isn't anything we care about * returns null if the node isn't anything we care about
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
getNodeInfo: function(node) { getNodeInfo: function(node) {
if (!node) { if (!node) {
return null; return null;
@@ -500,7 +500,6 @@ CssComputedView.prototype = {
value, value,
}; };
}, },
/* eslint-enable complexity */
_createPropertyViews: function() { _createPropertyViews: function() {
if (this._createViewsPromise) { if (this._createViewsPromise) {

View File

@@ -287,7 +287,6 @@ class FontInspector {
// Round pixel values. // Round pixel values.
return Math.round(out); return Math.round(out);
} }
/* eslint-enable complexity */
/** /**
* Destruction function called when the inspector is destroyed. Removes event listeners * Destruction function called when the inspector is destroyed. Removes event listeners

View File

@@ -214,7 +214,7 @@ SelectorAutocompleter.prototype = {
* '#f' requires an Id suggestion, so the state is States.ID * '#f' requires an Id suggestion, so the state is States.ID
* 'div > .foo' requires class suggestion, so state is States.CLASS * 'div > .foo' requires class suggestion, so state is States.CLASS
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
get state() { get state() {
if (!this.searchBox || !this.searchBox.value) { if (!this.searchBox || !this.searchBox.value) {
return null; return null;
@@ -308,7 +308,6 @@ SelectorAutocompleter.prototype = {
} }
return this._state; return this._state;
}, },
/* eslint-enable complexity */
/** /**
* Removes event listeners and cleans up references. * Removes event listeners and cleans up references.

View File

@@ -455,7 +455,7 @@ CssRuleView.prototype = {
* - value {Object} Depends on the type of the node * - value {Object} Depends on the type of the node
* returns null of the node isn't anything we care about * returns null of the node isn't anything we care about
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
getNodeInfo: function(node) { getNodeInfo: function(node) {
if (!node) { if (!node) {
return null; return null;
@@ -581,7 +581,6 @@ CssRuleView.prototype = {
value, value,
}; };
}, },
/* eslint-enable complexity */
/** /**
* Retrieve the RuleEditor instance. * Retrieve the RuleEditor instance.
@@ -1303,7 +1302,7 @@ CssRuleView.prototype = {
/** /**
* Creates editor UI for each of the rules in _elementStyle. * Creates editor UI for each of the rules in _elementStyle.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
_createEditors: function() { _createEditors: function() {
// Run through the current list of rules, attaching // Run through the current list of rules, attaching
// their editors in order. Create editors if needed. // their editors in order. Create editors if needed.
@@ -1386,7 +1385,6 @@ CssRuleView.prototype = {
return promise.all(editorReadyPromises); return promise.all(editorReadyPromises);
}, },
/* eslint-enable complexity */
/** /**
* Highlight rules that matches the filter search value and returns a * Highlight rules that matches the filter search value and returns a

View File

@@ -444,7 +444,7 @@ TextPropertyEditor.prototype = {
/** /**
* Populate the span based on changes to the TextProperty. * Populate the span based on changes to the TextProperty.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
update: function() { update: function() {
if (this.ruleView.isDestroyed) { if (this.ruleView.isDestroyed) {
return; return;
@@ -711,7 +711,6 @@ TextPropertyEditor.prototype = {
} }
} }
}, },
/* eslint-enable complexity */
_onStartEditing: function() { _onStartEditing: function() {
this.element.classList.remove("ruleview-overridden"); this.element.classList.remove("ruleview-overridden");

View File

@@ -104,7 +104,7 @@ exports.getCustomTreeMapDisplays = function() {
* @param {snapshotState | diffingState} state * @param {snapshotState | diffingState} state
* @return {String} * @return {String}
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
exports.getStatusText = function(state) { exports.getStatusText = function(state) {
assert(state, "Must have a state"); assert(state, "Must have a state");
@@ -172,7 +172,6 @@ exports.getStatusText = function(state) {
return ""; return "";
} }
}; };
/* eslint-enable complexity */
/** /**
* Returns a string representing a readable form of the snapshot's state; * Returns a string representing a readable form of the snapshot's state;
@@ -181,7 +180,7 @@ exports.getStatusText = function(state) {
* @param {snapshotState | diffingState} state * @param {snapshotState | diffingState} state
* @return {String} * @return {String}
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
exports.getStatusTextFull = function(state) { exports.getStatusTextFull = function(state) {
assert(!!state, "Must have a state"); assert(!!state, "Must have a state");
@@ -249,7 +248,6 @@ exports.getStatusTextFull = function(state) {
return ""; return "";
} }
}; };
/* eslint-enable complexity */
/** /**
* Return true if the snapshot is in a diffable state, false otherwise. * Return true if the snapshot is in a diffable state, false otherwise.

View File

@@ -45,7 +45,7 @@ class RequestListContextMenu {
this.props = props; this.props = props;
} }
/* eslint-disable complexity */ // eslint-disable-next-line complexity
open(event, clickedRequest, requests, blockedUrls) { open(event, clickedRequest, requests, blockedUrls) {
const { const {
id, id,

View File

@@ -42,7 +42,7 @@ const gFrameData = new WeakMap();
* Parses the raw location of this function call to retrieve the actual * Parses the raw location of this function call to retrieve the actual
* function name, source url, host name, line and column. * function name, source url, host name, line and column.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function parseLocation(location, fallbackLine, fallbackColumn) { function parseLocation(location, fallbackLine, fallbackColumn) {
// Parse the `location` for the function name, source url, line, column etc. // Parse the `location` for the function name, source url, line, column etc.
@@ -198,7 +198,6 @@ function parseLocation(location, fallbackLine, fallbackColumn) {
return { functionName, fileName, host, port, url, line, column }; return { functionName, fileName, host, port, url, line, column };
} }
/* eslint-enable complexity */
/** /**
* Sets the properties of `isContent` and `category` on a frame. * Sets the properties of `isContent` and `category` on a frame.

View File

@@ -123,7 +123,7 @@ class Frame extends Component {
}; };
} }
/* eslint-disable complexity */ // eslint-disable-next-line complexity
render() { render() {
let frame, isSourceMapped; let frame, isSourceMapped;
const { const {
@@ -306,7 +306,6 @@ class Frame extends Component {
return dom.span(attributes, ...elements); return dom.span(attributes, ...elements);
} }
/* eslint-enable complexity */
} }
module.exports = Frame; module.exports = Frame;

View File

@@ -577,7 +577,7 @@ class Tree extends Component {
* *
* @param {Event} e * @param {Event} e
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
_onKeyDown(e) { _onKeyDown(e) {
if (this.props.focused == null) { if (this.props.focused == null) {
return; return;
@@ -653,7 +653,6 @@ class Tree extends Component {
break; break;
} }
} }
/* eslint-enable complexity */
get activeElement() { get activeElement() {
return this.refs.tree.ownerDocument.activeElement; return this.refs.tree.ownerDocument.activeElement;

View File

@@ -220,7 +220,7 @@ class SplitBox extends Component {
// Rendering // Rendering
/* eslint-disable complexity */ // eslint-disable-next-line complexity
render() { render() {
const { endPanelControl, splitterSize, vert } = this.state; const { endPanelControl, splitterSize, vert } = this.state;
const { const {
@@ -331,7 +331,6 @@ class SplitBox extends Component {
: null : null
); );
} }
/* eslint-enable complexity */
} }
module.exports = SplitBox; module.exports = SplitBox;

View File

@@ -298,7 +298,7 @@ define(function(require, exports, module) {
// Event Handlers // Event Handlers
/* eslint-disable complexity */ // eslint-disable-next-line complexity
onKeyDown(event) { onKeyDown(event) {
if (!SUPPORTED_KEYS.includes(event.key)) { if (!SUPPORTED_KEYS.includes(event.key)) {
return; return;
@@ -384,7 +384,6 @@ define(function(require, exports, module) {
this.treeRef.current.focus(); this.treeRef.current.focus();
event.preventDefault(); event.preventDefault();
} }
/* eslint-enable complexity */
onClickRow(nodePath, event) { onClickRow(nodePath, event) {
const onClickRow = this.props.onClickRow; const onClickRow = this.props.onClickRow;

View File

@@ -1160,7 +1160,7 @@ InplaceEditor.prototype = {
/** /**
* Handle the input field's keypress event. * Handle the input field's keypress event.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
_onKeyPress: function(event) { _onKeyPress: function(event) {
let prevent = false; let prevent = false;
@@ -1309,7 +1309,6 @@ InplaceEditor.prototype = {
event.preventDefault(); event.preventDefault();
} }
}, },
/* eslint-enable complexity */
_onContextMenu: function(event) { _onContextMenu: function(event) {
if (this.contextMenu) { if (this.contextMenu) {
@@ -1444,7 +1443,7 @@ InplaceEditor.prototype = {
// Since we are calling this method from a keypress event handler, the // Since we are calling this method from a keypress event handler, the
// |input.value| does not include currently typed character. Thus we perform // |input.value| does not include currently typed character. Thus we perform
// this method async. // this method async.
/* eslint-disable complexity */ // eslint-disable-next-line complexity
this._openPopupTimeout = this.doc.defaultView.setTimeout(() => { this._openPopupTimeout = this.doc.defaultView.setTimeout(() => {
if (this._preventSuggestions) { if (this._preventSuggestions) {
this._preventSuggestions = false; this._preventSuggestions = false;
@@ -1646,7 +1645,6 @@ InplaceEditor.prototype = {
this.emit("after-suggest"); this.emit("after-suggest");
this._doValidation(); this._doValidation();
}, 0); }, 0);
/* eslint-enable complexity */
}, },
/** /**

View File

@@ -326,7 +326,6 @@ OutputParser.prototype = {
return variableNode; return variableNode;
}, },
/* eslint-disable complexity */
/** /**
* The workhorse for @see _parse. This parses some CSS text, * The workhorse for @see _parse. This parses some CSS text,
* stopping at EOF; or optionally when an umatched close paren is * stopping at EOF; or optionally when an umatched close paren is
@@ -343,6 +342,7 @@ OutputParser.prototype = {
* @return {DocumentFragment} * @return {DocumentFragment}
* A document fragment. * A document fragment.
*/ */
// eslint-disable-next-line complexity
_doParse: function(text, options, tokenStream, stopAtCloseParen) { _doParse: function(text, options, tokenStream, stopAtCloseParen) {
let parenDepth = stopAtCloseParen ? 1 : 0; let parenDepth = stopAtCloseParen ? 1 : 0;
let outerMostFunctionTakesColor = false; let outerMostFunctionTakesColor = false;
@@ -594,7 +594,6 @@ OutputParser.prototype = {
return result; return result;
}, },
/* eslint-enable complexity */
/** /**
* Parse a string. * Parse a string.
@@ -775,7 +774,7 @@ OutputParser.prototype = {
* The node to which spans containing points are added. * The node to which spans containing points are added.
* @returns {Node} The container to which spans have been added. * @returns {Node} The container to which spans have been added.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
_addPolygonPointNodes: function(coords, container) { _addPolygonPointNodes: function(coords, container) {
const tokenStream = getCSSLexer(coords); const tokenStream = getCSSLexer(coords);
let token = tokenStream.nextToken(); let token = tokenStream.nextToken();
@@ -914,7 +913,6 @@ OutputParser.prototype = {
} }
return container; return container;
}, },
/* eslint-enable complexity */
/** /**
* Parse the given circle coordinates and populate the given container appropriately * Parse the given circle coordinates and populate the given container appropriately
@@ -926,7 +924,7 @@ OutputParser.prototype = {
* The node to which the definition is added. * The node to which the definition is added.
* @returns {Node} The container to which the definition has been added. * @returns {Node} The container to which the definition has been added.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
_addCirclePointNodes: function(coords, container) { _addCirclePointNodes: function(coords, container) {
const tokenStream = getCSSLexer(coords); const tokenStream = getCSSLexer(coords);
let token = tokenStream.nextToken(); let token = tokenStream.nextToken();
@@ -1076,7 +1074,6 @@ OutputParser.prototype = {
} }
return container; return container;
}, },
/* eslint-enable complexity */
/** /**
* Parse the given ellipse coordinates and populate the given container appropriately * Parse the given ellipse coordinates and populate the given container appropriately
@@ -1088,7 +1085,7 @@ OutputParser.prototype = {
* The node to which the definition is added. * The node to which the definition is added.
* @returns {Node} The container to which the definition has been added. * @returns {Node} The container to which the definition has been added.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
_addEllipsePointNodes: function(coords, container) { _addEllipsePointNodes: function(coords, container) {
const tokenStream = getCSSLexer(coords); const tokenStream = getCSSLexer(coords);
let token = tokenStream.nextToken(); let token = tokenStream.nextToken();
@@ -1248,7 +1245,6 @@ OutputParser.prototype = {
} }
return container; return container;
}, },
/* eslint-enable complexity */
/** /**
* Parse the given inset coordinates and populate the given container appropriately. * Parse the given inset coordinates and populate the given container appropriately.
@@ -1259,7 +1255,7 @@ OutputParser.prototype = {
* The node to which the definition is added. * The node to which the definition is added.
* @returns {Node} The container to which the definition has been added. * @returns {Node} The container to which the definition has been added.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
_addInsetPointNodes: function(coords, container) { _addInsetPointNodes: function(coords, container) {
const insetPoints = ["top", "right", "bottom", "left"]; const insetPoints = ["top", "right", "bottom", "left"];
const tokenStream = getCSSLexer(coords); const tokenStream = getCSSLexer(coords);
@@ -1394,7 +1390,6 @@ OutputParser.prototype = {
return container; return container;
}, },
/* eslint-enable complexity */
/** /**
* Append a angle value to the output * Append a angle value to the output

View File

@@ -256,7 +256,7 @@ function isContentScheme(location, i = 0) {
} }
} }
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function isChromeScheme(location, i = 0) { function isChromeScheme(location, i = 0) {
const firstChar = location.charCodeAt(i); const firstChar = location.charCodeAt(i);
@@ -308,7 +308,6 @@ function isChromeScheme(location, i = 0) {
return false; return false;
} }
} }
/* eslint-enable complexity */
function isWASM(location, i = 0) { function isWASM(location, i = 0) {
return ( return (

View File

@@ -4,7 +4,6 @@
"use strict"; "use strict";
/* eslint-disable complexity */
const { const {
cssTokenizer, cssTokenizer,
cssTokenizerWithLineColumn, cssTokenizerWithLineColumn,
@@ -166,6 +165,7 @@ CSSCompleter.prototype = {
* @returns CSS_STATE * @returns CSS_STATE
* One of CSS_STATE enum or null if the state cannot be resolved. * One of CSS_STATE enum or null if the state cannot be resolved.
*/ */
// eslint-disable-next-line complexity
resolveState: function(source, { line, ch }) { resolveState: function(source, { line, ch }) {
// Function to return the last element of an array // Function to return the last element of an array
const peek = arr => arr[arr.length - 1]; const peek = arr => arr[arr.length - 1];

View File

@@ -716,7 +716,7 @@ class Telemetry {
* The ID of the tool that has been opened. * The ID of the tool that has been opened.
* *
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function getChartsFromToolId(id) { function getChartsFromToolId(id) {
if (!id) { if (!id) {
return null; return null;
@@ -794,7 +794,6 @@ function getChartsFromToolId(id) {
countScalar: countScalar, countScalar: countScalar,
}; };
} }
/* eslint-enable complexity */
/** /**
* Displays the first caller and calling line outside of this file in the * Displays the first caller and calling line outside of this file in the

View File

@@ -812,7 +812,7 @@ VariablesView.prototype = {
/** /**
* Listener handling a key down event on the view. * Listener handling a key down event on the view.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
_onViewKeyDown: function(e) { _onViewKeyDown: function(e) {
const item = this.getFocusedItem(); const item = this.getFocusedItem();
@@ -919,7 +919,6 @@ VariablesView.prototype = {
item._onAddProperty(e); item._onAddProperty(e);
} }
}, },
/* eslint-enable complexity */
/** /**
* Sets the text displayed in this container when there are no available items. * Sets the text displayed in this container when there are no available items.
@@ -2963,7 +2962,7 @@ Variable.prototype = extend(Scope.prototype, {
* and specifies if it's a 'this', '<exception>', '<return>' or '__proto__' * and specifies if it's a 'this', '<exception>', '<return>' or '__proto__'
* reference. * reference.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
_setAttributes: function() { _setAttributes: function() {
const ownerView = this.ownerView; const ownerView = this.ownerView;
if (ownerView.preventDescriptorModifiers) { if (ownerView.preventDescriptorModifiers) {
@@ -3021,7 +3020,6 @@ Variable.prototype = extend(Scope.prototype, {
target.setAttribute("pseudo-item", ""); target.setAttribute("pseudo-item", "");
} }
}, },
/* eslint-enable complexity */
/** /**
* Adds the necessary event listeners for this variable. * Adds the necessary event listeners for this variable.

View File

@@ -278,7 +278,7 @@ class Message extends Component {
); );
} }
/* eslint-disable complexity */ // eslint-disable-next-line complexity
render() { render() {
if (this.state && this.state.error) { if (this.state && this.state.error) {
return this.renderErrorState(); return this.renderErrorState();
@@ -490,7 +490,6 @@ class Message extends Component {
attachment ? null : dom.br() attachment ? null : dom.br()
); );
} }
/* eslint-enable complexity */
} }
module.exports = Message; module.exports = Message;

View File

@@ -144,7 +144,7 @@ function cloneState(state) {
* @param {UiState} uiState: The ui state. * @param {UiState} uiState: The ui state.
* @returns {MessageState} a new messages state. * @returns {MessageState} a new messages state.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function addMessage(newMessage, state, filtersState, prefsState, uiState) { function addMessage(newMessage, state, filtersState, prefsState, uiState) {
const { messagesById, groupsById, currentGroup, repeatById } = state; const { messagesById, groupsById, currentGroup, repeatById } = state;
@@ -354,9 +354,8 @@ function addMessage(newMessage, state, filtersState, prefsState, uiState) {
return removeMessagesFromState(state, removedIds); return removeMessagesFromState(state, removedIds);
} }
/* eslint-enable complexity */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function messages( function messages(
state = MessageState(), state = MessageState(),
action, action,
@@ -692,7 +691,6 @@ function messages(
return state; return state;
} }
/* eslint-enable complexity */
function setVisibleMessages({ function setVisibleMessages({
messagesState, messagesState,
@@ -986,7 +984,7 @@ function getToplevelMessageCount(state) {
* - visible {Boolean}: true if the message should be visible * - visible {Boolean}: true if the message should be visible
* - cause {String}: if visible is false, what causes the message to be hidden. * - cause {String}: if visible is false, what causes the message to be hidden.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function getMessageVisibility( function getMessageVisibility(
message, message,
{ {
@@ -1177,7 +1175,6 @@ function getMessageVisibility(
visible: true, visible: true,
}; };
} }
/* eslint-enable complexity */
function isUnfilterable(message) { function isUnfilterable(message) {
return [ return [

View File

@@ -14,7 +14,7 @@ const {
const cachedPackets = {}; const cachedPackets = {};
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function getCleanedPacket(key, packet) { function getCleanedPacket(key, packet) {
if (Object.keys(cachedPackets).includes(key)) { if (Object.keys(cachedPackets).includes(key)) {
return cachedPackets[key]; return cachedPackets[key];
@@ -279,7 +279,6 @@ function getCleanedPacket(key, packet) {
cachedPackets[key] = res; cachedPackets[key] = res;
return res; return res;
} }
/* eslint-enable complexity */
function formatPacket(key, packet) { function formatPacket(key, packet) {
const stringifiedPacket = JSON.stringify( const stringifiedPacket = JSON.stringify(

View File

@@ -116,7 +116,7 @@ function transformPacket(packet) {
} }
} }
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function transformConsoleAPICallPacket(packet) { function transformConsoleAPICallPacket(packet) {
const { message } = packet; const { message } = packet;
@@ -265,7 +265,6 @@ function transformConsoleAPICallPacket(packet) {
chromeContext: message.chromeContext, chromeContext: message.chromeContext,
}); });
} }
/* eslint-enable complexity */
function transformNavigationMessagePacket(packet) { function transformNavigationMessagePacket(packet) {
const { url } = packet; const { url } = packet;

View File

@@ -614,7 +614,7 @@ const AccessibleWalkerActor = ActorClassWithSpec(accessibleWalkerSpec, {
* @param {Ci.nsIAccessibleEvent} subject * @param {Ci.nsIAccessibleEvent} subject
* accessible event object. * accessible event object.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
observe(subject) { observe(subject) {
const event = subject.QueryInterface(Ci.nsIAccessibleEvent); const event = subject.QueryInterface(Ci.nsIAccessibleEvent);
const rawAccessible = event.accessible; const rawAccessible = event.accessible;
@@ -734,7 +734,6 @@ const AccessibleWalkerActor = ActorClassWithSpec(accessibleWalkerSpec, {
break; break;
} }
}, },
/* eslint-enable complexity */
/** /**
* Ensure that nothing interferes with the audit for an accessible object * Ensure that nothing interferes with the audit for an accessible object

View File

@@ -500,7 +500,7 @@ var WebExtensionInspectedWindowActor = protocol.ActorClassWithSpec(
* it is called over the remote debugging protocol the target window is always * it is called over the remote debugging protocol the target window is always
* `targetActor.window`. * `targetActor.window`.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
eval(callerInfo, expression, options, customTargetWindow) { eval(callerInfo, expression, options, customTargetWindow) {
const window = customTargetWindow || this.window; const window = customTargetWindow || this.window;
options = options || {}; options = options || {};
@@ -689,7 +689,6 @@ var WebExtensionInspectedWindowActor = protocol.ActorClassWithSpec(
return { value: evalResult }; return { value: evalResult };
}, },
/* eslint-enable complexity */
} }
); );

View File

@@ -172,7 +172,7 @@ BreakpointActor.prototype = {
* @param frame Debugger.Frame * @param frame Debugger.Frame
* The stack frame that contained the breakpoint. * The stack frame that contained the breakpoint.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
hit: function(frame) { hit: function(frame) {
// Don't pause if we are currently stepping (in or over) or the frame is // Don't pause if we are currently stepping (in or over) or the frame is
// black-boxed. // black-boxed.
@@ -234,7 +234,6 @@ BreakpointActor.prototype = {
return this.threadActor._pauseAndRespond(frame, reason); return this.threadActor._pauseAndRespond(frame, reason);
}, },
/* eslint-enable complexity */
delete: function() { delete: function() {
// Remove from the breakpoint store. // Remove from the breakpoint store.

View File

@@ -92,7 +92,7 @@ TouchSimulator.prototype = {
this._isPicking = state; this._isPicking = state;
}, },
/* eslint-disable complexity */ // eslint-disable-next-line complexity
handleEvent(evt) { handleEvent(evt) {
// Bail out if devtools is in pick mode in the same tab. // Bail out if devtools is in pick mode in the same tab.
if (this._isPicking) { if (this._isPicking) {
@@ -282,7 +282,6 @@ TouchSimulator.prototype = {
evt.stopImmediatePropagation(); evt.stopImmediatePropagation();
} }
}, },
/* eslint-enable complexity */
fireMouseEvent(type, evt) { fireMouseEvent(type, evt) {
const content = this.getContent(evt.target); const content = this.getContent(evt.target);

View File

@@ -1273,7 +1273,7 @@ class CssGridHighlighter extends AutoRefreshHighlighter {
* @param {Boolean||undefined} isStackedLine * @param {Boolean||undefined} isStackedLine
* Boolean indicating if the line is stacked. * Boolean indicating if the line is stacked.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
renderGridLineNumber( renderGridLineNumber(
lineNumber, lineNumber,
linePos, linePos,
@@ -1489,7 +1489,6 @@ class CssGridHighlighter extends AutoRefreshHighlighter {
this.ctx.fillText(numberText, x, y); this.ctx.fillText(numberText, x, y);
this.ctx.restore(); this.ctx.restore();
} }
/* eslint-enable complexity */
/** /**
* Determine which edge of a line number box to aim the line number arrow at. * Determine which edge of a line number box to aim the line number arrow at.

View File

@@ -630,7 +630,7 @@ class FlexboxHighlighter extends AutoRefreshHighlighter {
/** /**
* Clear the whole alignment container along the main axis for each flex item. * Clear the whole alignment container along the main axis for each flex item.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
renderJustifyContent() { renderJustifyContent() {
if ( if (
!this.flexData || !this.flexData ||
@@ -755,7 +755,6 @@ class FlexboxHighlighter extends AutoRefreshHighlighter {
this.ctx.restore(); this.ctx.restore();
} }
/* eslint-enable complexity */
/** /**
* Set up the canvas with the given options prior to drawing. * Set up the canvas with the given options prior to drawing.
@@ -965,7 +964,7 @@ function getRectFromFlexItemValues(item, container) {
* The new Flex data object. * The new Flex data object.
* @return {Boolean} true if the flex data has changed and false otherwise. * @return {Boolean} true if the flex data has changed and false otherwise.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function compareFlexData(oldFlexData, newFlexData) { function compareFlexData(oldFlexData, newFlexData) {
if (!oldFlexData || !newFlexData) { if (!oldFlexData || !newFlexData) {
return true; return true;
@@ -1032,6 +1031,5 @@ function compareFlexData(oldFlexData, newFlexData) {
return false; return false;
} }
/* eslint-enable complexity */
exports.FlexboxHighlighter = FlexboxHighlighter; exports.FlexboxHighlighter = FlexboxHighlighter;

View File

@@ -515,7 +515,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
this.viewport = { left, right, top, bottom, padding }; this.viewport = { left, right, top, bottom, padding };
} }
/* eslint-disable complexity */ // eslint-disable-next-line complexity
handleEvent(event, id) { handleEvent(event, id) {
// No event handling if the highlighter is hidden // No event handling if the highlighter is hidden
if (this.areShapesHidden()) { if (this.areShapesHidden()) {
@@ -621,7 +621,6 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
break; break;
} }
} }
/* eslint-enable complexity */
/** /**
* Handle a mouse click in transform mode. * Handle a mouse click in transform mode.
@@ -1981,7 +1980,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
* @returns {String} "top", "left", "right", or "bottom" if any of those edges were * @returns {String} "top", "left", "right", or "bottom" if any of those edges were
* clicked. "" if none were clicked. * clicked. "" if none were clicked.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
getInsetPointAt(pageX, pageY) { getInsetPointAt(pageX, pageY) {
const { top, left, right, bottom } = this.coordinates; const { top, left, right, bottom } = this.coordinates;
const zoom = getCurrentZoom(this.win); const zoom = getCurrentZoom(this.win);
@@ -2049,7 +2048,6 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
return ""; return "";
} }
/* eslint-enable complexity */
/** /**
* Parses the CSS definition given and returns the shape type associated * Parses the CSS definition given and returns the shape type associated

View File

@@ -409,7 +409,7 @@ class DOMEventCollector extends MainEventCollector {
* Get or detect jQuery events. * Get or detect jQuery events.
*/ */
class JQueryEventCollector extends MainEventCollector { class JQueryEventCollector extends MainEventCollector {
/* eslint-disable complexity */ // eslint-disable-next-line complexity
getListeners(node, { checkOnly } = {}) { getListeners(node, { checkOnly } = {}) {
const jQuery = this.getJQuery(node); const jQuery = this.getJQuery(node);
const handlers = []; const handlers = [];
@@ -501,14 +501,13 @@ class JQueryEventCollector extends MainEventCollector {
} }
return handlers; return handlers;
} }
/* eslint-enable complexity */
} }
/** /**
* Get or detect jQuery live events. * Get or detect jQuery live events.
*/ */
class JQueryLiveEventCollector extends MainEventCollector { class JQueryLiveEventCollector extends MainEventCollector {
/* eslint-disable complexity */ // eslint-disable-next-line complexity
getListeners(node, { checkOnly } = {}) { getListeners(node, { checkOnly } = {}) {
const jQuery = this.getJQuery(node); const jQuery = this.getJQuery(node);
const handlers = []; const handlers = [];
@@ -601,7 +600,6 @@ class JQueryLiveEventCollector extends MainEventCollector {
} }
return handlers; return handlers;
} }
/* eslint-enable complexity */
normalizeListener(handlerDO) { normalizeListener(handlerDO) {
function isFunctionInProxy(funcDO) { function isFunctionInProxy(funcDO) {
@@ -903,7 +901,7 @@ class EventCollector {
* native: false * native: false
* } * }
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
processHandlerForEvent(listenerArray, listener, dbg) { processHandlerForEvent(listenerArray, listener, dbg) {
let globalDO; let globalDO;
@@ -1067,7 +1065,6 @@ class EventCollector {
} }
} }
} }
/* eslint-enable complexity */
} }
exports.EventCollector = EventCollector; exports.EventCollector = EventCollector;

View File

@@ -919,7 +919,7 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
* hasLast: true if the last child of the node is included in the list. * hasLast: true if the last child of the node is included in the list.
* nodes: Array of DOMNodes. * nodes: Array of DOMNodes.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
_getChildren: function(node, options = {}) { _getChildren: function(node, options = {}) {
if (isNodeDead(node)) { if (isNodeDead(node)) {
return { hasFirst: true, hasLast: true, nodes: [] }; return { hasFirst: true, hasLast: true, nodes: [] };
@@ -1109,7 +1109,6 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
return { hasFirst, hasLast, nodes }; return { hasFirst, hasLast, nodes };
}, },
/* eslint-enable complexity */
getNativeAnonymousChildren: function(rawNode) { getNativeAnonymousChildren: function(rawNode) {
// Get an anonymous walker and start on the first child. // Get an anonymous walker and start on the first child.
@@ -1302,7 +1301,7 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
* @param string selectorState * @param string selectorState
* One of "pseudo", "id", "tag", "class", "null" * One of "pseudo", "id", "tag", "class", "null"
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
getSuggestionsForQuery: function(query, completing, selectorState) { getSuggestionsForQuery: function(query, completing, selectorState) {
const sugs = { const sugs = {
classes: new Map(), classes: new Map(),
@@ -1444,7 +1443,6 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
suggestions: result, suggestions: result,
}; };
}, },
/* eslint-enable complexity */
/** /**
* Add a pseudo-class lock to a node. * Add a pseudo-class lock to a node.

View File

@@ -1029,7 +1029,7 @@ NetworkObserver.prototype = {
* - total - the total time for all of the request and response. * - total - the total time for all of the request and response.
* - timings - the HAR timings object. * - timings - the HAR timings object.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
_setupHarTimings: function(httpActivity, fromCache) { _setupHarTimings: function(httpActivity, fromCache) {
if (fromCache) { if (fromCache) {
// If it came from the browser cache, we have no timing // If it came from the browser cache, we have no timing
@@ -1270,7 +1270,6 @@ NetworkObserver.prototype = {
offsets: ot.offsets, offsets: ot.offsets,
}; };
}, },
/* eslint-enable complexity */
_extractServerTimings: function(channel) { _extractServerTimings: function(channel) {
if (!channel || !channel.serverTiming) { if (!channel || !channel.serverTiming) {

View File

@@ -495,7 +495,7 @@ const proto = {
* An object that maps property names to safe getter descriptors as * An object that maps property names to safe getter descriptors as
* defined by the remote debugging protocol. * defined by the remote debugging protocol.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
_findSafeGetterValues: function(ownProperties, limit = 0) { _findSafeGetterValues: function(ownProperties, limit = 0) {
const safeGetterValues = Object.create(null); const safeGetterValues = Object.create(null);
let obj = this.obj; let obj = this.obj;
@@ -599,7 +599,6 @@ const proto = {
return safeGetterValues; return safeGetterValues;
}, },
/* eslint-enable complexity */
/** /**
* Find the safe getters for a given Debugger.Object. Safe getters are native * Find the safe getters for a given Debugger.Object. Safe getters are native

View File

@@ -425,7 +425,7 @@ function wrappedPrimitivePreviewer(
return true; return true;
} }
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function GenericObject( function GenericObject(
objectActor, objectActor,
grip, grip,
@@ -529,7 +529,6 @@ function GenericObject(
return true; return true;
} }
/* eslint-enable complexity */
// Preview functions that do not rely on the object class. // Preview functions that do not rely on the object class.
previewers.Object = [ previewers.Object = [
@@ -771,7 +770,7 @@ previewers.Object = [
return true; return true;
}, },
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function DOMEvent({ obj, hooks }, grip, rawObj) { function DOMEvent({ obj, hooks }, grip, rawObj) {
if (isWorker || !rawObj || !Event.isInstance(rawObj)) { if (isWorker || !rawObj || !Event.isInstance(rawObj)) {
return false; return false;
@@ -864,7 +863,6 @@ previewers.Object = [
return true; return true;
}, },
/* eslint-enable complexity */
function DOMException({ obj, hooks }, grip, rawObj) { function DOMException({ obj, hooks }, grip, rawObj) {
if (isWorker || !rawObj || obj.class !== "DOMException") { if (isWorker || !rawObj || obj.class !== "DOMException") {

View File

@@ -900,7 +900,7 @@ var cookieHelpers = {
* } * }
* } * }
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
editCookie(data) { editCookie(data) {
let { field, oldValue, newValue } = data; let { field, oldValue, newValue } = data;
const origName = field === "name" ? oldValue : data.items.name; const origName = field === "name" ? oldValue : data.items.name;
@@ -994,7 +994,6 @@ var cookieHelpers = {
cookie.sameSite cookie.sameSite
); );
}, },
/* eslint-enable complexity */
_removeCookies(host, opts = {}) { _removeCookies(host, opts = {}) {
// We use a uniqueId to emulate compound keys for cookies. We need to // We use a uniqueId to emulate compound keys for cookies. We need to
@@ -3445,7 +3444,7 @@ const StorageActor = protocol.ActorClassWithSpec(specs.storageSpec, {
* Pass an empty array if the host itself was affected: either completely * Pass an empty array if the host itself was affected: either completely
* removed or cleared. * removed or cleared.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
update(action, storeType, data) { update(action, storeType, data) {
if (action == "cleared") { if (action == "cleared") {
this.emit("stores-cleared", { [storeType]: data }); this.emit("stores-cleared", { [storeType]: data });
@@ -3522,7 +3521,6 @@ const StorageActor = protocol.ActorClassWithSpec(specs.storageSpec, {
return null; return null;
}, },
/* eslint-enable complexity */
/** /**
* This method removes data from the this.boundUpdate object in the same * This method removes data from the this.boundUpdate object in the same

View File

@@ -655,7 +655,7 @@ const WebConsoleActor = ActorClassWithSpec(webconsoleSpec, {
* @return object * @return object
* The response object which holds the startedListeners array. * The response object which holds the startedListeners array.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
startListeners: async function(listeners) { startListeners: async function(listeners) {
const startedListeners = []; const startedListeners = [];
const window = !this.parentActor.isRootActor ? this.window : null; const window = !this.parentActor.isRootActor ? this.window : null;
@@ -826,7 +826,6 @@ const WebConsoleActor = ActorClassWithSpec(webconsoleSpec, {
traits: this.traits, traits: this.traits,
}; };
}, },
/* eslint-enable complexity */
/** /**
* Handler for the "stopListeners" request. * Handler for the "stopListeners" request.
@@ -1135,7 +1134,7 @@ const WebConsoleActor = ActorClassWithSpec(webconsoleSpec, {
* @return object * @return object
* The evaluation response packet. * The evaluation response packet.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
evaluateJS: function(request) { evaluateJS: function(request) {
const input = request.text; const input = request.text;
const timestamp = Date.now(); const timestamp = Date.now();
@@ -1323,7 +1322,6 @@ const WebConsoleActor = ActorClassWithSpec(webconsoleSpec, {
notes: errorNotes, notes: errorNotes,
}; };
}, },
/* eslint-enable complexity */
/** /**
* The Autocomplete request handler. * The Autocomplete request handler.

View File

@@ -562,7 +562,7 @@ function mainThreadFetch(
).loadGroup; ).loadGroup;
} }
/* eslint-disable complexity */ // eslint-disable-next-line complexity
const onResponse = (stream, status, request) => { const onResponse = (stream, status, request) => {
if (!components.isSuccessCode(status)) { if (!components.isSuccessCode(status)) {
reject(new Error(`Failed to fetch ${url}. Code ${status}.`)); reject(new Error(`Failed to fetch ${url}. Code ${status}.`));

View File

@@ -284,7 +284,7 @@ function cssTrim(str) {
* rewriteDeclarations, and skip the usual name-checking * rewriteDeclarations, and skip the usual name-checking
* heuristic. * heuristic.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function parseDeclarationsInternal( function parseDeclarationsInternal(
isCssPropertyKnown, isCssPropertyKnown,
inputString, inputString,
@@ -505,7 +505,6 @@ function parseDeclarationsInternal(
return declarations; return declarations;
} }
/* eslint-enable complexity */
/** /**
* Returns an array of CSS declarations given a string. * Returns an array of CSS declarations given a string.
@@ -592,7 +591,7 @@ function parseNamedDeclarations(
* @return {Array} an array of objects with the following signature: * @return {Array} an array of objects with the following signature:
* [{ "value": string, "type": integer }, ...] * [{ "value": string, "type": integer }, ...]
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function parsePseudoClassesAndAttributes(value) { function parsePseudoClassesAndAttributes(value) {
if (!value) { if (!value) {
throw new Error("empty input string"); throw new Error("empty input string");
@@ -678,7 +677,6 @@ function parsePseudoClassesAndAttributes(value) {
return result; return result;
} }
/* eslint-enable complexity */
/** /**
* Expects a single CSS value to be passed as the input and parses the value * Expects a single CSS value to be passed as the input and parses the value

View File

@@ -253,7 +253,7 @@ class WalkerFront extends FrontClassWithSpec(walkerSpec) {
/** /**
* Get any unprocessed mutation records and process them. * Get any unprocessed mutation records and process them.
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
async getMutations(options = {}) { async getMutations(options = {}) {
const mutations = await super.getMutations(options); const mutations = await super.getMutations(options);
const emitMutations = []; const emitMutations = [];
@@ -410,7 +410,6 @@ class WalkerFront extends FrontClassWithSpec(walkerSpec) {
this.emit("mutations", emitMutations); this.emit("mutations", emitMutations);
} }
/* eslint-enable complexity */
/** /**
* Handle the `new-mutations` notification by fetching the * Handle the `new-mutations` notification by fetching the

View File

@@ -207,7 +207,7 @@ function getLineCountInComments(text) {
* // between the original source and prettified source * // between the original source and prettified source
* } * }
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function prettifyCSS(text, ruleCount) { function prettifyCSS(text, ruleCount) {
if (prettifyCSS.LINE_SEPARATOR == null) { if (prettifyCSS.LINE_SEPARATOR == null) {
const os = Services.appinfo.OS; const os = Services.appinfo.OS;
@@ -475,7 +475,6 @@ function prettifyCSS(text, ruleCount) {
return { result, mappings }; return { result, mappings };
} }
/* eslint-enable complexity */
exports.prettifyCSS = prettifyCSS; exports.prettifyCSS = prettifyCSS;

View File

@@ -50,7 +50,7 @@ exports.naturalSortCaseInsensitive = function naturalSortCaseInsensitive(a, b) {
* @param {Boolean} insensitive * @param {Boolean} insensitive
* Should the search be case insensitive? * Should the search be case insensitive?
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function naturalSort(a, b, insensitive) { function naturalSort(a, b, insensitive) {
// convert all to strings strip whitespace // convert all to strings strip whitespace
const i = function(s) { const i = function(s) {
@@ -118,4 +118,3 @@ function naturalSort(a, b, insensitive) {
} }
return null; return null;
} }
/* eslint-enable complexity */

View File

@@ -79,7 +79,7 @@ const MAX_AUTOCOMPLETIONS = (exports.MAX_AUTOCOMPLETIONS = 1500);
* access (e.g. `window["addEvent`). * access (e.g. `window["addEvent`).
* } * }
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function JSPropertyProvider({ function JSPropertyProvider({
dbgObject, dbgObject,
environment, environment,
@@ -348,7 +348,6 @@ function JSPropertyProvider({
return prepareReturnedObject(getMatchedPropsInDbgObject(obj, search)); return prepareReturnedObject(getMatchedPropsInDbgObject(obj, search));
} }
/* eslint-enable complexity */
function hasArrayIndex(str) { function hasArrayIndex(str) {
return /\[\d+\]$/.test(str); return /\[\d+\]$/.test(str);
@@ -396,7 +395,7 @@ const OPERATOR_CHARS_SET = new Set(";,:=<>+-*%|&^~?!".split(""));
* element access (e.g. `x["match`). * element access (e.g. `x["match`).
* } * }
*/ */
/* eslint-disable complexity */ // eslint-disable-next-line complexity
function analyzeInputString(str) { function analyzeInputString(str) {
// work variables. // work variables.
const bodyStack = []; const bodyStack = [];
@@ -598,7 +597,6 @@ function analyzeInputString(str) {
isElementAccess, isElementAccess,
}; };
} }
/* eslint-enable complexity */
/** /**
* For a given environment and constructor name, returns its Debugger.Object wrapped * For a given environment and constructor name, returns its Debugger.Object wrapped