appbaseio/reactivesearch

View on GitHub
packages/vue/src/components/list/MultiDropdownList.jsx

Summary

Maintainability
F
1 wk
Test Coverage

File MultiDropdownList.jsx has 420 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Actions, helper } from '@appbaseio/reactivecore';
import VueTypes from 'vue-types';
import types from '../../utils/vueTypes';
import { getAggsQuery, getCompositeAggsQuery } from './utils';
import Title from '../../styles/Title';
Severity: Minor
Found in packages/vue/src/components/list/MultiDropdownList.jsx - About 6 hrs to fix

    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

    Function defaultQuery has 75 lines of code (exceeds 25 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: Major
    Found in packages/vue/src/components/list/MultiDropdownList.jsx - About 3 hrs to fix

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

              setValue(value, isDefaultValue = false, props = this.$props) {
                  // ignore state updates when component is locked
                  if (props.beforeValueChange && this.locked) {
                      return;
                  }
      Severity: Major
      Found in packages/vue/src/components/list/MultiDropdownList.jsx - About 2 hrs to fix

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

            render() {
                const { showLoadMore, loadMoreLabel, renderListItem } = this.$props;
                const renderListItemCalc
                    = this.$scopedSlots.renderListItem || renderListItem;
                const { isLastBucket } = this.$data;
        Severity: Major
        Found in packages/vue/src/components/list/MultiDropdownList.jsx - About 2 hrs to fix

          Function setValue has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

                  setValue(value, isDefaultValue = false, props = this.$props) {
                      // ignore state updates when component is locked
                      if (props.beforeValueChange && this.locked) {
                          return;
                      }
          Severity: Minor
          Found in packages/vue/src/components/list/MultiDropdownList.jsx - 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

          Avoid deeply nested control flow statements.
          Open

                          if (hasMissingTerm) {
                              should = should.concat({
                                  bool: {
                                      must_not: {
                                          exists: { field: props.dataField }
          Severity: Major
          Found in packages/vue/src/components/list/MultiDropdownList.jsx - About 45 mins to fix

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

                render() {
                    const { showLoadMore, loadMoreLabel, renderListItem } = this.$props;
                    const renderListItemCalc
                        = this.$scopedSlots.renderListItem || renderListItem;
                    const { isLastBucket } = this.$data;
            Severity: Minor
            Found in packages/vue/src/components/list/MultiDropdownList.jsx - About 25 mins to fix

            Cognitive Complexity

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

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

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

            Further reading

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

                    options(newVal, oldVal) {
                        checkPropChange(oldVal, newVal, () => {
                            const { showLoadMore, dataField } = this.$props;
                            const { modifiedOptions } = this.$data;
                            if (showLoadMore) {
            Severity: Major
            Found in packages/vue/src/components/list/MultiDropdownList.jsx and 1 other location - About 1 day to fix
            packages/vue/src/components/list/SingleDropdownList.jsx on lines 97..124

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

            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

                    selectedValue(newVal) {
                        let selectedValue = Object.keys(this.$data.currentValue);
                        if (this.$props.selectAllLabel) {
                            selectedValue = selectedValue.filter(
                                val => val !== this.$props.selectAllLabel
            Severity: Major
            Found in packages/vue/src/components/list/MultiDropdownList.jsx and 1 other location - About 5 hrs to fix
            packages/vue/src/components/list/MultiList.jsx on lines 115..130

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

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

                    updateQueryHandler(value, props) {
                        const query = props.customQuery || MultiDropdownList.defaultQuery;
                        this.updateQuery({
                            componentId: props.componentId,
                            query: query(value, props),
            Severity: Major
            Found in packages/vue/src/components/list/MultiDropdownList.jsx and 5 other locations - About 3 hrs to fix
            packages/vue/src/components/list/MultiList.jsx on lines 333..344
            packages/vue/src/components/list/SingleDropdownList.jsx on lines 239..250
            packages/vue/src/components/list/SingleList.jsx on lines 280..291
            packages/vue/src/components/range/MultiRange.jsx on lines 91..102
            packages/vue/src/components/range/SingleRange.jsx on lines 145..156

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

            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

                    updateQueryOptions(props, addAfterKey = false) {
                        // when using composite aggs flush the current options for a fresh query
                        if (props.showLoadMore && !addAfterKey) {
                            this.modifiedOptions = [];
                        } // for a new query due to other changes don't append after to get fresh results
            Severity: Major
            Found in packages/vue/src/components/list/MultiDropdownList.jsx and 1 other location - About 3 hrs to fix
            packages/vue/src/components/list/SingleDropdownList.jsx on lines 259..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 96.

            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

                    setReact(props) {
                        const { react } = props;
            
                        if (react) {
                            const newReact = pushToAndClause(react, this.internalComponent);
            Severity: Major
            Found in packages/vue/src/components/list/MultiDropdownList.jsx and 4 other locations - About 2 hrs to fix
            packages/vue/src/components/list/MultiList.jsx on lines 247..258
            packages/vue/src/components/list/SingleDropdownList.jsx on lines 203..214
            packages/vue/src/components/list/SingleList.jsx on lines 239..250
            packages/vue/src/components/result/ReactiveList.jsx on lines 411..422

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

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

                                items={[
                                    ...selectAll,
                                    ...this.$data.modifiedOptions
                                        .filter(item => String(item.key).trim().length)
                                        .map(item => ({
            Severity: Major
            Found in packages/vue/src/components/list/MultiDropdownList.jsx and 4 other locations - About 2 hrs to fix
            packages/native/src/components/list/MultiDropdownList.js on lines 297..302
            packages/vue/src/components/list/SingleDropdownList.jsx on lines 170..178
            packages/web/src/components/list/MultiDropdownList.js on lines 353..358
            packages/web/src/components/list/SingleDropdownList.js on lines 259..264

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

            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.selectedValue) {
                        this.setValue(this.selectedValue, true);
                    } else if (this.$props.defaultSelected) {
                        this.setValue(this.$props.defaultSelected, true);
                    }
            Severity: Major
            Found in packages/vue/src/components/list/MultiDropdownList.jsx and 2 other locations - About 1 hr to fix
            packages/vue/src/components/range/MultiRange.jsx on lines 132..136
            packages/vue/src/components/search/DataSearch.jsx on lines 120..124

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

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

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

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

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

            Refactorings

            Further Reading

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

                            {this.$props.title && (
                                <Title class={getClassName(this.$props.innerClass, 'title') || ''}>
                                    {this.$props.title}
                                </Title>
                            )}
            Severity: Major
            Found in packages/vue/src/components/list/MultiDropdownList.jsx and 3 other locations - About 1 hr to fix
            packages/vue/src/components/list/SingleDropdownList.jsx on lines 163..167
            packages/vue/src/components/list/SingleList.jsx on lines 133..137
            packages/vue/src/components/search/DataSearch.jsx on lines 398..402

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

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

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 61.

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

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

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

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

            Refactorings

            Further Reading

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

                created() {
                    const onQueryChange = (...args) => {
                        this.$emit('queryChange', ...args);
                    };
                    this.setQueryListener(this.$props.componentId, onQueryChange, null);
            Severity: Major
            Found in packages/vue/src/components/list/MultiDropdownList.jsx and 6 other locations - About 1 hr to fix
            packages/vue/src/components/list/MultiList.jsx on lines 69..74
            packages/vue/src/components/list/SingleDropdownList.jsx on lines 70..75
            packages/vue/src/components/list/SingleList.jsx on lines 67..72
            packages/vue/src/components/range/MultiRange.jsx on lines 122..127
            packages/vue/src/components/range/RangeSlider.jsx on lines 125..130
            packages/vue/src/components/range/SingleRange.jsx on lines 38..43

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

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

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

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

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

            Refactorings

            Further Reading

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

                        const performUpdate = () => {
                            this.currentValue = currentValue;
                            this.updateQueryHandler(finalValues, props);
                            this.locked = false;
                            this.$emit('valueChange', finalValues);
            Severity: Major
            Found in packages/vue/src/components/list/MultiDropdownList.jsx and 3 other locations - About 1 hr to fix
            packages/vue/src/components/list/SingleDropdownList.jsx on lines 224..229
            packages/vue/src/components/list/SingleList.jsx on lines 265..270
            packages/vue/src/components/range/SingleRange.jsx on lines 130..135

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

            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

            MultiDropdownList.generateQueryOptions = (props, after) => {
                const queryOptions = getQueryOptions(props);
                return props.showLoadMore
                    ? getCompositeAggsQuery(queryOptions, props, after)
                    : getAggsQuery(queryOptions, props);
            Severity: Minor
            Found in packages/vue/src/components/list/MultiDropdownList.jsx and 1 other location - About 55 mins to fix
            packages/vue/src/components/list/SingleDropdownList.jsx on lines 318..323

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

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

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

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

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

            Refactorings

            Further Reading

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

                    dataField() {
                        this.updateQueryOptions(this.$props);
                        this.updateQueryHandler(this.$data.currentValue, this.$props);
                    },
            Severity: Major
            Found in packages/vue/src/components/list/MultiDropdownList.jsx and 3 other locations - About 35 mins to fix
            packages/vue/src/components/list/MultiList.jsx on lines 106..109
            packages/vue/src/components/list/SingleDropdownList.jsx on lines 128..131
            packages/vue/src/components/list/SingleList.jsx on lines 105..108

            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

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

                    generateQueryOptions(props, after) {
                        const queryOptions = getQueryOptions(props);
                        return props.showLoadMore
                            ? getCompositeAggsQuery(queryOptions, props, after)
                            : getAggsQuery(queryOptions, props);
            Severity: Minor
            Found in packages/vue/src/components/list/MultiDropdownList.jsx and 1 other location - About 30 mins to fix
            packages/vue/src/components/list/SingleDropdownList.jsx on lines 252..257

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

            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