appbaseio/reactivesearch

View on GitHub

Showing 1,376 of 1,376 total issues

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

        if (startDate) {
            this.handleDateChange(
                {
                    dateString: new XDate(startDate).toString('yyyy-MM-dd'),
                    timestamp: new XDate(startDate).getTime(),
Severity: Major
Found in packages/native/src/components/date/DateRange.js and 1 other location - About 4 hrs to fix
packages/native/src/components/date/DateRange.js on lines 53..68

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

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

ReactiveMap has 33 functions (exceeds 20 allowed). Consider refactoring.
Open

class ReactiveMap extends Component {
    constructor(props) {
        super(props);

        this.mapStyles = [
Severity: Minor
Found in packages/maps/src/components/result/ReactiveMap.js - About 4 hrs to fix

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

    const Checkbox = styled('input')`
        ${formItem};
        ${props => (props.show ? null : hideInputControl)};
    
        + label {
    Severity: Major
    Found in packages/vue/src/styles/FormControlList.js and 1 other location - About 4 hrs to fix
    packages/web/src/styles/FormControlList.js on lines 155..195

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

    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 Checkbox = styled('input')`
        ${formItem};
        ${props => (props.show ? null : hideInputControl)};
    
        + label {
    Severity: Major
    Found in packages/web/src/styles/FormControlList.js and 1 other location - About 4 hrs to fix
    packages/vue/src/styles/FormControlList.js on lines 151..191

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

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

        componentWillMount() {
            this.props.addComponent(this.props.componentId);
            this.setReact(this.props);
    
            if (this.props.selectedValue) {
    Severity: Major
    Found in packages/web/src/components/range/MultiDropdownRange.js and 8 other locations - About 4 hrs to fix
    packages/native/src/components/basic/TextField.js on lines 33..42
    packages/native/src/components/range/MultiDropdownRange.js on lines 47..56
    packages/native/src/components/range/SingleDropdownRange.js on lines 34..43
    packages/web/src/components/basic/TextField.js on lines 37..46
    packages/web/src/components/basic/ToggleButton.js on lines 35..44
    packages/web/src/components/date/DatePicker.js on lines 38..47
    packages/web/src/components/range/MultiRange.js on lines 41..50
    packages/web/src/components/range/SingleDropdownRange.js on lines 37..46

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

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

        componentWillMount() {
            this.props.addComponent(this.props.componentId);
            this.setReact(this.props);
    
            if (this.props.selectedValue) {
    Severity: Major
    Found in packages/web/src/components/basic/TextField.js and 8 other locations - About 4 hrs to fix
    packages/native/src/components/basic/TextField.js on lines 33..42
    packages/native/src/components/range/MultiDropdownRange.js on lines 47..56
    packages/native/src/components/range/SingleDropdownRange.js on lines 34..43
    packages/web/src/components/basic/ToggleButton.js on lines 35..44
    packages/web/src/components/date/DatePicker.js on lines 38..47
    packages/web/src/components/range/MultiDropdownRange.js on lines 40..49
    packages/web/src/components/range/MultiRange.js on lines 41..50
    packages/web/src/components/range/SingleDropdownRange.js on lines 37..46

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

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

        componentWillMount() {
            this.props.addComponent(this.props.componentId);
            this.setReact(this.props);
    
            if (this.props.selectedValue) {
    Severity: Major
    Found in packages/native/src/components/basic/TextField.js and 8 other locations - About 4 hrs to fix
    packages/native/src/components/range/MultiDropdownRange.js on lines 47..56
    packages/native/src/components/range/SingleDropdownRange.js on lines 34..43
    packages/web/src/components/basic/TextField.js on lines 37..46
    packages/web/src/components/basic/ToggleButton.js on lines 35..44
    packages/web/src/components/date/DatePicker.js on lines 38..47
    packages/web/src/components/range/MultiDropdownRange.js on lines 40..49
    packages/web/src/components/range/MultiRange.js on lines 41..50
    packages/web/src/components/range/SingleDropdownRange.js on lines 37..46

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

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

        componentDidMount() {
            this.props.addComponent(this.props.componentId);
            this.setReact(this.props);
    
            if (this.props.selectedValue) {
    Severity: Major
    Found in packages/native/src/components/range/MultiDropdownRange.js and 8 other locations - About 4 hrs to fix
    packages/native/src/components/basic/TextField.js on lines 33..42
    packages/native/src/components/range/SingleDropdownRange.js on lines 34..43
    packages/web/src/components/basic/TextField.js on lines 37..46
    packages/web/src/components/basic/ToggleButton.js on lines 35..44
    packages/web/src/components/date/DatePicker.js on lines 38..47
    packages/web/src/components/range/MultiDropdownRange.js on lines 40..49
    packages/web/src/components/range/MultiRange.js on lines 41..50
    packages/web/src/components/range/SingleDropdownRange.js on lines 37..46

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

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

        componentWillMount() {
            this.props.addComponent(this.props.componentId);
            this.setReact(this.props);
    
            if (this.props.selectedValue) {
    Severity: Major
    Found in packages/web/src/components/range/SingleDropdownRange.js and 8 other locations - About 4 hrs to fix
    packages/native/src/components/basic/TextField.js on lines 33..42
    packages/native/src/components/range/MultiDropdownRange.js on lines 47..56
    packages/native/src/components/range/SingleDropdownRange.js on lines 34..43
    packages/web/src/components/basic/TextField.js on lines 37..46
    packages/web/src/components/basic/ToggleButton.js on lines 35..44
    packages/web/src/components/date/DatePicker.js on lines 38..47
    packages/web/src/components/range/MultiDropdownRange.js on lines 40..49
    packages/web/src/components/range/MultiRange.js on lines 41..50

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

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

        componentWillMount() {
            this.props.addComponent(this.props.componentId);
            this.setReact(this.props);
    
            if (this.props.selectedValue) {
    Severity: Major
    Found in packages/native/src/components/range/SingleDropdownRange.js and 8 other locations - About 4 hrs to fix
    packages/native/src/components/basic/TextField.js on lines 33..42
    packages/native/src/components/range/MultiDropdownRange.js on lines 47..56
    packages/web/src/components/basic/TextField.js on lines 37..46
    packages/web/src/components/basic/ToggleButton.js on lines 35..44
    packages/web/src/components/date/DatePicker.js on lines 38..47
    packages/web/src/components/range/MultiDropdownRange.js on lines 40..49
    packages/web/src/components/range/MultiRange.js on lines 41..50
    packages/web/src/components/range/SingleDropdownRange.js on lines 37..46

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

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

        componentWillMount() {
            this.props.addComponent(this.props.componentId);
            this.setReact(this.props);
    
            if (this.props.selectedValue) {
    Severity: Major
    Found in packages/web/src/components/range/MultiRange.js and 8 other locations - About 4 hrs to fix
    packages/native/src/components/basic/TextField.js on lines 33..42
    packages/native/src/components/range/MultiDropdownRange.js on lines 47..56
    packages/native/src/components/range/SingleDropdownRange.js on lines 34..43
    packages/web/src/components/basic/TextField.js on lines 37..46
    packages/web/src/components/basic/ToggleButton.js on lines 35..44
    packages/web/src/components/date/DatePicker.js on lines 38..47
    packages/web/src/components/range/MultiDropdownRange.js on lines 40..49
    packages/web/src/components/range/SingleDropdownRange.js on lines 37..46

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

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

        componentWillMount() {
            this.props.addComponent(this.props.componentId);
            this.setReact(this.props);
    
            if (this.props.selectedValue) {
    Severity: Major
    Found in packages/web/src/components/basic/ToggleButton.js and 8 other locations - About 4 hrs to fix
    packages/native/src/components/basic/TextField.js on lines 33..42
    packages/native/src/components/range/MultiDropdownRange.js on lines 47..56
    packages/native/src/components/range/SingleDropdownRange.js on lines 34..43
    packages/web/src/components/basic/TextField.js on lines 37..46
    packages/web/src/components/date/DatePicker.js on lines 38..47
    packages/web/src/components/range/MultiDropdownRange.js on lines 40..49
    packages/web/src/components/range/MultiRange.js on lines 41..50
    packages/web/src/components/range/SingleDropdownRange.js on lines 37..46

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

    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

                    {this.state.currentPage >= this.props.pages ? (
                        <View
                            style={{
                                height: 45,
                                display: 'flex',
    Severity: Major
    Found in packages/native/src/components/result/ReactiveList.js and 1 other location - About 4 hrs to fix
    packages/maps-native/src/components/maps/ReactiveMap.js on lines 605..621

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

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

        componentWillMount() {
            this.props.addComponent(this.props.componentId);
            this.setReact(this.props);
    
            if (this.props.selectedValue) {
    Severity: Major
    Found in packages/web/src/components/date/DatePicker.js and 8 other locations - About 4 hrs to fix
    packages/native/src/components/basic/TextField.js on lines 33..42
    packages/native/src/components/range/MultiDropdownRange.js on lines 47..56
    packages/native/src/components/range/SingleDropdownRange.js on lines 34..43
    packages/web/src/components/basic/TextField.js on lines 37..46
    packages/web/src/components/basic/ToggleButton.js on lines 35..44
    packages/web/src/components/range/MultiDropdownRange.js on lines 40..49
    packages/web/src/components/range/MultiRange.js on lines 41..50
    packages/web/src/components/range/SingleDropdownRange.js on lines 37..46

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

    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

                    {this.state.currentPage >= this.props.pages ? (
                        <View
                            style={{
                                height: 45,
                                display: 'flex',
    Severity: Major
    Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 4 hrs to fix
    packages/native/src/components/result/ReactiveList.js on lines 420..436

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

    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 28 (exceeds 5 allowed). Consider refactoring.
    Open

        componentWillReceiveProps(nextProps) {
            if (
                this.props.sortBy !== nextProps.sortBy
                || this.props.size !== nextProps.size
                || !isEqual(this.props.dataField, nextProps.dataField)
    Severity: Minor
    Found in packages/maps/src/components/result/ReactiveMap.js - About 4 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 Pagination has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function Pagination(props) {
        const start = getStartPage(props.pages, props.currentPage);
        const pages = [];
    
        const onPrevPage = (e) => {
    Severity: Minor
    Found in packages/web/src/components/result/addons/Pagination.js - About 4 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

    module.exports = {
        context: path.resolve(__dirname, 'src'),
        entry: {
            main: './index.js',
        },
    Severity: Major
    Found in site/demos/transport/webpack.config.js and 38 other locations - About 4 hrs to fix
    packages/maps/examples/GeoDistanceSlider/webpack.config.js on lines 3..27
    packages/maps/examples/ReactiveMap/webpack.config.js on lines 3..27
    packages/web/examples/CategorySearch/webpack.config.js on lines 3..27
    packages/web/examples/CustomSelectedFilters/webpack.config.js on lines 3..27
    packages/web/examples/DataController/webpack.config.js on lines 3..27
    packages/web/examples/DataSearch/webpack.config.js on lines 3..27
    packages/web/examples/DatePicker/webpack.config.js on lines 3..27
    packages/web/examples/DateRange/webpack.config.js on lines 3..27
    packages/web/examples/DynamicRangeSlider/webpack.config.js on lines 3..27
    packages/web/examples/MultiDataList/webpack.config.js on lines 3..27
    packages/web/examples/MultiDropdownList/webpack.config.js on lines 3..27
    packages/web/examples/MultiDropdownRange/webpack.config.js on lines 3..27
    packages/web/examples/MultiList/webpack.config.js on lines 3..27
    packages/web/examples/MultiRange/webpack.config.js on lines 3..27
    packages/web/examples/NumberBox/webpack.config.js on lines 3..27
    packages/web/examples/RangeInput/webpack.config.js on lines 3..27
    packages/web/examples/RangeSlider/webpack.config.js on lines 3..27
    packages/web/examples/RatingsFilter/webpack.config.js on lines 3..27
    packages/web/examples/ReactiveComponent/webpack.config.js on lines 3..27
    packages/web/examples/ReactiveList/webpack.config.js on lines 3..27
    packages/web/examples/ResultCard/webpack.config.js on lines 3..27
    packages/web/examples/ResultList/webpack.config.js on lines 3..27
    packages/web/examples/SelectedFilters/webpack.config.js on lines 3..27
    packages/web/examples/SingleDataList/webpack.config.js on lines 3..27
    packages/web/examples/SingleDropdownList/webpack.config.js on lines 3..27
    packages/web/examples/SingleDropdownRange/webpack.config.js on lines 3..27
    packages/web/examples/SingleList/webpack.config.js on lines 3..27
    packages/web/examples/SingleRange/webpack.config.js on lines 3..27
    packages/web/examples/TagCloud/webpack.config.js on lines 3..27
    packages/web/examples/TextField/webpack.config.js on lines 3..27
    packages/web/examples/ToggleButton/webpack.config.js on lines 3..27
    packages/web/examples/withRedux/webpack.config.js on lines 3..27
    packages/web/examples/withStreaming/webpack.config.js on lines 3..27
    site/demos/datalayer/webpack.config.js on lines 3..27
    site/demos/goodbooks/webpack.config.js on lines 3..27
    site/demos/polygon/webpack.config.js on lines 3..27
    site/demos/polyline/webpack.config.js on lines 3..27
    site/demos/weather/webpack.config.js on lines 3..27

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 116.

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

    module.exports = {
        context: path.resolve(__dirname, 'src'),
        entry: {
            main: './index.js',
        },
    Severity: Major
    Found in site/demos/polyline/webpack.config.js and 38 other locations - About 4 hrs to fix
    packages/maps/examples/GeoDistanceSlider/webpack.config.js on lines 3..27
    packages/maps/examples/ReactiveMap/webpack.config.js on lines 3..27
    packages/web/examples/CategorySearch/webpack.config.js on lines 3..27
    packages/web/examples/CustomSelectedFilters/webpack.config.js on lines 3..27
    packages/web/examples/DataController/webpack.config.js on lines 3..27
    packages/web/examples/DataSearch/webpack.config.js on lines 3..27
    packages/web/examples/DatePicker/webpack.config.js on lines 3..27
    packages/web/examples/DateRange/webpack.config.js on lines 3..27
    packages/web/examples/DynamicRangeSlider/webpack.config.js on lines 3..27
    packages/web/examples/MultiDataList/webpack.config.js on lines 3..27
    packages/web/examples/MultiDropdownList/webpack.config.js on lines 3..27
    packages/web/examples/MultiDropdownRange/webpack.config.js on lines 3..27
    packages/web/examples/MultiList/webpack.config.js on lines 3..27
    packages/web/examples/MultiRange/webpack.config.js on lines 3..27
    packages/web/examples/NumberBox/webpack.config.js on lines 3..27
    packages/web/examples/RangeInput/webpack.config.js on lines 3..27
    packages/web/examples/RangeSlider/webpack.config.js on lines 3..27
    packages/web/examples/RatingsFilter/webpack.config.js on lines 3..27
    packages/web/examples/ReactiveComponent/webpack.config.js on lines 3..27
    packages/web/examples/ReactiveList/webpack.config.js on lines 3..27
    packages/web/examples/ResultCard/webpack.config.js on lines 3..27
    packages/web/examples/ResultList/webpack.config.js on lines 3..27
    packages/web/examples/SelectedFilters/webpack.config.js on lines 3..27
    packages/web/examples/SingleDataList/webpack.config.js on lines 3..27
    packages/web/examples/SingleDropdownList/webpack.config.js on lines 3..27
    packages/web/examples/SingleDropdownRange/webpack.config.js on lines 3..27
    packages/web/examples/SingleList/webpack.config.js on lines 3..27
    packages/web/examples/SingleRange/webpack.config.js on lines 3..27
    packages/web/examples/TagCloud/webpack.config.js on lines 3..27
    packages/web/examples/TextField/webpack.config.js on lines 3..27
    packages/web/examples/ToggleButton/webpack.config.js on lines 3..27
    packages/web/examples/withRedux/webpack.config.js on lines 3..27
    packages/web/examples/withStreaming/webpack.config.js on lines 3..27
    site/demos/datalayer/webpack.config.js on lines 3..27
    site/demos/goodbooks/webpack.config.js on lines 3..27
    site/demos/polygon/webpack.config.js on lines 3..27
    site/demos/transport/webpack.config.js on lines 3..27
    site/demos/weather/webpack.config.js on lines 3..27

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 116.

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

    module.exports = {
        context: path.resolve(__dirname, 'src'),
        entry: {
            main: './index.js',
        },
    Severity: Major
    Found in packages/web/examples/TagCloud/webpack.config.js and 38 other locations - About 4 hrs to fix
    packages/maps/examples/GeoDistanceSlider/webpack.config.js on lines 3..27
    packages/maps/examples/ReactiveMap/webpack.config.js on lines 3..27
    packages/web/examples/CategorySearch/webpack.config.js on lines 3..27
    packages/web/examples/CustomSelectedFilters/webpack.config.js on lines 3..27
    packages/web/examples/DataController/webpack.config.js on lines 3..27
    packages/web/examples/DataSearch/webpack.config.js on lines 3..27
    packages/web/examples/DatePicker/webpack.config.js on lines 3..27
    packages/web/examples/DateRange/webpack.config.js on lines 3..27
    packages/web/examples/DynamicRangeSlider/webpack.config.js on lines 3..27
    packages/web/examples/MultiDataList/webpack.config.js on lines 3..27
    packages/web/examples/MultiDropdownList/webpack.config.js on lines 3..27
    packages/web/examples/MultiDropdownRange/webpack.config.js on lines 3..27
    packages/web/examples/MultiList/webpack.config.js on lines 3..27
    packages/web/examples/MultiRange/webpack.config.js on lines 3..27
    packages/web/examples/NumberBox/webpack.config.js on lines 3..27
    packages/web/examples/RangeInput/webpack.config.js on lines 3..27
    packages/web/examples/RangeSlider/webpack.config.js on lines 3..27
    packages/web/examples/RatingsFilter/webpack.config.js on lines 3..27
    packages/web/examples/ReactiveComponent/webpack.config.js on lines 3..27
    packages/web/examples/ReactiveList/webpack.config.js on lines 3..27
    packages/web/examples/ResultCard/webpack.config.js on lines 3..27
    packages/web/examples/ResultList/webpack.config.js on lines 3..27
    packages/web/examples/SelectedFilters/webpack.config.js on lines 3..27
    packages/web/examples/SingleDataList/webpack.config.js on lines 3..27
    packages/web/examples/SingleDropdownList/webpack.config.js on lines 3..27
    packages/web/examples/SingleDropdownRange/webpack.config.js on lines 3..27
    packages/web/examples/SingleList/webpack.config.js on lines 3..27
    packages/web/examples/SingleRange/webpack.config.js on lines 3..27
    packages/web/examples/TextField/webpack.config.js on lines 3..27
    packages/web/examples/ToggleButton/webpack.config.js on lines 3..27
    packages/web/examples/withRedux/webpack.config.js on lines 3..27
    packages/web/examples/withStreaming/webpack.config.js on lines 3..27
    site/demos/datalayer/webpack.config.js on lines 3..27
    site/demos/goodbooks/webpack.config.js on lines 3..27
    site/demos/polygon/webpack.config.js on lines 3..27
    site/demos/polyline/webpack.config.js on lines 3..27
    site/demos/transport/webpack.config.js on lines 3..27
    site/demos/weather/webpack.config.js on lines 3..27

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 116.

    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