appbaseio/reactivesearch

View on GitHub

Showing 334 of 1,376 total issues

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

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

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

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

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

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

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

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

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

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

            File RangeSlider.js has 313 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React, { Component } from 'react';
            import { View, Platform } from 'react-native';
            import MultiSlider from '@ptomasroos/react-native-multi-slider';
            
            import {
            Severity: Minor
            Found in packages/native/src/components/range/RangeSlider.js - About 3 hrs to fix

              File DownShift.jsx has 313 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { scrollIntoView } from './utils';
              
              export default {
                  // eslint-disable-next-line
                  props: [
              Severity: Minor
              Found in packages/vue/src/components/basic/DownShift.jsx - About 3 hrs to fix

                Function render has 86 lines of code (exceeds 25 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: Major
                Found in packages/web/src/components/result/ReactiveList.js - About 3 hrs to fix

                  Function componentWillReceiveProps has a Cognitive Complexity of 24 (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-native/src/components/maps/ReactiveMap.js - About 3 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 85 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      render() {
                          let style = {};
                  
                          if (this.props.showIcon) {
                              if (this.props.iconPosition === 'left') {
                  Severity: Major
                  Found in packages/native/src/components/search/DataSearch.js - About 3 hrs to fix

                    File MultiDropdownRange.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* eslint-disable */
                    import React, { Component } from 'react';
                    import { View, Modal, ListView, TouchableWithoutFeedback } from 'react-native';
                    import { CheckBox, Text, Body, Item, Header, Left, Button, Icon, Title, Right } from 'native-base';
                    
                    
                    Severity: Minor
                    Found in packages/native/src/components/range/MultiDropdownRange.js - About 3 hrs to fix

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

                          render() {
                              const { config, theme } = this.props;
                              const { primary } = theme;
                              return (
                                  <ThemeProvider
                      Severity: Major
                      Found in site/src/components/Demo.js - About 3 hrs to fix

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

                            render() {
                                let markedDates = {};
                                const current = this.state.currentDate
                                    ? this.state.currentDate.start.dateString
                                    : this.props.startDate || Date();
                        Severity: Minor
                        Found in packages/native/src/components/date/DateRange.js - About 3 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 defaultQuery has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                        Open

                        MultiDropdownList.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/MultiDropdownList.jsx - About 3 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 componentWillReceiveProps has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          CategorySearch has 27 functions (exceeds 20 allowed). Consider refactoring.
                          Open

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

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

                                render() {
                                    let style = {};
                            
                                    if (this.props.showIcon) {
                                        if (this.props.iconPosition === 'left') {
                            Severity: Major
                            Found in packages/native/src/components/basic/TextField.js - About 3 hrs to fix

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

                              MultiDropdownList.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/MultiDropdownList.jsx - About 3 hrs to fix

                                Consider simplifying this complex logical expression.
                                Open

                                            if (this.state.currentDate.end) {
                                                const range = this.getDateRange(
                                                    new XDate(this.state.currentDate.start.timestamp),
                                                    new XDate(this.state.currentDate.end.timestamp),
                                                );
                                Severity: Critical
                                Found in packages/native/src/components/date/DateRange.js - About 3 hrs to fix

                                  DataSearch has 26 functions (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  class DataSearch extends Component {
                                      constructor(props) {
                                          super(props);
                                  
                                          this.state = {
                                  Severity: Minor
                                  Found in packages/web/src/components/search/DataSearch.js - About 3 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language