appbaseio/reactivesearch

View on GitHub

Showing 1,376 of 1,376 total issues

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

const Card = styled('a')`
    width: auto;
    flex-grow: 1;
    outline: none;
    text-decoration: none;
Severity: Major
Found in packages/web/src/styles/Card.js and 1 other location - About 3 hrs to fix
packages/vue/src/styles/Card.js on lines 30..91

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

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

class Topic extends Component {
    handleClick = () => {
        this.props.toggleTopic(this.props.children);
    }
    render() {
Severity: Major
Found in site/demos/gitxplore/src/components/Topic.js and 1 other location - About 3 hrs to fix
site/demos/gitxplore-dark/src/components/Topic.js on lines 6..17

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

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

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

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

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

Refactorings

Further Reading

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

    render() {
        let markedDates = {};
        const current = this.state.currentDate
            ? this.state.currentDate.start.dateString
            : this.props.startDate || Date();
Severity: Minor
Found in packages/native/src/components/date/DateRange.js - About 3 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 defaultQuery has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

MultiDropdownList.defaultQuery = (value, props) => {
    let query = null;
    const type = props.queryFormat === 'or' ? 'terms' : 'term';

    if (!Array.isArray(value) || value.length === 0) {
Severity: Minor
Found in packages/vue/src/components/list/MultiDropdownList.jsx - About 3 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

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

    constructor(props) {
        super(props);

        this.state = {
            currentValue: '',
Severity: Major
Found in packages/web/src/components/search/CategorySearch.js and 1 other location - About 3 hrs to fix
packages/web/src/components/search/DataSearch.js on lines 34..45

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

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

    constructor(props) {
        super(props);

        this.state = {
            currentValue: '',
Severity: Major
Found in packages/web/src/components/search/DataSearch.js and 1 other location - About 3 hrs to fix
packages/web/src/components/search/CategorySearch.js on lines 45..56

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

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

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

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

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

Refactorings

Further Reading

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

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

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

        updateQuery = (value, props) => {
            const query = props.customQuery || SingleRange.defaultQuery;
    
            props.updateQuery({
                componentId: props.componentId,
    Severity: Major
    Found in packages/web/src/components/range/SingleRange.js and 10 other locations - About 3 hrs to fix
    packages/web/src/components/basic/TagCloud.js on lines 202..214
    packages/web/src/components/date/DatePicker.js on lines 152..164
    packages/web/src/components/list/MultiDropdownList.js on lines 284..296
    packages/web/src/components/list/MultiList.js on lines 292..304
    packages/web/src/components/list/SingleDropdownList.js on lines 189..201
    packages/web/src/components/list/SingleList.js on lines 199..211
    packages/web/src/components/range/MultiDropdownRange.js on lines 170..182
    packages/web/src/components/range/MultiRange.js on lines 173..185
    packages/web/src/components/range/RatingsFilter.js on lines 138..150
    packages/web/src/components/range/SingleDropdownRange.js on lines 131..143

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

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

        updateQuery = (value, props) => {
            const query = props.customQuery || SingleList.defaultQuery;
    
            props.updateQuery({
                componentId: props.componentId,
    Severity: Major
    Found in packages/web/src/components/list/SingleList.js and 10 other locations - About 3 hrs to fix
    packages/web/src/components/basic/TagCloud.js on lines 202..214
    packages/web/src/components/date/DatePicker.js on lines 152..164
    packages/web/src/components/list/MultiDropdownList.js on lines 284..296
    packages/web/src/components/list/MultiList.js on lines 292..304
    packages/web/src/components/list/SingleDropdownList.js on lines 189..201
    packages/web/src/components/range/MultiDropdownRange.js on lines 170..182
    packages/web/src/components/range/MultiRange.js on lines 173..185
    packages/web/src/components/range/RatingsFilter.js on lines 138..150
    packages/web/src/components/range/SingleDropdownRange.js on lines 131..143
    packages/web/src/components/range/SingleRange.js on lines 127..139

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

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

        updateQuery = (value, props) => {
            const query = props.customQuery || DatePicker.defaultQuery;
    
            props.updateQuery({
                componentId: props.componentId,
    Severity: Major
    Found in packages/web/src/components/date/DatePicker.js and 10 other locations - About 3 hrs to fix
    packages/web/src/components/basic/TagCloud.js on lines 202..214
    packages/web/src/components/list/MultiDropdownList.js on lines 284..296
    packages/web/src/components/list/MultiList.js on lines 292..304
    packages/web/src/components/list/SingleDropdownList.js on lines 189..201
    packages/web/src/components/list/SingleList.js on lines 199..211
    packages/web/src/components/range/MultiDropdownRange.js on lines 170..182
    packages/web/src/components/range/MultiRange.js on lines 173..185
    packages/web/src/components/range/RatingsFilter.js on lines 138..150
    packages/web/src/components/range/SingleDropdownRange.js on lines 131..143
    packages/web/src/components/range/SingleRange.js on lines 127..139

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

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

        updateQuery = (value, props) => {
            const query = props.customQuery || RatingsFilter.defaultQuery;
    
            props.updateQuery({
                componentId: props.componentId,
    Severity: Major
    Found in packages/web/src/components/range/RatingsFilter.js and 10 other locations - About 3 hrs to fix
    packages/web/src/components/basic/TagCloud.js on lines 202..214
    packages/web/src/components/date/DatePicker.js on lines 152..164
    packages/web/src/components/list/MultiDropdownList.js on lines 284..296
    packages/web/src/components/list/MultiList.js on lines 292..304
    packages/web/src/components/list/SingleDropdownList.js on lines 189..201
    packages/web/src/components/list/SingleList.js on lines 199..211
    packages/web/src/components/range/MultiDropdownRange.js on lines 170..182
    packages/web/src/components/range/MultiRange.js on lines 173..185
    packages/web/src/components/range/SingleDropdownRange.js on lines 131..143
    packages/web/src/components/range/SingleRange.js on lines 127..139

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

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

        updateQuery = (value, props) => {
            const query = props.customQuery || MultiRange.defaultQuery;
    
            props.updateQuery({
                componentId: props.componentId,
    Severity: Major
    Found in packages/web/src/components/range/MultiRange.js and 10 other locations - About 3 hrs to fix
    packages/web/src/components/basic/TagCloud.js on lines 202..214
    packages/web/src/components/date/DatePicker.js on lines 152..164
    packages/web/src/components/list/MultiDropdownList.js on lines 284..296
    packages/web/src/components/list/MultiList.js on lines 292..304
    packages/web/src/components/list/SingleDropdownList.js on lines 189..201
    packages/web/src/components/list/SingleList.js on lines 199..211
    packages/web/src/components/range/MultiDropdownRange.js on lines 170..182
    packages/web/src/components/range/RatingsFilter.js on lines 138..150
    packages/web/src/components/range/SingleDropdownRange.js on lines 131..143
    packages/web/src/components/range/SingleRange.js on lines 127..139

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

    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

        dateQuery(value) {
            let query = null;
            if (value) {
                query = [
                    {
    Severity: Major
    Found in packages/web/examples/DateRange/src/index.js and 1 other location - About 3 hrs to fix
    packages/web/examples/ssr/pages/daterange.js on lines 10..31

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

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

        updateQuery = (value, props) => {
            const query = props.customQuery || MultiDropdownList.defaultQuery;
    
            props.updateQuery({
                componentId: props.componentId,
    Severity: Major
    Found in packages/web/src/components/list/MultiDropdownList.js and 10 other locations - About 3 hrs to fix
    packages/web/src/components/basic/TagCloud.js on lines 202..214
    packages/web/src/components/date/DatePicker.js on lines 152..164
    packages/web/src/components/list/MultiList.js on lines 292..304
    packages/web/src/components/list/SingleDropdownList.js on lines 189..201
    packages/web/src/components/list/SingleList.js on lines 199..211
    packages/web/src/components/range/MultiDropdownRange.js on lines 170..182
    packages/web/src/components/range/MultiRange.js on lines 173..185
    packages/web/src/components/range/RatingsFilter.js on lines 138..150
    packages/web/src/components/range/SingleDropdownRange.js on lines 131..143
    packages/web/src/components/range/SingleRange.js on lines 127..139

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

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

        updateQuery = (value, props) => {
            const query = props.customQuery || MultiList.defaultQuery;
    
            props.updateQuery({
                componentId: props.componentId,
    Severity: Major
    Found in packages/web/src/components/list/MultiList.js and 10 other locations - About 3 hrs to fix
    packages/web/src/components/basic/TagCloud.js on lines 202..214
    packages/web/src/components/date/DatePicker.js on lines 152..164
    packages/web/src/components/list/MultiDropdownList.js on lines 284..296
    packages/web/src/components/list/SingleDropdownList.js on lines 189..201
    packages/web/src/components/list/SingleList.js on lines 199..211
    packages/web/src/components/range/MultiDropdownRange.js on lines 170..182
    packages/web/src/components/range/MultiRange.js on lines 173..185
    packages/web/src/components/range/RatingsFilter.js on lines 138..150
    packages/web/src/components/range/SingleDropdownRange.js on lines 131..143
    packages/web/src/components/range/SingleRange.js on lines 127..139

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

    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

                        <div className="col">
                            <MultiRange
                                title="MultiRange"
                                componentId="BookSensor"
                                dataField="average_rating"
    Severity: Major
    Found in packages/web/examples/MultiRange/src/index.js and 2 other locations - About 3 hrs to fix
    packages/web/examples/ResultCard/src/index.js on lines 16..27
    packages/web/examples/ResultList/src/index.js on lines 16..27

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

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

        updateQuery = (value, props) => {
            const query = props.customQuery || TagCloud.defaultQuery;
    
            props.updateQuery({
                componentId: props.componentId,
    Severity: Major
    Found in packages/web/src/components/basic/TagCloud.js and 10 other locations - About 3 hrs to fix
    packages/web/src/components/date/DatePicker.js on lines 152..164
    packages/web/src/components/list/MultiDropdownList.js on lines 284..296
    packages/web/src/components/list/MultiList.js on lines 292..304
    packages/web/src/components/list/SingleDropdownList.js on lines 189..201
    packages/web/src/components/list/SingleList.js on lines 199..211
    packages/web/src/components/range/MultiDropdownRange.js on lines 170..182
    packages/web/src/components/range/MultiRange.js on lines 173..185
    packages/web/src/components/range/RatingsFilter.js on lines 138..150
    packages/web/src/components/range/SingleDropdownRange.js on lines 131..143
    packages/web/src/components/range/SingleRange.js on lines 127..139

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

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

        updateQuery = (value, props) => {
            const query = props.customQuery || MultiDropdownRange.defaultQuery;
    
            props.updateQuery({
                componentId: props.componentId,
    Severity: Major
    Found in packages/web/src/components/range/MultiDropdownRange.js and 10 other locations - About 3 hrs to fix
    packages/web/src/components/basic/TagCloud.js on lines 202..214
    packages/web/src/components/date/DatePicker.js on lines 152..164
    packages/web/src/components/list/MultiDropdownList.js on lines 284..296
    packages/web/src/components/list/MultiList.js on lines 292..304
    packages/web/src/components/list/SingleDropdownList.js on lines 189..201
    packages/web/src/components/list/SingleList.js on lines 199..211
    packages/web/src/components/range/MultiRange.js on lines 173..185
    packages/web/src/components/range/RatingsFilter.js on lines 138..150
    packages/web/src/components/range/SingleDropdownRange.js on lines 131..143
    packages/web/src/components/range/SingleRange.js on lines 127..139

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

    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

    const dateQuery = (value) => {
        let query = null;
        if (value) {
            query = [
                {
    Severity: Major
    Found in packages/web/examples/ssr/pages/daterange.js and 1 other location - About 3 hrs to fix
    packages/web/examples/DateRange/src/index.js on lines 10..31

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

    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

                        <div className="col">
                            <SingleDropdownRange
                                componentId="BookSensor"
                                dataField="average_rating"
                                title="SingleDropdownRange"
    Severity: Major
    Found in packages/web/examples/ResultCard/src/index.js and 2 other locations - About 3 hrs to fix
    packages/web/examples/MultiRange/src/index.js on lines 16..27
    packages/web/examples/ResultList/src/index.js on lines 16..27

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

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

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

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

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

    Refactorings

    Further Reading

    Severity
    Category
    Status
    Source
    Language