appbaseio/reactivesearch

View on GitHub

Showing 334 of 1,376 total issues

Function defaultQuery has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

MultiList.defaultQuery = (value, props) => {
    let query = null;
    const type = props.queryFormat === 'or' ? 'terms' : 'term';

    if (!Array.isArray(value) || value.length === 0) {
Severity: Minor
Found in packages/vue/src/components/list/MultiList.jsx - About 2 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 render has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        const { selectedValues } = this.props;
        let hasValues = false;

        return (
Severity: Major
Found in packages/native/src/components/basic/SelectedFilters.js - About 2 hrs to fix

    File base.js has 280 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { css } from 'emotion';
    
    import queries from './mediaQueries';
    
    const primaryColor = '#6772e5';
    Severity: Minor
    Found in site/src/styles/base.js - About 2 hrs to fix

      Function defaultQuery has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      MultiList.defaultQuery = (value, props) => {
          let query = null;
          const type = props.queryFormat === 'or' ? 'terms' : 'term';
      
          if (!Array.isArray(value) || value.length === 0) {
      Severity: Major
      Found in packages/vue/src/components/list/MultiList.jsx - About 2 hrs to fix

        Function setValue has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                setValue(value, isDefaultValue = false, props = this.$props) {
                    // ignore state updates when component is locked
                    if (props.beforeValueChange && this.locked) {
                        return;
                    }
        Severity: Major
        Found in packages/vue/src/components/list/MultiList.jsx - About 2 hrs to fix

          Function hits has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

                  hits(newVal, oldVal) {
                      if (this.$props.pagination) {
                          // called when page is changed
                          if (this.isLoading && (oldVal || newVal)) {
                              if (this.hasPageChangeListener) {
          Severity: Minor
          Found in packages/vue/src/components/result/ReactiveList.jsx - About 2 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 render has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              render() {
                  const { size } = this.$props;
                  const { hits } = this.$data;
                  const results = parseHits(hits) || [];
                  const streamResults = parseHits(this.$data.streamHits) || [];
          Severity: Minor
          Found in packages/vue/src/components/result/ReactiveList.jsx - About 2 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 setValue has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

                  setValue(value, isDefaultValue = false, props = this.$props, cause) {
                      // ignore state updates when component is locked
                      if (props.beforeValueChange && this.locked) {
                          return;
                      }
          Severity: Minor
          Found in packages/vue/src/components/search/DataSearch.jsx - About 2 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 setValue has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  setValue(value, isDefaultValue = false, props = this.$props) {
                      // ignore state updates when component is locked
                      if (props.beforeValueChange && this.locked) {
                          return;
                      }
          Severity: Major
          Found in packages/vue/src/components/list/MultiDropdownList.jsx - About 2 hrs to fix

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

                render() {
                    return (
                        <ReactiveBase
                            app="streaming-demo"
                            credentials="40TQvTOh4:302fc9bd-31b8-4794-b58d-e9adecc9b05b"
            Severity: Major
            Found in packages/web/examples/withStreaming/src/index.js - About 2 hrs to fix

              Function componentWillReceiveProps has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                  componentWillReceiveProps(nextProps) {
                      if (
                          !isEqual(this.props.sortOptions, nextProps.sortOptions)
                          || this.props.sortBy !== nextProps.sortBy
                          || this.props.size !== nextProps.size
              Severity: Minor
              Found in packages/native/src/components/result/ReactiveList.js - About 2 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 setValue has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                      setValue(value, 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/list/MultiList.jsx - About 2 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 render has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                  render() {
                      const { onData, size } = this.props;
                      const { currentPage } = this.state;
                      const results = parseHits(this.props.hits) || [];
                      const streamResults = parseHits(this.props.streamHits) || [];
              Severity: Minor
              Found in packages/web/src/components/result/ReactiveList.js - About 2 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 componentDidMount has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  componentDidMount() {
                      this.props.addComponent(this.internalComponent);
                      this.props.addComponent(this.props.componentId);
              
                      if (this.props.stream) {
              Severity: Major
              Found in packages/web/src/components/result/ReactiveList.js - About 2 hrs to fix

                GeoDistanceDropdown has 22 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class GeoDistanceDropdown extends Component {
                    constructor(props) {
                        super(props);
                
                        this.state = {
                Severity: Minor
                Found in packages/maps/src/components/basic/GeoDistanceDropdown.js - About 2 hrs to fix

                  DynamicRangeSlider has 22 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class DynamicRangeSlider extends Component {
                      constructor(props) {
                          super(props);
                  
                          this.state = {
                  Severity: Minor
                  Found in packages/web/src/components/range/DynamicRangeSlider.js - About 2 hrs to fix

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

                        render() {
                            return (
                                <ReactiveBase
                                    app="meetup_app"
                                    credentials="lW70IgSjr:87c5ae16-73fb-4559-a29e-0a02760d2181"
                    Severity: Major
                    Found in site/demos/datalayer/src/index.js - About 2 hrs to fix

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

                          componentWillReceiveProps(nextProps) {
                              if (!isEqual(this.props.range, nextProps.range) && nextProps.range) {
                                  this.updateQueryOptions(nextProps, nextProps.range);
                                  // floor and ceil to take edge cases into account
                                  this.updateRange({
                      Severity: Major
                      Found in packages/web/src/components/range/DynamicRangeSlider.js - About 2 hrs to fix

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

                        import Appbase from 'appbase-js';
                        
                        import valueReducer from '@appbaseio/reactivecore/lib/reducers/valueReducer';
                        import queryReducer from '@appbaseio/reactivecore/lib/reducers/queryReducer';
                        import queryOptionsReducer from '@appbaseio/reactivecore/lib/reducers/queryOptionsReducer';
                        Severity: Minor
                        Found in packages/web/src/server/index.js - About 2 hrs to fix

                          Function setStore has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  setStore(props) {
                                      const credentials
                                          = props.url && props.url.trim() !== '' && !props.credentials
                                              ? null
                                              : props.credentials;
                          Severity: Major
                          Found in packages/vue/src/components/ReactiveBase/index.jsx - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language