appbaseio/reactivesearch

View on GitHub

Showing 1,376 of 1,376 total issues

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

    render() {
        return (
            <Container style={this.props.style} className={this.props.className}>
                {this.props.children}
            </Container>
Severity: Major
Found in packages/web/src/components/basic/DataController.js and 1 other location - About 1 hr to fix
packages/web/src/components/basic/URLParamsProvider.js on lines 155..161

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

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

    render() {
        return (
            <Base style={this.props.style} className={this.props.className}>
                {this.props.children}
            </Base>
Severity: Major
Found in packages/web/src/components/basic/URLParamsProvider.js and 1 other location - About 1 hr to fix
packages/web/src/components/basic/DataController.js on lines 74..80

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

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

const Histogram = (props) => {
    let max = props.stats[0].doc_count;
    props.stats.forEach((item) => {
        if (max < item.doc_count) {
            max = item.doc_count;
Severity: Minor
Found in packages/native/src/components/range/addons/Histogram.js - About 1 hr to fix

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

        render() {
            return (
                <Container class={this.$props.className}>
                    {this.$props.title && (
                        <Title class={getClassName(this.$props.innerClass, 'title')}>
    Severity: Minor
    Found in packages/vue/src/components/range/SingleRange.jsx - About 1 hr to fix

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

          render() {
              return (
                  <ReactiveBase
                      app="carstore-dataset"
                      credentials="4HWI27QmA:58c731f7-79ab-4f55-a590-7e15c7e36721"
      Severity: Minor
      Found in packages/web/examples/RatingsFilter/src/index.js - About 1 hr to fix

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

            render() {
                return (
                    <ReactiveBase
                        app="good-books-ds"
                        credentials="nY6NNTZZ6:27b76b9f-18ea-456c-bc5e-3a5263ebc63d"
        Severity: Minor
        Found in packages/web/examples/NumberBox/src/index.js - About 1 hr to fix

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

              render() {
                  return (
                      <Provider store={store}>
                          <ReactiveBase
                              app="good-books-ds"
          Severity: Minor
          Found in packages/web/examples/withRedux/src/index.js - About 1 hr to fix

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

                render() {
                    const { theme } = this.$props;
                    const renderSuggestions = this.$scopedSlots.suggestions;
                    return (
                        <Container class={this.$props.className}>
            Severity: Minor
            Found in packages/vue/src/components/search/DataSearch.jsx - About 1 hr 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 componentDidMount has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                componentDidMount() {
                    this.props.addComponent(this.internalComponent);
                    this.props.addComponent(this.props.componentId);
            
                    if (this.props.stream) {
            Severity: Minor
            Found in packages/web/src/components/result/ReactiveList.js - About 1 hr 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 mapStateToProps has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            const mapStateToProps = (state, props) => {
                let options
                    = state.aggregations[props.componentId]
                    && state.aggregations[props.componentId][props.dataField];
                let range = state.aggregations[`${props.componentId}__range__internal`];
            Severity: Minor
            Found in packages/web/src/components/range/DynamicRangeSlider.js - About 1 hr 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 selectItem has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    selectItem(item, isDefaultValue = false, props = this.$props) {
                        // ignore state updates when component is locked
                        if (props.beforeValueChange && this.locked) {
                            return;
                        }
            Severity: Minor
            Found in packages/vue/src/components/range/MultiRange.jsx - About 1 hr to fix

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

                  render() {
                      return (
                          <Container style={this.props.style} className={this.props.className}>
                              {this.props.title && (
                                  <Title className={getClassName(this.props.innerClass, 'title') || null}>
              Severity: Minor
              Found in packages/web/src/components/basic/NumberBox.js - About 1 hr to fix

                Function getCompositeAggsQuery has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const getCompositeAggsQuery = (query, props, after) => {
                    const clonedQuery = { ...query };
                    // missing label not available in composite aggs
                    const {
                        dataField, size, sortBy, showMissing,
                Severity: Minor
                Found in packages/web/src/components/list/utils.js - About 1 hr to fix

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

                      render() {
                          return (
                              <ReactiveBase
                                  app="good-books-ds"
                                  credentials="nY6NNTZZ6:27b76b9f-18ea-456c-bc5e-3a5263ebc63d"
                  Severity: Minor
                  Found in packages/web/examples/ResultList/src/index.js - About 1 hr to fix

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

                        render() {
                            return (
                                <Container style={this.props.style} className={this.props.className}>
                                    {this.props.title && (
                                        <Title className={getClassName(this.props.innerClass, 'title') || null}>
                    Severity: Minor
                    Found in packages/web/src/components/range/SingleRange.js - About 1 hr to fix

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

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

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 63.

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

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

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

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

                      Refactorings

                      Further Reading

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

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

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 63.

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

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

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

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

                      Refactorings

                      Further Reading

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

                              if (this.selectedValue) {
                                  this.selectItem(this.selectedValue, true);
                              } else if (this.$props.defaultSelected) {
                                  this.selectItem(this.$props.defaultSelected, true);
                              }
                      Severity: Major
                      Found in packages/vue/src/components/range/MultiRange.jsx and 2 other locations - About 1 hr to fix
                      packages/vue/src/components/list/MultiDropdownList.jsx on lines 85..89
                      packages/vue/src/components/search/DataSearch.jsx on lines 120..124

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 63.

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

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

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

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

                      Refactorings

                      Further Reading

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

                              props.updateQuery({
                                  componentId: props.componentId,
                                  query: query(value, props),
                                  value,
                                  label: props.filterLabel,
                      Severity: Major
                      Found in packages/web/src/components/basic/TextField.js and 1 other location - About 1 hr to fix
                      packages/web/src/components/basic/DataController.js on lines 54..61

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 63.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  props.updateQuery({
                                      componentId: props.componentId,
                                      query: query(defaultSelected, props),
                                      value: defaultSelected,
                                      label: props.filterLabel,
                      Severity: Major
                      Found in packages/web/src/components/basic/DataController.js and 1 other location - About 1 hr to fix
                      packages/web/src/components/basic/TextField.js on lines 137..144

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 63.

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

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

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

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

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language