Showing 22 of 58 total issues
HTMLSelectElement
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
export default class HTMLSelectElement extends HTMLElement {
/**
* Is a Boolean that reflects the autofocus HTML attribute,
* which indicates whether the control should have input focus when the page loads,
* unless the user overrides it, for example by typing in a different control.
ParentNode
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
export default class ParentNode extends Node {
constructor() {
super();
this._childNodes = [];
this._childCollections = [];
Url
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
export default class Url {
/**
* Creates object using given value as start url.
*
* @param {string} url - url to parse.
HTMLFormElement
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
export default class HTMLFormElement extends HTMLElement {
/**
* Gets or sets value of acceptCharset. Is a DOMString that reflects the accept-charset HTML attribute,
* containing a list of character encodings that the server accepts.
*
Function matchRule
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matchRule(element, rule) {
if (rule.hasOwnProperty('tagName') && element.tagName !== rule.tagName) {
return false;
}
Function dispatchEvent
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
dispatchEvent(event) {
event.target = this;
// Capturing phase
const capturingPhase = function (event) { // eslint-disable-line space-before-function-paren
- 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 rowIndex
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
get rowIndex() {
if (this.parentNode === null) {
return -1;
}
Function dispatchEvent
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatchEvent(event) {
event.target = this;
// Capturing phase
const capturingPhase = function (event) { // eslint-disable-line space-before-function-paren
Function processSelectors
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function* processSelectors(element, selectors) {
for (let selector of selectors) {
const rule = selector.rule;
if (!matchRule(element, rule)) {
- 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 constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(type, mouseEventInit) {
mouseEventInit = extend(true, {
screenX: 0,
screenY: 0,
clientX: 0,
Function processSelectors
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function* processSelectors(element, selectors) {
for (let selector of selectors) {
const rule = selector.rule;
if (!matchRule(element, rule)) {
Function rows
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
get rows() {
const result = [];
if (this.tHead !== null) {
this.tHead.children.forEach((element) => {
if (element.tagName === 'tr') {
Function rowIndex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
get rowIndex() {
if (this.parentNode === null) {
return -1;
}
- 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 matchRule
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function matchRule(element, rule) {
if (rule.hasOwnProperty('tagName') && element.tagName !== rule.tagName) {
return 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 selected
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
set selected(selected) {
if (selected) {
let selectElement = this._select;
if (!selectElement.multiple) {
let selectedOption = selectElement.selectedOption;
- 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 -1;
Avoid too many return
statements within this function. Open
return index + inSection;
Avoid too many return
statements within this function. Open
return true;
Function appendChild
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
appendChild(child) {
if (!(child instanceof Node)) {
throw new Error('Trying to add non node element');
}
- 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 replaceChild
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
replaceChild(newChild, oldChild) {
const index = this._childNodes.indexOf(oldChild);
if (index === -1) {
throw new Error('Node was not found');
}
- 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"