Showing 13 of 13 total issues
Function createElement
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
export default function createElement (string) {
regex.lastIndex = 0
if (string.indexOf('<') !== 0) {
let core = 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 createElement
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function createElement (string) {
regex.lastIndex = 0
if (string.indexOf('<') !== 0) {
let core = null
Function closest
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function closest (element, tested, limit = document) {
element = getElement(element)
if (!element || (typeof limit === 'string' ? element.matches(limit) : element === limit)) {
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 _getElements
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function _getElements (from, selector) {
if (selector.search(reg) === 0) {
switch (selector[0]) {
case '.':
return _nodelistToArray(from.getElementsByClassName(selector.slice(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 _wrapOptions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function _wrapOptions (selector, target, eventsObj, events, options) {
Function _transformFromObj
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function _transformFromObj (values, transformation, name, defaultVal, axe) {
Function _setEvent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function _setEvent (method, callback, options, event, element) {
Function _getValues
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function _getValues (transformation, axes, name, defaultVal, defaultAxes) {
Function _setEventOnEach
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function _setEventOnEach (elements, method, callback, options, event) {
Function getElements
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function getElements (input) {
if (typeof input === 'string') {
return _getElements(document, input)
}
- 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 _chirasizeArray(isDomElement(input) ? [input] : [])
Function getElement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function getElement (input) {
if (typeof input === 'string') {
return _getElement(document, input)
}
- 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 _getElement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function _getElement (from, selector) {
if (selector.search(reg) === 0) {
switch (selector[0]) {
case '.':
return from.getElementsByClassName(selector.slice(1))[0]
- 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"