Showing 372 of 564 total issues
Function _getAllUpcastDefinitions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function* _getAllUpcastDefinitions( definition ) {
if ( definition.model.values ) {
for ( const value of definition.model.values ) {
const model = { key: definition.model.key, value };
const view = definition.view[ value ];
- 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 _getTransformedByMove
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_getTransformedByMove( sourcePosition, targetPosition, howMany ) {
// Update target position, as it could be affected by nodes removal.
targetPosition = targetPosition._getTransformedByDeletion( sourcePosition, howMany );
if ( sourcePosition.isEqual( targetPosition ) ) {
- 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 _splitToAllowedParent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_splitToAllowedParent( node, modelCursor ) {
// Try to find allowed parent.
const allowedParent = this.conversionApi.schema.findAllowedParent( modelCursor, node );
// When there is no parent that allows to insert node then return `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 extractMarkersFromModelFragment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function extractMarkersFromModelFragment( modelItem, writer ) {
const markerElements = new Set();
const markers = new Map();
// Create ModelTreeWalker.
- 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 updatePlaceholder
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function updatePlaceholder( writer, element, config ) {
const { text, isDirectHost } = config;
const hostElement = isDirectHost ? element : getChildPlaceholderHostSubstitute( element );
let wasViewModified = 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 _findReplaceActions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_findReplaceActions( actions, actualDom, expectedDom ) {
// If there is no both 'insert' and 'delete' actions, no need to check for replaced elements.
if ( actions.indexOf( 'insert' ) === -1 || actions.indexOf( 'delete' ) === -1 ) {
return actions;
}
- 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 mergeBranches
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function mergeBranches( writer, startPos, endPos ) {
const startParent = startPos.parent;
const endParent = endPos.parent;
// If both positions ended up in the same parent, then there's nothing more to merge:
- 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 _getChildrenSnapshot
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function _getChildrenSnapshot( children ) {
const snapshot = [];
for ( const child of children ) {
if ( child.is( 'text' ) ) {
- 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 fromJSON
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static fromJSON( json ) {
let children = null;
if ( json.children ) {
children = [];
- 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 true;
Avoid too many return
statements within this function. Open
return new ViewPosition( viewParent, 0 );
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return this.mergeAttributes( new Position( nodeBefore, count ) );
Avoid too many return
statements within this function. Open
return this._next();
Avoid too many return
statements within this function. Open
return this._formatReturnValue( 'text', textProxy, previousPosition, position, textLength );
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return this._formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return this._formatReturnValue( 'text', textProxy, previousPosition, position, textLength );
Avoid too many return
statements within this function. Open
return position;