appbaseio/reactivesearch

View on GitHub

Showing 334 of 1,376 total issues

Avoid too many return statements within this function.
Open

    return null;
Severity: Major
Found in packages/vue/src/components/list/SingleList.jsx - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return `${interval} minutes`;
    Severity: Major
    Found in site/demos/technews/src/components/Results.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return value;
      Severity: Major
      Found in packages/vue/src/components/shared/DropDown.jsx - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return `${Math.floor(seconds)} seconds`;
        Severity: Major
        Found in site/demos/technews/src/components/Results.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return value;
          Severity: Major
          Found in packages/web/src/components/shared/Dropdown.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return value;
            Severity: Major
            Found in packages/web/src/components/basic/URLParamsProvider.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return this.getDefaultCenter();
              Severity: Major
              Found in packages/maps/src/components/result/ReactiveMap.js - About 30 mins to fix

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

                    render() {
                        const {
                            config,
                            theme: { secondary, primary },
                        } = this.props;
                Severity: Minor
                Found in site/src/components/Home.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 beforeMount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    beforeMount() {
                        this.addComponent(this.$props.componentId);
                
                        if (this.internalComponent) {
                            this.addComponent(this.internalComponent);
                Severity: Minor
                Found in packages/vue/src/components/basic/ReactiveComponent.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 componentWillMount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    componentWillMount() {
                        this.props.addComponent(this.props.componentId);
                        if (this.internalComponent) {
                            this.props.addComponent(this.internalComponent);
                        }
                Severity: Minor
                Found in packages/native/src/components/basic/ReactiveComponent.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() {
                        const { showLoadMore, loadMoreLabel, renderListItem } = this.$props;
                        const { isLastBucket } = this.$data;
                        let selectAll = [];
                        const renderListItemCalc
                Severity: Minor
                Found in packages/vue/src/components/list/SingleDropdownList.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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    render() {
                        const { showLoadMore, loadMoreLabel, renderListItem } = this.$props;
                        const renderListItemCalc
                            = this.$scopedSlots.renderListItem || renderListItem;
                        const { isLastBucket } = this.$data;
                Severity: Minor
                Found in packages/vue/src/components/list/MultiDropdownList.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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    render() {
                        const styles = {
                            height: 30,
                            ...Platform.select({
                                ios: {
                Severity: Minor
                Found in packages/native/src/components/range/RangeSlider.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 options has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                        options(newVal, oldVal) {
                            checkPropChange(oldVal, newVal, () => {
                                const { showLoadMore, dataField } = this.$props;
                                const { modifiedOptions } = this.$data;
                                if (showLoadMore) {
                Severity: Minor
                Found in packages/vue/src/components/list/SingleDropdownList.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 componentDidMount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    componentDidMount() {
                        this.props.addComponent(this.internalComponent);
                        this.props.addComponent(this.props.componentId);
                
                        if (this.props.stream) {
                Severity: Minor
                Found in packages/maps-native/src/components/maps/ReactiveMap.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 mapStateToProps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                const mapStateToProps = (state, props) => ({
                    aggregations:
                        (state.aggregations[props.componentId]
                            && state.aggregations[props.componentId])
                        || null,
                Severity: Minor
                Found in packages/vue/src/components/basic/ReactiveComponent.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 mapStateToProps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                const mapStateToProps = (state, props) => ({
                    hits: (state.hits[props.componentId] && state.hits[props.componentId].hits) || [],
                    aggregations:
                        (state.aggregations[props.componentId] && state.aggregations[props.componentId]) || null,
                    selectedValue:
                Severity: Minor
                Found in packages/native/src/components/basic/ReactiveComponent.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 changeHighlightedIndex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                        changeHighlightedIndex(moveAmount) {
                            if (this.internalItemCount < 0) {
                                return;
                            }
                
                
                Severity: Minor
                Found in packages/vue/src/components/basic/DownShift.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 selectItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                        selectItem(item, isDefaultValue = false, props = this.$props) {
                            // ignore state updates when component is locked
                            if (props.beforeValueChange && this.locked) {
                                return;
                            }
                Severity: Minor
                Found in packages/vue/src/components/range/MultiRange.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 componentWillReceiveProps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    componentWillReceiveProps(nextProps) {
                        checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
                        checkPropChange(this.props.options, nextProps.options, () => {
                            this.setState({
                                options: nextProps.options[nextProps.dataField]
                Severity: Minor
                Found in packages/native/src/components/list/MultiDropdownList.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