appbaseio/reactivesearch

View on GitHub
packages/web/src/components/result/ReactiveList.js

Summary

Maintainability
F
1 wk
Test Coverage

File ReactiveList.js has 628 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Component } from 'react';

import {
    addComponent,
    removeComponent,
Severity: Major
Found in packages/web/src/components/result/ReactiveList.js - About 1 day to fix

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

        componentWillReceiveProps(nextProps) {
            const totalPages = Math.ceil(nextProps.total / nextProps.size) || 0;
    
            if (
                !isEqual(this.props.sortOptions, nextProps.sortOptions)
    Severity: Minor
    Found in packages/web/src/components/result/ReactiveList.js - About 1 day 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 147 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        componentWillReceiveProps(nextProps) {
            const totalPages = Math.ceil(nextProps.total / nextProps.size) || 0;
    
            if (
                !isEqual(this.props.sortOptions, nextProps.sortOptions)
    Severity: Major
    Found in packages/web/src/components/result/ReactiveList.js - About 5 hrs to fix

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

          render() {
              const { onData, size } = this.props;
              const { currentPage } = this.state;
              const results = parseHits(this.props.hits) || [];
              const streamResults = parseHits(this.props.streamHits) || [];
      Severity: Major
      Found in packages/web/src/components/result/ReactiveList.js - About 3 hrs to fix

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

            render() {
                const { onData, size } = this.props;
                const { currentPage } = this.state;
                const results = parseHits(this.props.hits) || [];
                const streamResults = parseHits(this.props.streamHits) || [];
        Severity: Minor
        Found in packages/web/src/components/result/ReactiveList.js - About 2 hrs 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 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            componentDidMount() {
                this.props.addComponent(this.internalComponent);
                this.props.addComponent(this.props.componentId);
        
                if (this.props.stream) {
        Severity: Major
        Found in packages/web/src/components/result/ReactiveList.js - About 2 hrs to fix

          Function componentDidMount has a Cognitive Complexity of 12 (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/web/src/components/result/ReactiveList.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

          Consider simplifying this complex logical expression.
          Open

                  if (
                      !isEqual(this.props.sortOptions, nextProps.sortOptions)
                      || this.props.sortBy !== nextProps.sortBy
                      || this.props.size !== nextProps.size
                      || !isEqual(this.props.dataField, nextProps.dataField)
          Severity: Major
          Found in packages/web/src/components/result/ReactiveList.js - About 40 mins to fix

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

            const mapStateToProps = (state, props) => ({
                defaultPage:
                    (state.selectedValues[props.componentId]
                        && state.selectedValues[props.componentId].value - 1)
                    || -1,
            Severity: Minor
            Found in packages/web/src/components/result/ReactiveList.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

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

                    if (
                        !isEqual(this.props.sortOptions, nextProps.sortOptions)
                        || this.props.sortBy !== nextProps.sortBy
                        || this.props.size !== nextProps.size
                        || !isEqual(this.props.dataField, nextProps.dataField)
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 1 day to fix
            packages/native/src/components/result/ReactiveList.js on lines 120..148

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

            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 (nextProps.defaultQuery && !isEqual(nextProps.defaultQuery(), this.defaultQuery)) {
                        const options = getQueryOptions(nextProps);
                        options.from = 0;
                        this.defaultQuery = nextProps.defaultQuery();
            
            
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 1 day to fix
            packages/native/src/components/result/ReactiveList.js on lines 150..180

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

            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.pagination
                            && (this.props.paginationAt === 'top' || this.props.paginationAt === 'both')
                                ? (
                                    <Pagination
                                        pages={this.props.pages}
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 6 hrs to fix
            packages/web/src/components/result/ReactiveList.js on lines 589..600

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

            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.pagination
                            && (this.props.paginationAt === 'bottom' || this.props.paginationAt === 'both')
                                ? (
                                    <Pagination
                                        pages={this.props.pages}
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 6 hrs to fix
            packages/web/src/components/result/ReactiveList.js on lines 547..558

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

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

                    if (this.props.sortOptions) {
                        options.sort = [
                            {
                                [this.props.sortOptions[0].dataField]: {
                                    order: this.props.sortOptions[0].sortBy,
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 2 other locations - About 4 hrs to fix
            packages/native/src/components/result/ReactiveList.js on lines 60..76
            packages/vue/src/components/result/ReactiveList.jsx on lines 220..236

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

            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

                    <select
                        className={`${sortOptions} ${getClassName(this.props.innerClass, 'sortOptions')}`}
                        name="sort-options"
                        onChange={this.handleSortChange}
                    >
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 4 hrs to fix
            packages/vue/src/components/result/ReactiveList.jsx on lines 554..564

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

            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

                            <Flex
                                labelPosition={this.props.sortOptions ? 'right' : 'left'}
                                className={getClassName(this.props.innerClass, 'resultsInfo')}
                            >
                                {this.props.sortOptions ? this.renderSortOptions() : null}
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 3 hrs to fix
            packages/vue/src/components/result/ReactiveList.jsx on lines 306..312

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

            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 (config.analytics && url.endsWith('scalr.api.appbase.io') && searchId) {
                        fetch(`${url}/${app}/analytics`, {
                            method: 'POST',
                            headers: {
                                'Content-Type': 'application/json',
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 3 hrs to fix
            packages/vue/src/components/result/ReactiveList.jsx on lines 538..549

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

            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

                    } else if (this.props.total) {
                        return (
                            <p
                                className={`${resultStats} ${getClassName(
                                    this.props.innerClass,
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 2 hrs to fix
            packages/vue/src/components/result/ReactiveList.jsx on lines 490..502

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

            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.defaultQuery) {
                        this.props.updateQuery(
                            {
                                componentId: this.internalComponent,
                                query,
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 2 hrs to fix
            packages/native/src/components/result/ReactiveList.js on lines 97..113

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

            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.defaultPage >= 0) {
                        currentPage = this.props.defaultPage;
                    } else if (this.props.currentPage) {
                        currentPage = Math.max(this.props.currentPage - 1, 0);
                    }
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 2 hrs to fix
            packages/native/src/components/result/ReactiveList.js on lines 33..37

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

            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.defaultQuery) {
                        this.defaultQuery = this.props.defaultQuery();
                        if (this.defaultQuery.sort) {
                            options.sort = this.defaultQuery.sort;
                        }
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 1 hr to fix
            packages/native/src/components/result/ReactiveList.js on lines 80..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 71.

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

                    if (streamResults.length) {
                        const ids = streamResults.map(item => item._id);
                        filteredResults = filteredResults.filter(item => !ids.includes(item._id));
                    }
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 4 other locations - About 1 hr to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 396..399
            packages/maps/src/components/result/ReactiveMap.js on lines 863..866
            packages/native/src/components/result/ReactiveList.js on lines 489..492
            packages/vue/src/components/result/ReactiveList.jsx on lines 296..299

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

            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

                updatePageURL = (page) => {
                    if (this.props.URLParams) {
                        this.props.setPageURL(
                            this.props.componentId,
                            page + 1,
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 1 hr to fix
            packages/native/src/components/result/ReactiveList.js on lines 229..239

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

            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

                    options.sort = [
                        {
                            [this.props.sortOptions[index].dataField]: {
                                order: this.props.sortOptions[index].sortBy,
                            },
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 1 hr to fix
            packages/vue/src/components/result/ReactiveList.jsx on lines 520..526

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

            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.isLoading && (results.length === 0 && streamResults.length === 0)
                                ? this.renderNoResults()
                                : null}
            Severity: Minor
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 45 mins to fix
            packages/native/src/components/result/ReactiveList.js on lines 500..502

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

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

                    if (this.props.stream !== nextProps.stream) {
                        this.props.setStreaming(nextProps.componentId, nextProps.stream);
                    }
            Severity: Major
            Found in packages/web/src/components/result/ReactiveList.js and 3 other locations - About 35 mins to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 149..151
            packages/maps/src/components/result/ReactiveMap.js on lines 242..244
            packages/native/src/components/result/ReactiveList.js on lines 182..184

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

            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

                defaultPage:
                    (state.selectedValues[props.componentId]
                        && state.selectedValues[props.componentId].value - 1)
                    || -1,
            Severity: Minor
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 35 mins to fix
            packages/vue/src/components/result/ReactiveList.jsx on lines 570..573

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

            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.config.url.endsWith('appbase.io') && results.length ? (
                                <Flex
                                    direction="row-reverse"
                                    className={getClassName(this.props.innerClass, 'poweredBy')}
                                >
            Severity: Minor
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 35 mins to fix
            packages/vue/src/components/result/ReactiveList.jsx on lines 375..382

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

            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

                                <div
                                    className={`${this.props.listClass} ${getClassName(
                                        this.props.innerClass,
                                        'list',
                                    )}`}
            Severity: Minor
            Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 35 mins to fix
            packages/vue/src/components/result/ReactiveList.jsx on lines 337..350

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

            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

            There are no issues that match your filters.

            Category
            Status