Function _setUpBindToBinding
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
_setUpBindToBinding( factory ) {
const externalCollection = this._bindToCollection;
// Adds the item to the collection once a change has been done to the external collection.
//
- 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 _setUpBindToBinding
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setUpBindToBinding( factory ) {
const externalCollection = this._bindToCollection;
// Adds the item to the collection once a change has been done to the external collection.
//
Function remove
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
remove( subject ) {
let index, id, item;
let itemDoesNotExist = false;
const idProperty = this._idProperty;
Function addItem
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const addItem = ( evt, externalItem, index ) => {
const isExternalBoundToThis = externalCollection._bindToCollection == this;
const externalItemBound = externalCollection._bindToInternalToExternalMap.get( externalItem );
// If an external collection is bound to this collection, which makes it a 2–way binding,
Function remove
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
remove( subject ) {
let index, id, item;
let itemDoesNotExist = false;
const idProperty = this._idProperty;
- 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 _getItemIdBeforeAdding
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_getItemIdBeforeAdding( item ) {
const idProperty = this._idProperty;
let itemId;
if ( ( idProperty in item ) ) {
- 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"