Katochimoto/xblocks

View on GitHub

Showing 32 of 58 total issues

Function default has 164 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function (tagName) {
    return {
        getInitialState: function () {
            return {
                maxHeight: 0,
Severity: Major
Found in src/mixin/view/menu.js - About 6 hrs to fix

    Function default has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function (tagName) {
        return {
            getInitialState: function () {
                return {
                    maxHeight: 0,
    Severity: Minor
    Found in src/mixin/view/menu.js - About 5 hrs 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 111 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            render: function () {
                const classes = classnames({
                    'xb-button': true,
                    '_disabled': this.props.disabled,
                    '_focused': this.state.focused,
    Severity: Major
    Found in src/blocks/button/index.jsx - About 4 hrs to fix

      TableNavigator has 28 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export default class TableNavigator {
          constructor(node, options) {
              this._options = _.merge({
                  col: 'xb-menu:not([disabled])',
                  row: 'xb-menuitem:not([disabled])',
      Severity: Minor
      Found in src/utils/TableNavigator.js - About 3 hrs to fix

        Function default has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function (event) {
            if (event.hasOwnProperty(ConstantEvent.WRAP)) {
                return event;
            }
        
        
        Severity: Minor
        Found in src/event/wrap.js - About 2 hrs 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

        File TableNavigator.js has 251 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import _ from 'lodash';
        import { event as xevent } from 'xblocks-core';
        import delegate from 'event/delegate';
        import filterClick from 'event/filterClick';
        import filterMouse from 'event/filterMouse';
        Severity: Minor
        Found in src/utils/TableNavigator.js - About 2 hrs to fix

          Function default has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function (node, callback, context, inner) {
              inner = (typeof inner === 'undefined' ? true : Boolean(inner));
              var next;
              var cbcall;
          
          
          Severity: Minor
          Found in src/dom/eachAfter.js - About 1 hr 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 default has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          export default function (node, callback, context, inner) {
              inner = (typeof inner === 'undefined' ? true : Boolean(inner));
              var prev;
              var cbcall;
          
          
          Severity: Minor
          Found in src/dom/eachBefore.js - About 1 hr 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 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  menuitemSelect: function () {
                      if (!this.selectable) {
                          return;
                      }
          
          
          Severity: Minor
          Found in src/mixin/element/menu.js - About 1 hr to fix

            Function default has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function (node, callback) {
                var stack = [ node ];
                var item;
                var cbcall;
                var childsLength;
            Severity: Minor
            Found in src/dom/eachInnerFollowing.js - About 1 hr 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 default has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function (node, callback) {
                var stack = [ node ];
                var item;
                var cbcall;
                var i;
            Severity: Minor
            Found in src/dom/eachInnerPrevious.js - About 1 hr 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 default has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function (event) {
                if (event.hasOwnProperty(ConstantEvent.WRAP)) {
                    return event;
                }
            
            
            Severity: Minor
            Found in src/event/wrap.js - About 1 hr to fix

              Function render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      render: function () {
                          const classes = classnames({
                              [ tagName ]: true
                          });
              
              
              Severity: Minor
              Found in src/mixin/view/menu.js - About 1 hr to fix

                Function render has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        render: function () {
                            const classes = classnames({
                                'xb-checkbox': true,
                                '_disabled': this.props.disabled,
                                [ `_size-${this.props.size}` ]: true
                Severity: Minor
                Found in src/blocks/checkbox/index.jsx - About 1 hr to fix

                  Function render has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          render: function () {
                              const classes = classnames({
                                  'xb-radio':  true,
                                  '_disabled': this.props.disabled,
                                  [ `_size-${this.props.size}` ]: true
                  Severity: Minor
                  Found in src/blocks/radio/index.jsx - About 1 hr to fix

                    Function render has 30 lines of code (exceeds 25 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 1 hr to fix

                      Function fillOptionsFromAttrs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function fillOptionsFromAttrs(popupOptions, attrs) {
                          for (let attrName in attrs) {
                              let params = ATTRS_ALIGN[ attrName ];
                              if (!params) {
                                  continue;
                      Severity: Minor
                      Found in src/blocks/popup/index.js - About 1 hr 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 xb-speech-recognition-result has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  'xb-speech-recognition-result': function (event) {
                                      if (event.detail) {
                                          var input = this.querySelector('input');
                      
                                          if (event.detail.interim) {
                      Severity: Minor
                      Found in src/blocks/input/index.js - About 1 hr to fix

                        Function render has 26 lines of code (exceeds 25 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 1 hr to fix

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

                          export default function (selector, target) {
                              if (!target || !target.tagName) {
                                  return;
                              }
                          
                          
                          Severity: Minor
                          Found in src/event/delegateMatch.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

                          Severity
                          Category
                          Status
                          Source
                          Language