Showing 154 of 736 total issues
Function plugin
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function plugin(/* options */) {
return function(files, metalsmith, done) {
const indexes = {
documentation: [],
tutorial: [],
Function exports
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(md/*, options */) {
md.core.ruler.push('container_example', function(state) {
const tokens = state.tokens;
let containerOpen;
let headingContent;
Function generateBrowserStructure
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateBrowserStructure(ident, browser, browserData) {
const element = browserData.elements[ident] || {};
const scriptFocus = element.scriptFocus || {};
const ally = element.ally || {};
const jquery = element.jquery || {};
Function readableLabel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function readableLabel(focusable, tabbable, onlyTabbable, redirecting, focusHost) {
return (redirecting && 'redirecting')
|| (focusable && tabbable && 'tabbable')
|| (focusable && !tabbable && 'focusable')
|| (!focusable && tabbable && 'only tabbable')
- 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 plugin
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function plugin(/* options */) {
return function(files, metalsmith, done) {
setImmediate(done);
Object.keys(files).forEach(function(key) {
- 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 addReadableLabels
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addReadableLabels(src) {
src.browser.label = readableLabel(
src.browser.focusable,
src.browser.tabbable,
null, // onlyTabbable
Function addBodyToIssueLink
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addBodyToIssueLink() {
var editLink = document.getElementById('document-github-edit');
var issueLink = document.getElementById('document-github-issue');
if (!issueLink || !editLink) {
Consider simplifying this complex logical expression. Open
if (typeof document === 'undefined' || !document.documentElement.createShadowRoot) {
// no need to initialize any of this if we don't have ShadowDOM available
engage = disengage = function() {};
} else {
let blurTimer;
Function default
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(context) {
if (!supports) {
supports = _supports();
}
Function verifyLinks
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function verifyLinks(index, filename, $, ignore) {
const errors = [];
$('a').each(function() {
const $link = $(this);
Function default
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(context) {
const element = contextToElement({
label: 'element/blur',
context,
});
Function indexAlgolia
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function indexAlgolia($, data) {
if (data.algolia) {
return;
}
Function addPlatform
has 30 lines of code (exceeds 25 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')
Function plugin
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function plugin(options) {
if (!options) {
options = {};
}
Function default
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(context) {
if (!supports) {
supports = _supports();
}
Function createShadowRoot
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createShadowRoot(fixture) {
if (!fixture.shadow) {
fixture.shadow = {};
}
Function handleFocusEvent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function handleFocusEvent(event) {
let source = '';
if (event.type === focusEventName || event.type === 'shadow-focus') {
const interactionType = interactionTypeHandler.get();
source = lock
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
export default function(context) {
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
Function isVisibleRules
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function isVisibleRules({
context,
except = {
notRendered: false,
cssDisplay: false,
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
export default function(context) {
const element = contextToElement({
label: 'element/blur',
context,
});
- 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"