Showing 372 of 564 total issues
Function clear
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
clear( range, element ) {
validateRangeContainer( range, this.document );
// Create walker on given range.
// We walk backward because when we remove element during walk it modifies range end position.
- 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 render
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
render() {
let inlineFillerPosition;
// Refresh mappings.
for ( const element of this.markedChildren ) {
- 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 _mergeSiblingsOf
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
_mergeSiblingsOf( node, context ) {
if ( !( node instanceof Element ) ) {
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 handleBackwardMovement
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleBackwardMovement( position, data ) {
const attribute = this.attribute;
// When the gravity is already overridden...
if ( this._isGravityOverridden ) {
Function _previous
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
_previous() {
const previousPosition = this.position;
const position = this.position.clone();
const parent = this._visitedParent;
Function changeAttribute
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function changeAttribute( attributeCreator ) {
return ( evt, data, conversionApi ) => {
const oldAttribute = attributeCreator( data.attributeOldValue, data );
const newAttribute = attributeCreator( data.attributeNewValue, data );
Function _next
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
_next() {
const previousPosition = this.position;
const position = this.position.clone();
const parent = this._visitedParent;
Function transformSets
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function transformSets( operationsA, operationsB, options ) {
// Create new arrays so the originally passed arguments are not changed.
// No need to clone operations, they are cloned as they are transformed.
operationsA = operationsA.slice();
operationsB = operationsB.slice();
Function matchClasses
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function matchClasses( patterns, element ) {
const match = [];
for ( const pattern of patterns ) {
if ( pattern instanceof RegExp ) {
- 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 matchAttributes
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function matchAttributes( patterns, element ) {
const match = [];
for ( const name in patterns ) {
const pattern = patterns[ name ];
- 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 _breakAttributes
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
_breakAttributes( position, forceSplitText = false ) {
const positionOffset = position.offset;
const positionParent = position.parent;
// If position is placed inside EmptyElement - throw an exception as we cannot break inside.
- 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 isEqual
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
isEqual( otherSelection ) {
if ( this.isFake != otherSelection.isFake ) {
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 _normalizeNodes
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function _normalizeNodes( nodes ) {
const normalized = [];
if ( !( nodes instanceof Array ) ) {
nodes = [ nodes ];
- 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 _getTransformedByDeletion
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
_getTransformedByDeletion( deletePosition, howMany ) {
const transformed = Position._createAt( this );
// This position can't be affected if deletion was in a different root.
if ( this.root != deletePosition.root ) {
- 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 createViewElementFromDefinition
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function createViewElementFromDefinition( viewElementDefinition, viewWriter, viewElementType ) {
if ( typeof viewElementDefinition == 'string' ) {
// If `viewElementDefinition` is given as a `String`, normalize it to an object with `name` property.
viewElementDefinition = { name: viewElementDefinition };
}
- 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 _mergeSiblingsOf
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mergeSiblingsOf( node, context ) {
if ( !( node instanceof Element ) ) {
return;
}
Function _unwrapChildren
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
_unwrapChildren( parent, startOffset, endOffset, unwrapElement ) {
let i = startOffset;
const unwrapPositions = [];
// Iterate over each element between provided offsets inside parent.
Function insert
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
insert( item, itemOrPosition, offset = 0 ) {
this._assertWriterUsedCorrectly();
if ( item instanceof Text && item.data == '' ) {
return;
Function _getTransformedByMove
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getTransformedByMove( sourcePosition, targetPosition, howMany, spread = false ) {
// Special case for transforming a collapsed range. Just transform it like a position.
if ( this.isCollapsed ) {
const newPos = this.start._getTransformedByMove( sourcePosition, targetPosition, howMany );
Function domToView
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
domToView( domNode, options = {} ) {
if ( this.isBlockFiller( domNode, this.blockFillerMode ) ) {
return null;
}