ckeditor/ckeditor5-engine

View on GitHub

Showing 564 of 564 total issues

Function _checkContextMatch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    _checkContextMatch( def, context, contextItemIndex = context.length - 1 ) {
        const contextItem = context.getItem( contextItemIndex );

        if ( def.allowIn.includes( contextItem.name ) ) {
            if ( contextItemIndex == 0 ) {
Severity: Minor
Found in src/model/schema.js - About 25 mins to fix

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 getDifference has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    getDifference( otherRange ) {
        const ranges = [];

        if ( this.isIntersecting( otherRange ) ) {
            // Ranges intersect.
Severity: Minor
Found in src/model/range.js - About 25 mins to fix

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 addMarker has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    addMarker( name, options ) {
        this._assertWriterUsedCorrectly();

        if ( !options || typeof options.usingOperation != 'boolean' ) {
            /**
Severity: Minor
Found in src/model/writer.js - About 25 mins to fix

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 getMinimalFlatRanges has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    getMinimalFlatRanges() {
        const ranges = [];
        const diffAt = this.start.getCommonPath( this.end ).length;

        const pos = Position._createAt( this.start );
Severity: Minor
Found in src/model/range.js - About 25 mins to fix

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

Severity
Category
Status
Source
Language