appbaseio/reactivesearch

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

Summary

Maintainability
F
1 wk
Test Coverage

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

import React, { Component } from 'react';
import { View } from 'react-native';
import { Text, Spinner, Button, Icon } from 'native-base';

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

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

        componentWillReceiveProps(nextProps) {
            if (
                !isEqual(this.props.sortOptions, nextProps.sortOptions)
                || this.props.sortBy !== nextProps.sortBy
                || this.props.size !== nextProps.size
    Severity: Major
    Found in packages/native/src/components/result/ReactiveList.js - About 3 hrs to fix

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

          componentWillReceiveProps(nextProps) {
              if (
                  !isEqual(this.props.sortOptions, nextProps.sortOptions)
                  || this.props.sortBy !== nextProps.sortBy
                  || this.props.size !== nextProps.size
      Severity: Minor
      Found in packages/native/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 52 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/native/src/components/result/ReactiveList.js - About 2 hrs to fix

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

            render() {
                const results = parseHits(this.props.hits) || [];
                const streamResults = parseHits(this.props.streamHits) || [];
                let filteredResults = results;
        
        
        Severity: Minor
        Found in packages/native/src/components/result/ReactiveList.js - About 1 hr to fix

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

              componentDidMount() {
                  this.props.addComponent(this.internalComponent);
                  this.props.addComponent(this.props.componentId);
          
                  if (this.props.stream) {
          Severity: Minor
          Found in packages/native/src/components/result/ReactiveList.js - About 55 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

              render() {
                  const results = parseHits(this.props.hits) || [];
                  const streamResults = parseHits(this.props.streamHits) || [];
                  let filteredResults = results;
          
          
          Severity: Minor
          Found in packages/native/src/components/result/ReactiveList.js - About 55 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          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/native/src/components/result/ReactiveList.js - About 40 mins to fix

            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/native/src/components/result/ReactiveList.js and 1 other location - About 1 day to fix
            packages/web/src/components/result/ReactiveList.js on lines 130..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 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/native/src/components/result/ReactiveList.js and 1 other location - About 1 day to fix
            packages/web/src/components/result/ReactiveList.js on lines 160..190

            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

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

                loadMore = () => {
                    if (
                        this.props.hits
                        && !this.props.pagination
                        && this.props.total !== this.props.hits.length
            Severity: Major
            Found in packages/native/src/components/result/ReactiveList.js and 2 other locations - About 1 day to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 279..305
            packages/maps/src/components/result/ReactiveMap.js on lines 495..521

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

            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

                            <Button
                                onPress={this.nextPage}
                                light={this.state.currentPage < this.state.totalPages - 1}
                                disabled={this.state.currentPage >= this.state.totalPages - 1}
                                style={getInnerKey(this.props.innerStyle, 'button')}
            Severity: Major
            Found in packages/native/src/components/result/ReactiveList.js and 1 other location - About 6 hrs to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 623..635

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

            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

                            <Button
                                light={this.state.currentPage !== 0}
                                disabled={this.state.currentPage === 0}
                                onPress={this.prevPage}
                                style={getInnerKey(this.props.innerStyle, 'button')}
            Severity: Major
            Found in packages/native/src/components/result/ReactiveList.js and 1 other location - About 5 hrs to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 568..580

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

            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/native/src/components/result/ReactiveList.js and 2 other locations - About 4 hrs to fix
            packages/vue/src/components/result/ReactiveList.jsx on lines 220..236
            packages/web/src/components/result/ReactiveList.js on lines 59..75

            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

                            {this.state.currentPage >= this.props.pages ? (
                                <View
                                    style={{
                                        height: 45,
                                        display: 'flex',
            Severity: Major
            Found in packages/native/src/components/result/ReactiveList.js and 1 other location - About 4 hrs to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 605..621

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

            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

                setPage = (page) => {
                    const value = this.props.size * page;
                    const options = getQueryOptions(this.props);
                    this.setState({
                        from: value,
            Severity: Major
            Found in packages/native/src/components/result/ReactiveList.js and 1 other location - About 3 hrs to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 465..481

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

            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 (
                        !nextProps.pagination
                        && this.props.hits
                        && nextProps.hits
                        && (this.props.hits.length < nextProps.hits.length
            Severity: Major
            Found in packages/native/src/components/result/ReactiveList.js and 2 other locations - About 3 hrs to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 167..177
            packages/maps/src/components/result/ReactiveMap.js on lines 260..270

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

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

                setReact = (props) => {
                    const { react } = props;
                    if (react) {
                        const newReact = pushToAndClause(react, this.internalComponent);
                        props.watchComponent(props.componentId, newReact);
            Severity: Major
            Found in packages/native/src/components/result/ReactiveList.js and 14 other locations - About 2 hrs to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 215..223
            packages/maps/src/components/result/ReactiveMap.js on lines 350..358
            packages/native/src/components/list/MultiDropdownList.js on lines 99..107
            packages/native/src/components/list/SingleDropdownList.js on lines 83..91
            packages/native/src/components/range/RangeSlider.js on lines 110..118
            packages/native/src/components/search/DataSearch.js on lines 108..116
            packages/web/src/components/basic/TagCloud.js on lines 97..107
            packages/web/src/components/list/MultiDropdownList.js on lines 123..133
            packages/web/src/components/list/MultiList.js on lines 117..127
            packages/web/src/components/list/SingleDropdownList.js on lines 112..122
            packages/web/src/components/list/SingleList.js on lines 108..118
            packages/web/src/components/range/RangeSlider.js on lines 115..125
            packages/web/src/components/search/CategorySearch.js on lines 144..154
            packages/web/src/components/search/DataSearch.js on lines 121..131

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

            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/native/src/components/result/ReactiveList.js and 1 other location - About 2 hrs to fix
            packages/web/src/components/result/ReactiveList.js on lines 96..112

            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/native/src/components/result/ReactiveList.js and 1 other location - About 2 hrs to fix
            packages/web/src/components/result/ReactiveList.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 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/native/src/components/result/ReactiveList.js and 1 other location - About 1 hr to fix
            packages/web/src/components/result/ReactiveList.js on lines 79..84

            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/native/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/vue/src/components/result/ReactiveList.jsx on lines 296..299
            packages/web/src/components/result/ReactiveList.js on lines 529..532

            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

                getStart = () => {
                    const midValue = parseInt(this.props.pages / 2, 10);
                    const start = this.state.currentPage - midValue;
                    return start > 1 ? start : 2;
                };
            Severity: Major
            Found in packages/native/src/components/result/ReactiveList.js and 1 other location - About 1 hr to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 495..499

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

            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/native/src/components/result/ReactiveList.js and 1 other location - About 1 hr to fix
            packages/web/src/components/result/ReactiveList.js on lines 475..485

            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

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

                nextPage = () => {
                    if (this.state.currentPage < this.state.totalPages - 1) {
                        this.setPage(this.state.currentPage + 1);
                    }
                };
            Severity: Major
            Found in packages/native/src/components/result/ReactiveList.js and 1 other location - About 1 hr to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 489..493

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

            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

                                <Button
                                    onPress={() => this.setPage(0)}
                                    light={this.state.currentPage !== 0}
                                    style={{
                                        ...primaryStyles.button,
            Severity: Major
            Found in packages/native/src/components/result/ReactiveList.js and 1 other location - About 1 hr to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 582..603

            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

                        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

                    if (this.state.currentPage === 0) {
                        primaryStyles.button = {
                            backgroundColor: this.props.theming.primaryColor,
                        };
                        primaryStyles.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 325..332

            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

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

                            <Button
                                key={i - 1}
                                onPress={() => this.setPage(i - 1)}
                                light={this.state.currentPage !== i - 1}
                                style={{
            Severity: Minor
            Found in packages/native/src/components/result/ReactiveList.js and 1 other location - About 45 mins to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 518..534

            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

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

                            {!this.state.isLoading && (results.length === 0 && streamResults.length === 0)
                                ? this.renderNoResults()
                                : null}
            Severity: Minor
            Found in packages/native/src/components/result/ReactiveList.js and 1 other location - About 45 mins to fix
            packages/web/src/components/result/ReactiveList.js on lines 544..546

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

                prevPage = () => {
                    if (this.state.currentPage) {
                        this.setPage(this.state.currentPage - 1);
                    }
                };
            Severity: Minor
            Found in packages/native/src/components/result/ReactiveList.js and 1 other location - About 40 mins to fix
            packages/maps-native/src/components/maps/ReactiveMap.js on lines 483..487

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

            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/native/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/web/src/components/result/ReactiveList.js on lines 192..194

            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

            There are no issues that match your filters.

            Category
            Status