Katochimoto/xblocks

View on GitHub

Showing 32 of 58 total issues

Function _onArrowRight has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    _onArrowRight() {
        if (!this._item) {
            this._focus(this._rowFirst(this._colFirst()));

        } else {
Severity: Minor
Found in src/utils/TableNavigator.js - About 55 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 menuitemSelect has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        menuitemSelect: function () {
            if (!this.selectable) {
                return;
            }

Severity: Minor
Found in src/mixin/element/menu.js - About 55 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 render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        render: function () {
            const classes = classnames({
                'xb-button': true,
                '_disabled': this.props.disabled,
                '_focused': this.state.focused,
Severity: Minor
Found in src/blocks/button/index.jsx - About 55 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 _onArrowLeft has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    _onArrowLeft() {
        if (!this._item) {
            this._focus(this._rowFirst(this._colFirst()));

        } else {
Severity: Minor
Found in src/utils/TableNavigator.js - About 55 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 _onArrowDown has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    _onArrowDown() {
        if (!this._item) {
            this._focus(this._rowFirst(this._colFirst()));

        } else {
Severity: Minor
Found in src/utils/TableNavigator.js - About 45 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 _onArrowUp has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    _onArrowUp() {
        if (!this._item) {
            this._focus(this._rowFirst(this._colFirst()));

        } else {
Severity: Minor
Found in src/utils/TableNavigator.js - About 45 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 attributeChanged has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        attributeChanged: function (attrName, oldValue, newValue) {
            if (attrName === 'disabled') {
                if (newValue === null) {
                    this.setAttribute('tabindex', this[ TABINDEX ] !== null ? this[ TABINDEX ] : '0');

Severity: Minor
Found in src/mixin/element/focus.js - About 45 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

Avoid too many return statements within this function.
Open

                return (
                    <button className={classes}
                        type={type}
                        form={this.props.form}
                        title={this.props.title}
Severity: Major
Found in src/blocks/button/index.jsx - About 30 mins to fix

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

            render: function () {
                const classes = classnames({
                    'xb-menuitem': true,
                    '_disabled':   this.props.disabled,
                    '_focused':    this.props.focused,
    Severity: Minor
    Found in src/blocks/menuitem/index.jsx - 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 _col has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        _col(item) {
            if (!item) {
                return;
            }
    
    
    Severity: Minor
    Found in src/utils/TableNavigator.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 _passEventToTarget has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

                _passEventToTarget: function (event) {
                    var target = this.target;
                    var targetType = typeof target;
                    var targetEvent = new xevent.Custom('xb-speech-recognition-' + event.type, {
                        bubbles: false,
    Severity: Minor
    Found in src/blocks/speech-recognition/index.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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        render: function () {
            const classes = classnames({
                '_content': true,
                '_empty': this.context.isEmptyContent()
            });
    Severity: Minor
    Found in src/blocks/button/content.jsx - 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