appbaseio/reactivesearch

View on GitHub

Showing 1,376 of 1,376 total issues

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

                    footer={
                        showLoadMore
                        && !isLastBucket && (
                            <div css={loadMoreContainer}>
                                <Button onClick={this.handleLoadMore}>{loadMoreLabel}</Button>
Severity: Major
Found in packages/web/src/components/list/SingleDropdownList.js and 3 other locations - About 1 hr to fix
packages/vue/src/components/list/MultiDropdownList.jsx on lines 202..209
packages/vue/src/components/list/SingleDropdownList.jsx on lines 189..196
packages/web/src/components/list/MultiDropdownList.js on lines 369..376

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 61.

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

                            {typeof result.description === 'string' ? (
                                <div {...{ domProps: { innerHTML: result.description } }} />
                            ) : (
                                <div>{result.description}</div>
                            )}
Severity: Major
Found in packages/vue/src/components/result/ResultList.jsx and 1 other location - About 1 hr to fix
packages/vue/src/components/result/ResultCard.jsx on lines 89..93

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 61.

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

        if (this.props.returnsObject) {
            this.props.onChange(item);
        } else {
            this.props.onChange(item[this.props.keyField]);
        }
Severity: Major
Found in packages/web/src/components/shared/Dropdown.js and 1 other location - About 1 hr to fix
packages/vue/src/components/shared/DropDown.jsx on lines 215..219

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 61.

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

    banner7: {
        title: 'Featured Posts',
        articles: [
            {
                src: 'https://cdn-images-1.medium.com/max/2000/1*o4yRyTm2pKfa_Flr3W2TPw.png',
Severity: Major
Found in site/src/constants/config/home/vue.js and 1 other location - About 1 hr to fix
site/src/constants/config/home/vue.js on lines 158..175

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 61.

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

                        {typeof result.description === 'string' ? (
                            <article {...{ domProps: { innerHTML: result.description } }} />
                        ) : (
                            <article>{result.description}</article>
                        )}
Severity: Major
Found in packages/vue/src/components/result/ResultCard.jsx and 1 other location - About 1 hr to fix
packages/vue/src/components/result/ResultList.jsx on lines 95..99

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 61.

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

    histogramQuery = props => ({
        [props.dataField]: {
            histogram: {
                field: props.dataField,
                interval: this.getValidInterval(props),
Severity: Major
Found in packages/web/src/components/range/RangeSlider.js and 1 other location - About 1 hr to fix
packages/native/src/components/range/RangeSlider.js on lines 150..158

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 61.

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

    histogramQuery = props => ({
        [props.dataField]: {
            histogram: {
                field: props.dataField,
                interval: this.getValidInterval(props),
Severity: Major
Found in packages/native/src/components/range/RangeSlider.js and 1 other location - About 1 hr to fix
packages/web/src/components/range/RangeSlider.js on lines 190..198

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 61.

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

            if (this.$props.returnsObject) {
                this.$props.handleChange(item);
            } else {
                this.$props.handleChange(item[this.$props.keyField]);
            }
Severity: Major
Found in packages/vue/src/components/shared/DropDown.jsx and 1 other location - About 1 hr to fix
packages/web/src/components/shared/Dropdown.js on lines 35..39

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 61.

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

    banner6: {
        title: 'Check starter apps',
        demos: [
            {
                src: '../../reactivesearch/images/apps/gitxplore.png',
Severity: Major
Found in site/src/constants/config/home/vue.js and 1 other location - About 1 hr to fix
site/src/constants/config/home/vue.js on lines 176..195

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 61.

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 render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        const { color, ...checkBoxStyles } = getInnerKey(this.props.innerStyle, 'checkbox');
        return (
            <TouchableItem pressOpacity={0.5} delayPressIn={0} onPress={this.handlePress}>
                <View
Severity: Minor
Found in packages/native/src/components/shared/CheckboxItem.js - About 1 hr to fix

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

        render() {
            return (
                <Picker
                    iosHeader="Select one"
                    mode="dropdown"
    Severity: Minor
    Found in packages/native/src/components/range/SingleDropdownRange.js - About 1 hr to fix

      Function componentWillReceiveProps has 32 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(this.state.currentDistance, nextProps);
      Severity: Minor
      Found in packages/maps/src/components/basic/GeoDistanceDropdown.js - About 1 hr to fix

        Function componentWillReceiveProps has 32 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, () => {
                    const { showLoadMore, dataField } = nextProps;
                    if (showLoadMore) {
        Severity: Minor
        Found in packages/web/src/components/list/SingleList.js - About 1 hr to fix

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

              render() {
                  return (
                      <ReactiveBase
                          app="airbeds-test-app"
                          credentials="X8RsOu0Lp:9b4fe1a4-58c6-4089-a042-505d86d9da30"
          Severity: Minor
          Found in packages/web/examples/DatePicker/src/index.js - About 1 hr to fix

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

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

                  render() {
                      return (
                          <ReactiveBase
                              app="airbeds-test-app"
                              credentials="X8RsOu0Lp:9b4fe1a4-58c6-4089-a042-505d86d9da30"
              Severity: Minor
              Found in packages/web/examples/DateRange/src/index.js - About 1 hr to fix

                Function componentWillReceiveProps has 32 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(this.state.currentDistance, nextProps);
                Severity: Minor
                Found in packages/maps/src/components/basic/GeoDistanceSlider.js - About 1 hr to fix

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

                    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));
                    
                            let startDate = null;
                            let endDate = null;
                    Severity: Minor
                    Found in packages/native/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

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

                            getButtonProps({ onClick, onKeyDown, onKeyUp, onBlur }) {
                                return {
                                    click: event => {
                                        this.setState({
                                            isOpen: true,
                    Severity: Minor
                    Found in packages/vue/src/components/basic/DownShift.jsx - 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

                    Severity
                    Category
                    Status
                    Source
                    Language