appbaseio/reactivesearch

View on GitHub

Showing 334 of 1,376 total issues

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

    Function componentDidMount has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        componentDidMount() {
            this.props.addComponent(this.props.componentId);
            this.setReact(this.props);
    
            let startDate = null;
    Severity: Minor
    Found in packages/native/src/components/date/DateRange.js - About 1 hr to fix

      Function defaultQuery has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      SingleList.defaultQuery = (value, props) => {
          if (props.selectAllLabel && props.selectAllLabel === value) {
              if (props.showMissing) {
                  return { match_all: {} };
              }
      Severity: Minor
      Found in packages/vue/src/components/list/SingleList.jsx - About 1 hr to fix

        Function booksReactiveList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            booksReactiveList(data) {
                return (
                    <div className="flex book-content" key={data._id}>
                        <img src={data.image} alt="Book Cover" className="book-image" />
                        <div className="flex column justify-center" style={{ marginLeft: 20 }}>
        Severity: Minor
        Found in packages/web/examples/MultiDropdownList/src/index.js - About 1 hr to fix

          Function booksReactiveList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              booksReactiveList(data) {
                  return (
                      <div className="flex book-content" key={data._id}>
                          <img src={data.image} alt="Book Cover" className="book-image" />
                          <div className="flex column justify-center" style={{ marginLeft: 20 }}>
          Severity: Minor
          Found in packages/web/examples/DataController/src/index.js - About 1 hr to fix

            Function booksReactiveList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                booksReactiveList(data) {
                    return (
                        <div className="flex book-content" key={data._id}>
                            <img src={data.image} alt="Book Cover" className="book-image" />
                            <div className="flex column justify-center" style={{ marginLeft: 20 }}>
            Severity: Minor
            Found in packages/web/examples/MultiList/src/index.js - About 1 hr to fix

              Function booksReactiveList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  booksReactiveList(data) {
                      return (
                          <div className="flex book-content" key={data._id}>
                              <img src={data.image} alt="Book Cover" className="book-image" />
                              <div className="flex column justify-center" style={{ marginLeft: 20 }}>
              Severity: Minor
              Found in packages/web/examples/ReactiveList/src/index.js - About 1 hr to fix

                Function booksReactiveList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    booksReactiveList(data) {
                        return (
                            <div className="flex book-content" key={data._id}>
                                <img src={data.image} alt="Book Cover" className="book-image" />
                                <div className="flex column justify-center" style={{ marginLeft: 20 }}>
                Severity: Minor
                Found in packages/web/examples/SingleList/src/index.js - About 1 hr to fix

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

                      render() {
                          if (this.props.render) {
                              return this.props.render(this.props);
                          }
                  
                  
                  Severity: Minor
                  Found in packages/web/src/components/basic/SelectedFilters.js - About 1 hr to fix

                    Function booksReactiveList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        booksReactiveList(data) {
                            return (
                                <div className="flex book-content" key={data._id}>
                                    <img src={data.image} alt="Book Cover" className="book-image" />
                                    <div className="flex column justify-center" style={{ marginLeft: 20 }}>
                    Severity: Minor
                    Found in packages/web/examples/SingleDropdownList/src/index.js - About 1 hr to fix

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

                          render() {
                              return (
                                  <ReactiveBase
                                      app="good-books-ds"
                                      credentials="nY6NNTZZ6:27b76b9f-18ea-456c-bc5e-3a5263ebc63d"
                      Severity: Minor
                      Found in packages/web/examples/TextField/src/index.js - About 1 hr to fix

                        Function componentWillReceiveProps has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            componentWillReceiveProps(nextProps) {
                                checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
                        
                                checkSomePropChange(this.props, nextProps, ['dataField', 'nestedField'], () => {
                                    this.updateQuery(Object.keys(this.state.currentValue), nextProps);
                        Severity: Minor
                        Found in packages/web/src/components/list/MultiDataList.js - About 1 hr to fix

                          Function setPage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  setPage(page) {
                                      // pageClick will be called everytime a pagination button is clicked
                                      if (page !== this.$currentPage) {
                                          this.$emit('pageClick', page + 1);
                                          const value = this.$props.size * page;
                          Severity: Minor
                          Found in packages/vue/src/components/result/ReactiveList.jsx - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if (this.state.currentDate) {
                                        markedDates = {
                                            [this.state.currentDate.start.dateString]: {
                                                startingDay: true,
                                                color:
                            Severity: Major
                            Found in packages/native/src/components/date/DateRange.js - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                      if (this.state.currentDate) {
                                          markedDates = {
                                              [this.state.currentDate.dateString]: {
                                                  startingDay: true,
                                                  endingDay: true,
                              Severity: Major
                              Found in packages/native/src/components/date/DatePicker.js - About 1 hr to fix

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

                                    render() {
                                        const results = parseHits(this.props.hits) || [];
                                        const streamResults = parseHits(this.props.streamHits) || [];
                                        let filteredResults = results;
                                
                                
                                Severity: Minor
                                Found in packages/native/src/components/result/ReactiveList.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 renderValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                        renderValue(value, isArray) {
                                            if (isArray && value.length) {
                                                const arrayToRender = value.map(item => this.renderValue(item));
                                                return arrayToRender.join(', ');
                                            }
                                Severity: Minor
                                Found in packages/vue/src/components/basic/SelectedFilters.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 componentDidMount has a Cognitive Complexity of 9 (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/native/src/components/result/ReactiveList.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 componentDidMount has a Cognitive Complexity of 9 (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/src/components/result/ReactiveMap.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() {
                                        const {
                                            selectAllLabel, renderListItem, showLoadMore, loadMoreLabel,
                                        } = this.props;
                                        const { isLastBucket } = this.state;
                                Severity: Minor
                                Found in packages/web/src/components/list/MultiList.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