Showing 69 of 132 total issues
Function request$file
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function request$file(opts, fileData, callback, progress) {
var abort;
return addAbortAbility(
new Promise(function (resolve, reject) {
if (typeof opts == 'string')
Function Data$_set
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Data$_set(value) {
var inTransaction = getTransactionFlag(Data$_set);
var valueSet;
if (value !== null && typeof value == 'object') {
Function createBinderScope
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createBinderScope(scopeEl, scopeObjectFactory, rootScope, bindRootElement, throwOnErrors) {
scopeEl = scopeEl || document.body;
var scope = rootScope || new Scope(scopeEl)
, addMethod = throwOnErrors === false ? '_safeAdd' : '_add';
Function getNodeAtTreePath
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function getNodeAtTreePath(rootEl, treePath, nearest) {
if (!treePath) return;
var len = treePath.length;
if (len === 0) return rootEl;
- 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 find
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function find(direction, iterator) {
if (! findDirections.hasOwnProperty(direction))
throw new Error('incorrect find direction: ' + direction);
var el = this.owner.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 Encoder
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function Encoder() {
var skip = 0; // how many bits we will skip from the first byte
var bits = 0; // 5 high bits, carry from one byte to the next
this.output = '';
- 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 request
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function request(url, opts, callback) {
var abort;
opts.url = url;
opts.contentType = opts.contentType || 'application/json;charset=UTF-8';
Function _onReady
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _onReady(eventType, req, callback, resolve, reject) {
if (req.readyState != 4) return;
if (req[config.request.completedKey]) return;
_.spliceItem(_pendingRequests, req);
Function Drop$isDropAllowed
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Drop$isDropAllowed(dt, originalDropComponent) {
var allow = this.config.allow;
if (dt.isComponent()) {
var allowComps = allow && allow.components
Function send
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function send(data) {
var self = this;
this.data = data;
var url = this.url;
var methodRoutes = _mock_routes && _mock_routes[this.method.toUpperCase()] || {};
- 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 exports
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
Function setSelection
has 31 lines of code (exceeds 25 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();
Function insertAtTreePath
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function insertAtTreePath(rootEl, treePath, el, nearest) {
var toNormalize = el.nodeType == Node.TEXT_NODE;
if (rootEl.contains(el))
removeElement(el); // can't use removeChild as rootEl here is not an immediate parent
Function Decoder
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Decoder() {
var skip = 0; // how many bits we have from the previous character
var byte = 0; // current byte we're producing
this.output = '';
Function ComponentFacet$onConfigMessages
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ComponentFacet$onConfigMessages(messageSubscribers) {
var notYetRegisteredMap = _.mapKeys(messageSubscribers, function(subscriber, messages) {
var subscriberType = typeof subscriber;
if (subscriberType == 'function')
return this.on(messages, subscriber);
Function Data$path
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function Data$path(accessPath, createItem) {
// createItem = true; // this hack seems to be no longer needed...
if (! accessPath)
return this;
- 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 Drop$isDropAllowed
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function Drop$isDropAllowed(dt, originalDropComponent) {
var allow = this.config.allow;
if (dt.isComponent()) {
var allowComps = allow && allow.components
- 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 isTreePathBefore
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function isTreePathBefore(path1, path2) {
var i = 0
, isBefore;
if (!Array.isArray(path1) && Array.isArray(path2))
return logger.error('isTreePathBefore: One or both paths are not valid treepath arrays.');
- 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 createScopeForElement
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createScopeForElement(scope, el, bindRootElement) {
// get element's binding attribute (ml-bind by default)
var attr = new BindAttribute(el);
// if element has bind attribute crate scope object (Component or ComponentInfo)
Function send
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function send(data) {
var self = this;
this.data = data;
var url = this.url;
var methodRoutes = _mock_routes && _mock_routes[this.method.toUpperCase()] || {};