appbaseio/reactivesearch

View on GitHub

Showing 1,376 of 1,376 total issues

Function componentWillReceiveProps has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    componentWillReceiveProps(nextProps) {
        checkPropChange(this.props.react, nextProps.react, () => {
            this.setReact(nextProps);
        });

Severity: Minor
Found in packages/web/src/components/basic/ToggleButton.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 componentWillReceiveProps has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    componentWillReceiveProps(nextProps) {
        checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
        if (!isEqual(this.props.defaultSelected, nextProps.defaultSelected)) {
            this.handleDateChange(nextProps.defaultSelected, false, nextProps);
        } else {
Severity: Minor
Found in packages/web/src/components/date/DateRange.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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                                <li
                                    className={l.href.endsWith('/quickstart') ? 'active' : undefined}
                                    /* eslint-disable-next-line */
                                    key={i}
                                >
Severity: Major
Found in site/src/components/Learn.js and 1 other location - About 1 hr to fix
site/src/components/Demo.js on lines 38..47

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    externals: [
        {
            react: {
                root: "React",
                commonjs2: "react",
Severity: Major
Found in packages/maps/webpack.config.umd.js and 1 other location - About 1 hr to fix
packages/web/webpack.config.umd.js on lines 26..41

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                                <li
                                    className={l.href === '/demo' || l.href === '/native/demo' ? 'active' : undefined}
                                    /* eslint-disable-next-line */
                                    key={i}
                                >
Severity: Major
Found in site/src/components/Demo.js and 1 other location - About 1 hr to fix
site/src/components/Learn.js on lines 63..72

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    externals: [
        {
            react: {
                root: "React",
                commonjs2: "react",
Severity: Major
Found in packages/web/webpack.config.umd.js and 1 other location - About 1 hr to fix
packages/maps/webpack.config.umd.js on lines 26..41

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const Select = styled('button')`
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
Severity: Major
Found in packages/web/src/styles/Select.js and 1 other location - About 1 hr to fix
packages/vue/src/styles/Select.js on lines 23..57

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                        {this.props.showClear
                            && this.state.currentDate
                            && this.state.currentDate.end && (
                            <CancelSvg onClick={this.clearDayPickerEnd} />
                        )}
Severity: Major
Found in packages/web/src/components/date/DateRange.js and 1 other location - About 1 hr to fix
packages/web/src/components/date/DateRange.js on lines 350..354

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                        {this.props.showClear
                            && this.state.currentDate
                            && this.state.currentDate.start && (
                            <CancelSvg onClick={this.clearDayPickerStart} />
                        )}
Severity: Major
Found in packages/web/src/components/date/DateRange.js and 1 other location - About 1 hr to fix
packages/web/src/components/date/DateRange.js on lines 401..405

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

const Select = styled('button')`
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
Severity: Major
Found in packages/vue/src/styles/Select.js and 1 other location - About 1 hr to fix
packages/web/src/styles/Select.js on lines 21..54

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    componentWillReceiveProps(nextProps) {
        checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
        checkSomePropChange(this.props, nextProps, ['showHistogram', 'interval'], () =>
            this.updateQueryOptions(nextProps),
        );
Severity: Minor
Found in packages/native/src/components/range/RangeSlider.js - About 1 hr to fix

    Function render has 31 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/ReactiveList/src/index.js - About 1 hr to fix

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

          componentWillReceiveProps(nextProps) {
              checkSomePropChange(
                  this.props,
                  nextProps,
                  ['highlight', 'dataField', 'highlightField'],
      Severity: Minor
      Found in packages/native/src/components/search/DataSearch.js - About 1 hr to fix

        Function render has 31 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/SelectedFilters/src/index.js - About 1 hr to fix

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

              componentWillReceiveProps(nextProps) {
                  checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
                  checkSomePropChange(this.props, nextProps, ['showHistogram', 'interval'], () =>
                      this.updateQueryOptions(nextProps),
                  );
          Severity: Minor
          Found in packages/web/src/components/range/RangeSlider.js - About 1 hr to fix

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

                render() {
                    if (this.$scopedSlots.default) {
                        return this.$scopedSlots.default(this.$props);
                    }
                    const filtersToRender = this.renderFilters();
            Severity: Minor
            Found in packages/vue/src/components/basic/SelectedFilters.jsx - About 1 hr to fix

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

                  render() {
                      if (!this.state.isReady) {
                          return <Text>Loading...</Text>;
                      }
              
              
              Severity: Minor
              Found in packages/maps-native/example/App.js - About 1 hr to fix

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

                        renderFilters() {
                            const { selectedValues } = this;
                            return Object.keys(selectedValues)
                                .filter(
                                    id => this.components.includes(id) && selectedValues[id].showFilter
                Severity: Minor
                Found in packages/vue/src/components/basic/SelectedFilters.jsx - About 1 hr to fix

                  Function render has 30 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/SingleDropdownList/src/index.js - About 1 hr to fix

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

                        booksCard(data) {
                            return {
                                title: (
                                    <div
                                        className="book-title-card text-center"
                    Severity: Minor
                    Found in packages/web/examples/MultiRange/src/index.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language