appbaseio/reactivesearch

View on GitHub

Showing 1,376 of 1,376 total issues

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

            if (this.state.currentPage === i - 1) {
                activeStyles.button = {
                    backgroundColor: this.props.theming.primaryColor,
                };
                activeStyles.text = {
Severity: Major
Found in packages/native/src/components/result/ReactiveList.js and 1 other location - About 1 hr to fix
packages/native/src/components/result/ReactiveList.js on lines 368..375

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

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

    handleLoadMore = () => {
        const queryOptions = SingleList.generateQueryOptions(this.props, this.state.after);
        this.props.loadMore(this.props.componentId, queryOptions);
    };
Severity: Major
Found in packages/web/src/components/list/SingleList.js and 1 other location - About 1 hr to fix
packages/web/src/components/list/MultiList.js on lines 335..338

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

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

const getCompositeAggsQuery = (query, props, after) => {
    const clonedQuery = { ...query };
    // missing label not available in composite aggs
    const { dataField, size, sortBy, showMissing } = props;

Severity: Minor
Found in packages/vue/src/components/list/utils.js - About 1 hr to fix

    Function setValue has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            setValue(value, isDefaultValue = false, props = this.$props, cause) {
                // ignore state updates when component is locked
                if (props.beforeValueChange && this.locked) {
                    return;
                }
    Severity: Minor
    Found in packages/vue/src/components/search/DataSearch.jsx - About 1 hr to fix

      Function getAggsQuery has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const getAggsQuery = (query, props, include) => {
          const clonedQuery = { ...query };
          const {
              dataField, size, sortBy, showMissing, missingLabel,
          } = props;
      Severity: Minor
      Found in packages/web/src/components/list/utils.js - About 1 hr to fix

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

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

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

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

                  render() {
                      return (
                          <Container style={this.props.style} className={this.props.className}>
                              {this.props.title && (
                                  <Title className={getClassName(this.props.innerClass, 'title') || null}>
              Severity: Minor
              Found in packages/web/src/components/range/MultiRange.js - About 1 hr to fix

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

                    componentWillUnmount() {
                        this.props.removeComponent(this.props.componentId);
                
                        if (this.internalComponent) {
                            this.props.removeComponent(this.internalComponent);
                Severity: Major
                Found in packages/web/src/components/basic/ReactiveComponent.js and 1 other location - About 1 hr to fix
                packages/native/src/components/basic/ReactiveComponent.js on lines 79..85

                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 4 locations. Consider refactoring.
                Open

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

                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 4 locations. Consider refactoring.
                Open

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

                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

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

                SingleRange.defaultQuery = (value, props) => {
                    if (value) {
                        return {
                            range: {
                                [props.dataField]: {
                Severity: Major
                Found in packages/vue/src/components/range/SingleRange.jsx and 1 other location - About 1 hr to fix
                packages/native/src/components/range/SingleDropdownRange.js on lines 69..82

                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

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

                    defaultQuery = (value, props) => {
                        if (value) {
                            return {
                                range: {
                                    [props.dataField]: {
                Severity: Major
                Found in packages/native/src/components/range/SingleDropdownRange.js and 1 other location - About 1 hr to fix
                packages/vue/src/components/range/SingleRange.jsx on lines 166..179

                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

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

                        checkSomePropChange(this.props, nextProps, ['dataField', 'nestedField'], () => {
                            this.updateQueryOptions(nextProps);
                            this.updateQuery(Object.keys(this.state.currentValue), nextProps);
                        });
                Severity: Major
                Found in packages/web/src/components/list/MultiList.js and 1 other location - About 1 hr to fix
                packages/web/src/components/basic/TagCloud.js on lines 74..77

                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 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/MultiDropdownList.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/SingleDropdownList.js on lines 274..281

                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

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

                    componentWillUnmount() {
                        this.props.removeComponent(this.props.componentId);
                
                        if (this.internalComponent) {
                            this.props.removeComponent(this.internalComponent);
                Severity: Major
                Found in packages/native/src/components/basic/ReactiveComponent.js and 1 other location - About 1 hr to fix
                packages/web/src/components/basic/ReactiveComponent.js on lines 95..101

                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

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

                        if (
                            this.props.sortBy !== nextProps.sortBy
                            || this.props.size !== nextProps.size
                            || !isEqual(this.props.dataField, nextProps.dataField)
                        ) {
                Severity: Major
                Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 1 hr to fix
                packages/maps/src/components/result/ReactiveMap.js on lines 182..203

                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

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

                        if (
                            this.props.sortBy !== nextProps.sortBy
                            || this.props.size !== nextProps.size
                            || !isEqual(this.props.dataField, nextProps.dataField)
                        ) {
                Severity: Major
                Found in packages/maps/src/components/result/ReactiveMap.js and 1 other location - About 1 hr to fix
                packages/maps-native/src/components/maps/ReactiveMap.js on lines 115..132

                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

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

                        checkSomePropChange(this.props, nextProps, ['dataField', 'nestedField'], () => {
                            this.updateQueryOptions(nextProps);
                            this.updateQuery(Object.keys(this.state.currentValue), nextProps);
                        });
                Severity: Major
                Found in packages/web/src/components/basic/TagCloud.js and 1 other location - About 1 hr to fix
                packages/web/src/components/list/MultiList.js on lines 91..94

                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

                Severity
                Category
                Status
                Source
                Language