appbaseio/reactivesearch

View on GitHub

Showing 1,376 of 1,376 total issues

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

                    {result.title
                        && (typeof result.title === 'string' ? (
                            <Title
                                dangerouslySetInnerHTML={{ __html: result.title }}
                                className={getClassName(this.props.innerClass, 'title')}
Severity: Major
Found in packages/web/src/components/result/ResultCard.js and 1 other location - About 3 hrs to fix
packages/web/src/components/result/ResultList.js on lines 36..48

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

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

                        {result.title
                            && (typeof result.title === 'string' ? (
                                <Title
                                    dangerouslySetInnerHTML={{
                                        __html: result.title,
Severity: Major
Found in packages/web/src/components/result/ResultList.js and 1 other location - About 3 hrs to fix
packages/web/src/components/result/ResultCard.js on lines 32..42

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

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

    shouldComponentUpdate(nextProps) {
        const upperLimit = Math.floor((nextProps.range.end - nextProps.range.start) / 2);
        if (nextProps.stepValue < 1 || nextProps.stepValue > upperLimit) {
            console.warn(
                `stepValue for RangeSlider ${
Severity: Major
Found in packages/native/src/components/range/RangeSlider.js and 1 other location - About 3 hrs to fix
packages/web/src/components/range/RangeSlider.js on lines 97..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 109.

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

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

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

    const Base = styled('div')`
        font-family: ${({ theme }) => theme.typography.fontFamily};
        font-size: ${({ theme }) => theme.typography.fontSize};
        color: ${({ theme }) => theme.colors.textColor};
        width: 100%;
    Severity: Major
    Found in packages/web/src/styles/Base.js and 1 other location - About 3 hrs to fix
    packages/vue/src/styles/Base.js on lines 3..21

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

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

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

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

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

    Refactorings

    Further Reading

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

            } else if (value && typeof value === 'object') {
                // TODO: support for NestedList
                let label
                    = (typeof value.label === 'string' ? value.label : value.value)
                    || value.key
    Severity: Major
    Found in packages/web/src/components/basic/SelectedFilters.js and 1 other location - About 3 hrs to fix
    packages/vue/src/components/basic/SelectedFilters.jsx on lines 70..83

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

    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

                <Card big href="https://appbase.io/support">
                    <img src={`${imagePrefix}/Support.png`} alt="Support" />
                    <Title>Support</Title>
                    <p>
                        Get first-class support from appbase.io for your{' '}
    Severity: Major
    Found in site/src/components/SupportGrid.js and 1 other location - About 3 hrs to fix
    site/src/components/SupportGrid.js on lines 19..33

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

    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

                <Card big href="https://opensource.appbase.io/reactive-manual">
                    <img src={`${imagePrefix}/Documentation.svg`} alt="Documentation" />
                    <Title>Documentation</Title>
                    <p>
                        Dive in to learn all about{' '}
    Severity: Major
    Found in site/src/components/SupportGrid.js and 1 other location - About 3 hrs to fix
    site/src/components/SupportGrid.js on lines 39..53

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

    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

    const Base = styled('div')`
        font-family: ${({ theme }) => theme.typography.fontFamily};
        font-size: ${({ theme }) => theme.typography.fontSize};
        color: ${({ theme }) => theme.colors.textColor};
        width: 100%;
    Severity: Major
    Found in packages/vue/src/styles/Base.js and 1 other location - About 3 hrs to fix
    packages/web/src/styles/Base.js on lines 3..16

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

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

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

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

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

    Refactorings

    Further Reading

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

            if (this.props.highlight) {
                const queryOptions = DataSearch.highlightQuery(this.props) || {};
                queryOptions.size = 20;
                this.props.setQueryOptions(this.props.componentId, queryOptions);
            } else {
    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 62..70

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

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

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

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

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

    Refactorings

    Further Reading

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

                if (value && typeof value === 'object') {
                    // TODO: support for NestedList
                    let label
                        = (typeof value.label === 'string' ? value.label : value.value)
                        || value.key
    Severity: Major
    Found in packages/vue/src/components/basic/SelectedFilters.jsx and 1 other location - About 3 hrs to fix
    packages/web/src/components/basic/SelectedFilters.js on lines 33..44

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

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

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

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

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

    Refactorings

    Further Reading

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

            if (this.props.highlight) {
                const queryOptions = CategorySearch.highlightQuery(this.props) || {};
                queryOptions.size = 20;
                this.props.setQueryOptions(this.props.componentId, queryOptions);
            } else {
    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 51..59

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

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

        render(createElement, context) {
            const { props } = context;
            const start = getStartPage(props.pages, props.currentPage);
            const pages = [];
    
    
    Severity: Major
    Found in packages/vue/src/components/result/addons/Pagination.jsx - About 3 hrs to fix

      Function exports has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = (env) => {
          const isProd = env && env.production;
      
          return {
              entry: {
      Severity: Major
      Found in packages/web/examples/typescript/webpack.config.js - About 3 hrs to fix

        File TagCloud.js has 318 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { Component } from 'react';
        
        import {
            addComponent,
            removeComponent,
        Severity: Minor
        Found in packages/web/src/components/basic/TagCloud.js - About 3 hrs to fix

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

              render() {
                  const { selectAllLabel, showCount, renderListItem } = this.props;
                  const { options } = this.state;
          
                  if (options.length === 0) {
          Severity: Major
          Found in packages/web/src/components/list/MultiDataList.js - About 3 hrs to fix

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

                componentWillReceiveProps(nextProps) {
                    if (!this.locked) {
                        if (!isEqual(this.props.defaultSelected, nextProps.defaultSelected)) {
                            this.updateQuery(nextProps.defaultSelected, nextProps);
                        } else if (!isEqual(this.props.selectedValue, nextProps.selectedValue)) {
            Severity: Major
            Found in packages/web/src/components/basic/DataController.js and 1 other location - About 3 hrs to fix
            packages/native/src/components/basic/DataController.js on lines 29..37

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 107.

            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

                componentWillReceiveProps(nextProps) {
                    if (!this.locked) {
                        if (!isEqual(this.props.defaultSelected, nextProps.defaultSelected)) {
                            this.updateQuery(nextProps.defaultSelected, nextProps);
                        } else if (!isEqual(this.props.selectedValue, nextProps.selectedValue)) {
            Severity: Major
            Found in packages/native/src/components/basic/DataController.js and 1 other location - About 3 hrs to fix
            packages/web/src/components/basic/DataController.js on lines 29..37

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 107.

            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

                componentDidMount() {
                    // To fetch reactive search github stars
                    fetch('https://api.github.com/repos/appbaseio/reactivesearch')
                        .then(res => res.json())
                        .then((res) => {
            Severity: Major
            Found in site/src/components/Home.js and 1 other location - About 3 hrs to fix
            site/src/components/Tools.js on lines 46..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 107.

            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

                componentDidMount() {
                    // To fetch reactive search github stars
                    fetch('https://api.github.com/repos/appbaseio/reactivesearch')
                        .then(res => res.json())
                        .then((res) => {
            Severity: Major
            Found in site/src/components/Tools.js and 1 other location - About 3 hrs to fix
            site/src/components/Home.js on lines 58..70

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

            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