Showing 69 of 132 total issues
Function deprecate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function deprecate(fn, message) {
var warned;
switch (typeof fn) {
case 'object':
return _.mapKeys(fn, function(f) { return deprecate(f, message); });
- 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 getRangeSiblings
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function getRangeSiblings(range) {
var containerNode = range.commonAncestorContainer
, startNode = range.startContainer
, endNode = range.endContainer;
- 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 DOMStorage$setItem
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function DOMStorage$setItem(key, value) {
var pKey = this._storageKey(key);
var dataType = _setKeyDataType.call(this, pKey, value);
var valueStr = _serializeData(value, dataType);
try {
- 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 Container$path
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function Container$path(path) {
path = path.split('.');
var len = path.length;
if (path[0] || len < 2) throwInvalidPath();
var comp = this.owner;
- 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 _setDrop
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function _setDrop(opts) {
this.eventType = 'drop';
this.target = opts.target;
if (opts.clientX === undefined || opts.clientY === undefined) return;
- 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 _onReady
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function _onReady(eventType, req, callback, resolve, reject) {
Function TextSelection$$createStateObject
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function TextSelection$$createStateObject(rootEl, startContainer, startOffset, endContainer, endOffset) {
Function createBinderScope
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function createBinderScope(scopeEl, scopeObjectFactory, rootScope, bindRootElement, throwOnErrors) {
Function hasTextBeforeSelection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function hasTextBeforeSelection() {
var selection = window.getSelection();
if (! selection.isCollapsed) return true;
var text = selection.focusNode && selection.focusNode.textContent;
- 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 createFacetClass
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function createFacetClass(config) {
check(config, {
className: String,
superClassName: Match.Optional(String),
require: Match.Optional(Array),
- 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 _getDirection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _getDirection(fromNode, startOffset, toNode, endOffset){
var docPosition = fromNode.compareDocumentPosition(toNode);
if (docPosition & Node.DOCUMENT_POSITION_FOLLOWING){
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 setSelection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function setSelection(fromNode, startOffset, toNode, endOffset) {
var doc = fromNode.ownerDocument;
if (! doc) return logger('setCaretPosition: element has no document');
var backward = _getDirection(fromNode, startOffset, toNode, endOffset) == -1;
var range = doc.createRange();
- 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 _getContainingComponent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _getContainingComponent(el, returnCurrent, conditionFunc) {
// Where the current element is a component it should be returned
// if returnCurrent is true or undefined
if (returnCurrent !== false) {
var comp = getComponent(el);
- 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 filterSourceMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function filterSourceMessage(sourceMessage, message, data) { // data is DOM event object
var ok = true;
if (sourceMessage == 'dragenter' && message == 'dragin') {
this._currentTarget = data.target;
- 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 _attachCssClasses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _attachCssClasses(el, methodName, cssClasses, enforce) {
var classList = el.classList
, doToggle = methodName == 'toggle';
if (Array.isArray(cssClasses))
- 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 _response_ready
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _response_ready(response) {
var self = this;
var handler, eventType;
if (!setHandler('loadend'))
if (!setHandler('readystatechange'))
- 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 WSMessageSource$trigger
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function WSMessageSource$trigger (msg, data, callback) {
if (!this._ws) return logger.error('websocket is not created');
data = data || {};
data.type = msg;
- 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 0;
Avoid too many return
statements within this function. Open
if (! data) return;
Avoid too many return
statements within this function. Open
return true;