appbaseio/reactivesearch

View on GitHub

Showing 1,376 of 1,376 total issues

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

export const queries = Object.keys(breakpoints).reduce((acc, label) => {
    const accumulator = acc;
    if (typeof breakpoints[label] === 'string') {
        accumulator[label] = (...args) =>
            css`
Severity: Major
Found in site/demos/gitxplore-dark/src/styles/mediaQueries.js and 4 other locations - About 6 hrs to fix
site/demos/ecommerce/src/styles/mediaQueries.js on lines 14..33
site/demos/gitxplore/src/styles/mediaQueries.js on lines 13..32
site/demos/producthunt/src/styles/mediaQueries.js on lines 13..32
site/demos/technews/src/styles/mediaQueries.js on lines 12..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 156.

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

File index.js has 415 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import styled, { css } from 'react-emotion';

const lightFont = css`
    font-weight: 300;
`;
Severity: Minor
Found in site/src/styles/index.js - About 5 hrs to fix

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

        render() {
            let suggestionsList = [];
            let finalSuggestionsList = [];
            const {
                theme,
    Severity: Major
    Found in packages/web/src/components/search/CategorySearch.js - About 5 hrs to fix

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

          renderIcons = () => (
              <div>
                  {this.state.currentValue && this.props.showClear && (
                      <InputIcon
                          onClick={this.clearValue}
      Severity: Major
      Found in packages/web/src/components/search/CategorySearch.js and 1 other location - About 5 hrs to fix
      packages/web/src/components/search/DataSearch.js on lines 426..445

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

      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

          renderIcons = () => (
              <div>
                  {this.state.currentValue
                      && this.props.showClear && (
                      <InputIcon
      Severity: Major
      Found in packages/web/src/components/search/DataSearch.js and 1 other location - About 5 hrs to fix
      packages/web/src/components/search/CategorySearch.js on lines 472..490

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

      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

      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(
      Severity: Major
      Found in packages/vue/src/components/list/MultiList.jsx and 1 other location - About 5 hrs to fix
      packages/vue/src/components/list/MultiDropdownList.jsx on lines 101..114

      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

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

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

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

            componentWillMount() {
                this.props.addComponent(this.internalComponent);
                this.props.addComponent(this.props.componentId);
                this.updateQueryOptions(this.props);
        
        
        Severity: Major
        Found in packages/web/src/components/basic/TagCloud.js and 3 other locations - About 5 hrs to fix
        packages/native/src/components/list/MultiDropdownList.js on lines 45..57
        packages/web/src/components/list/MultiDropdownList.js on lines 45..57
        packages/web/src/components/list/MultiList.js on lines 51..63

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

        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

            componentDidMount() {
                this.props.addComponent(this.internalComponent);
                this.props.addComponent(this.props.componentId);
                this.updateQueryOptions(this.props);
        
        
        Severity: Major
        Found in packages/native/src/components/list/MultiDropdownList.js and 3 other locations - About 5 hrs to fix
        packages/web/src/components/basic/TagCloud.js on lines 47..59
        packages/web/src/components/list/MultiDropdownList.js on lines 45..57
        packages/web/src/components/list/MultiList.js on lines 51..63

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

        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

            componentWillMount() {
                this.props.addComponent(this.internalComponent);
                this.props.addComponent(this.props.componentId);
                this.updateQueryOptions(this.props);
        
        
        Severity: Major
        Found in packages/web/src/components/list/MultiList.js and 3 other locations - About 5 hrs to fix
        packages/native/src/components/list/MultiDropdownList.js on lines 45..57
        packages/web/src/components/basic/TagCloud.js on lines 47..59
        packages/web/src/components/list/MultiDropdownList.js on lines 45..57

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

        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

            componentWillMount() {
                this.props.addComponent(this.internalComponent);
                this.props.addComponent(this.props.componentId);
                this.updateQueryOptions(this.props);
        
        
        Severity: Major
        Found in packages/web/src/components/list/MultiDropdownList.js and 3 other locations - About 5 hrs to fix
        packages/native/src/components/list/MultiDropdownList.js on lines 45..57
        packages/web/src/components/basic/TagCloud.js on lines 47..59
        packages/web/src/components/list/MultiList.js on lines 51..63

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

        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

            updateStateOptions = (bucket) => {
                if (bucket) {
                    const bucketDictionary = bucket.reduce(
                        (obj, item) => ({
                            ...obj,
        Severity: Major
        Found in packages/web/src/components/list/MultiDataList.js and 1 other location - About 5 hrs to fix
        packages/web/src/components/list/SingleDataList.js on lines 192..218

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

        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

            defaultQuery = (values, props) => {
                const generateRangeQuery = (dataField, items) => {
                    if (items.length > 0) {
                        return items.map(value => ({
                            range: {
        Severity: Major
        Found in packages/native/src/components/range/MultiDropdownRange.js and 1 other location - About 5 hrs to fix
        packages/vue/src/components/range/MultiRange.jsx on lines 194..221

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

        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

        MultiRange.defaultQuery = (values, props) => {
            const generateRangeQuery = (dataField, items) => {
                if (items.length > 0) {
                    return items.map(value => ({
                        range: {
        Severity: Major
        Found in packages/vue/src/components/range/MultiRange.jsx and 1 other location - About 5 hrs to fix
        packages/native/src/components/range/MultiDropdownRange.js on lines 85..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 150.

        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

            updateStateOptions = (bucket) => {
                if (bucket) {
                    const bucketDictionary = bucket.reduce(
                        (obj, item) => ({
                            ...obj,
        Severity: Major
        Found in packages/web/src/components/list/SingleDataList.js and 1 other location - About 5 hrs to fix
        packages/web/src/components/list/MultiDataList.js on lines 274..300

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

        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

            componentWillMount() {
                this.props.addComponent(this.internalComponent);
                this.props.addComponent(this.props.componentId);
                this.updateQueryOptions(this.props);
        
        
        Severity: Major
        Found in packages/web/src/components/list/SingleDropdownList.js and 2 other locations - About 5 hrs to fix
        packages/native/src/components/list/SingleDropdownList.js on lines 39..51
        packages/web/src/components/list/SingleList.js on lines 51..63

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

        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

            componentWillMount() {
                this.props.addComponent(this.internalComponent);
                this.props.addComponent(this.props.componentId);
                this.updateQueryOptions(this.props);
        
        
        Severity: Major
        Found in packages/web/src/components/list/SingleList.js and 2 other locations - About 5 hrs to fix
        packages/native/src/components/list/SingleDropdownList.js on lines 39..51
        packages/web/src/components/list/SingleDropdownList.js on lines 44..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 149.

        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

            componentDidMount() {
                this.props.addComponent(this.internalComponent);
                this.props.addComponent(this.props.componentId);
                this.updateQueryOptions(this.props);
        
        
        Severity: Major
        Found in packages/native/src/components/list/SingleDropdownList.js and 2 other locations - About 5 hrs to fix
        packages/web/src/components/list/SingleDropdownList.js on lines 44..56
        packages/web/src/components/list/SingleList.js on lines 51..63

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

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

            render() {
                const { theme } = this.$props;
                const renderSuggestions = this.$scopedSlots.suggestions;
                return (
                    <Container class={this.$props.className}>
        Severity: Major
        Found in packages/vue/src/components/search/DataSearch.jsx - About 5 hrs to fix
          Severity
          Category
          Status
          Source
          Language