Showing 154 of 736 total issues
Function ?alt+?shift+tab
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
'?alt+?shift+tab': function(event) {
// we're completely taking over the Tab key handling
event.preventDefault();
const sequence = queryTabsequence({
Function createKeyEvent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createKeyEvent(type, options) {
// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent
if (typeof KeyboardEvent === 'function') {
options.bubbles = true;
return new KeyboardEvent(type, options);
Function handleBeforeFocusEvent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleBeforeFocusEvent = function(event) {
// find the element that would receive focus
const target = getFocusTarget({
context: event.target,
except: {
Function transform
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function transform($, file, fileName, options) {
const absolute = path.join(options.resolve, fileName);
if (options.canonical) {
const canonical = options.canonical + fileName;
const $canonical = $('<link rel="canonical" href="">').attr('href', canonical);
Function plugin
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function plugin(/* options */) {
return function(files, metalsmith, done) {
setImmediate(done);
Object.keys(files).forEach(function(key) {
Consider simplifying this complex logical expression. Open
if (event.type === focusEventName || event.type === 'shadow-focus') {
const interactionType = interactionTypeHandler.get();
source = lock
|| interactionType.pointer && 'pointer'
|| interactionType.key && 'key'
Consider simplifying this complex logical expression. Open
if (platform.is.WEBKIT && platform.is.IOS) {
// iOS only considers a hand full of elements tabbable (keyboard focusable)
// this holds true even with external keyboards
let potentiallyTabbable = (nodeName === 'input' && element.type === 'text' || element.type === 'password')
|| nodeName === 'select'
Function setElementDisabled
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function setElementDisabled(element, disabledState) {
setAriaDisabled(element, disabledState);
disableTabindex(element, disabledState);
disableScriptFocus(element, disabledState);
disablePointerEvents(element, disabledState);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function focus
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function focus(element) {
if (element.focus) {
element.focus();
return isActiveElement(element) ? element : null;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function validateUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function validateUrl(index, uri) {
if (uri.authority()) {
// fully qualified, possibly external URL
return null;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Consider simplifying this complex logical expression. Open
if (isSvgElement) {
return validTabindex || supports.focusSvg || supports.focusSvgInIframe
// Internet Explorer understands the focusable attribute introduced in SVG Tiny 1.2
|| Boolean(supports.focusSvgFocusableAttribute && focusableAttribute && focusableAttribute === 'true');
}
Function readableLabel
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function readableLabel(focusable, tabbable, onlyTabbable, redirecting, focusHost) {
Function default
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function({element, attribute, temporaryValue, saveValue}) {
const temporaryAttribute = 'data-cached-' + attribute;
if (temporaryValue !== undefined) {
const _value = saveValue || element.getAttribute(attribute);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function addPlatform
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function addPlatform(platform, key) {
// only to be used for grouping desktop and mobile browsers separately
let mobile = false;
// "Windows" needs some aliasing, possibly required for other platforms, too
const platformFamily = (platform.os.family === 'Windows NT' && 'Windows')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function default
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function(elements) {
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement.tabIndex
// elements with tabIndex "0" (including tabbableElements without tabIndex) should be navigated in the order they appear.
// elements with a positive tabIndex:
// Elements that have identical tabIndexes should be navigated in the order they appear.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function default
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function({
context,
sequence,
strategy,
ignoreAutofocus,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function default
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function() {
if (!supports) {
supports = _supports();
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return true;