appbaseio/reactivesearch

View on GitHub

Showing 1,376 of 1,376 total issues

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 198.

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

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

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

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

Refactorings

Further Reading

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

const Flex = styled.div`
    display: flex;

    ${props => props.justifyContent && css`
        justify-content: ${props.justifyContent};
Severity: Major
Found in site/demos/gitxplore-dark/src/styles/Flex.js and 3 other locations - About 1 day to fix
site/demos/ecommerce/src/styles/Flex.js on lines 36..60
site/demos/gitxplore/src/styles/Flex.js on lines 29..53
site/demos/producthunt/src/styles/Flex.js on lines 42..76

Duplicated Code

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

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

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

Tuning

This issue has a mass of 198.

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

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

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

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

Refactorings

Further Reading

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

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

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

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

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

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

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

Refactorings

Further Reading

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

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

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

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 a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    componentWillReceiveProps(nextProps) {
        const totalPages = Math.ceil(nextProps.total / nextProps.size) || 0;

        if (
            !isEqual(this.props.sortOptions, nextProps.sortOptions)
Severity: Minor
Found in packages/web/src/components/result/ReactiveList.js - About 1 day to fix

Cognitive Complexity

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

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

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

Further reading

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

class Header extends Component {
    constructor(props) {
        super(props);
        this.state = {
            visible: false,
Severity: Major
Found in site/demos/gitxplore-dark/src/components/Header.js and 1 other location - About 1 day to fix
site/demos/gitxplore/src/components/Header.js on lines 8..32

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

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

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

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

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

Refactorings

Further Reading

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

class Header extends Component {
    constructor(props) {
        super(props);
        this.state = {
            visible: false,
Severity: Major
Found in site/demos/gitxplore/src/components/Header.js and 1 other location - About 1 day to fix
site/demos/gitxplore-dark/src/components/Header.js on lines 8..32

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

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

export default function initReactivesearch(componentCollection, searchState, settings) {
    return new Promise((resolve, reject) => {
        const credentials = settings.url && settings.url.trim() !== '' && !settings.credentials
            ? null
            : settings.credentials;
Severity: Major
Found in packages/web/src/server/index.js - About 1 day to fix

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

                    data={[
                        {
                            start: '2017-01-01T00:00:00Z',
                            end: '2017-12-31T23:59:59Z',
                            label: '2017',
    Severity: Major
    Found in site/demos/gitxplore-dark/src/components/SearchFilters.js and 1 other location - About 1 day to fix
    site/demos/gitxplore/src/components/SearchFilters.js on lines 59..115

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

    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

                    data={[
                        {
                            start: '2017-01-01T00:00:00Z',
                            end: '2017-12-31T23:59:59Z',
                            label: '2017',
    Severity: Major
    Found in site/demos/gitxplore/src/components/SearchFilters.js and 1 other location - About 1 day to fix
    site/demos/gitxplore-dark/src/components/SearchFilters.js on lines 53..109

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

    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 DynamicRangeSlider.js has 498 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      File GeoDistanceDropdown.js has 495 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { Component } from 'react';
      import Downshift from 'downshift';
      import { withTheme } from 'emotion-theming';
      
      import {
      Severity: Minor
      Found in packages/maps/src/components/basic/GeoDistanceDropdown.js - About 7 hrs to fix

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

        const formItem = ({ theme }) => css`
            ${vh};
        
            &:focus {
                + label {
        Severity: Major
        Found in packages/web/src/styles/FormControlList.js and 1 other location - About 7 hrs to fix
        packages/vue/src/styles/FormControlList.js on lines 44..111

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

        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 formItem = ({ theme }) => css`
            ${vh};
        
            &:focus {
                + label {
        Severity: Major
        Found in packages/vue/src/styles/FormControlList.js and 1 other location - About 7 hrs to fix
        packages/web/src/styles/FormControlList.js on lines 44..110

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

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

            render() {
                let markedDates = {};
                const current = this.state.currentDate
                    ? this.state.currentDate.start.dateString
                    : this.props.startDate || Date();
        Severity: Major
        Found in packages/native/src/components/date/DateRange.js - About 7 hrs to fix

          File Home.js has 489 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React, { Component } from 'react';
          import { Navbar, Logo, Button, H3, Title, Flex, GithubButton, Grid } from '@appbaseio/designkit';
          import { Link } from 'react-router-dom';
          import { css } from 'emotion';
          import { ThemeProvider } from 'emotion-theming';
          Severity: Minor
          Found in site/src/components/Home.js - About 7 hrs to fix

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

                componentWillReceiveProps(nextProps) {
                    checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
            
                    checkSomePropChange(this.props, nextProps, ['dataField', 'nestedField'], () => {
                        this.updateQuery(this.state.currentValue, nextProps);
            Severity: Major
            Found in packages/web/src/components/range/MultiRange.js and 1 other location - About 7 hrs to fix
            packages/web/src/components/range/MultiDropdownRange.js on lines 51..66

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

            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

                componentWillReceiveProps(nextProps) {
                    checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
            
                    checkSomePropChange(this.props, nextProps, ['dataField', 'nestedField'], () => {
                        this.updateQuery(this.state.currentValue, nextProps);
            Severity: Major
            Found in packages/web/src/components/range/MultiDropdownRange.js and 1 other location - About 7 hrs to fix
            packages/web/src/components/range/MultiRange.js on lines 52..67

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

            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 resultCardProps = {
                componentId: 'SearchResult',
                dataField: 'name',
                className: 'result-list-container',
                from: 0,
            Severity: Major
            Found in packages/web/examples/ssr/pages/datepicker.js and 1 other location - About 7 hrs to fix
            packages/web/examples/ssr/pages/daterange.js on lines 50..74

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

            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 resultCardProps = {
                componentId: 'SearchResult',
                dataField: 'name',
                className: 'result-list-container',
                from: 0,
            Severity: Major
            Found in packages/web/examples/ssr/pages/daterange.js and 1 other location - About 7 hrs to fix
            packages/web/examples/ssr/pages/datepicker.js on lines 40..64

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

            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