appbaseio/reactivesearch

View on GitHub

Showing 1,376 of 1,376 total issues

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

        const initialState = {
            config: { ...config, mapKey: props.mapKey, themePreset },
            appbaseRef,
            selectedValues,
            headers,
Severity: Major
Found in packages/web/src/components/basic/ReactiveBase.js and 1 other location - About 1 hr to fix
packages/vue/src/components/ReactiveBase/index.jsx on lines 125..135

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

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

        options.sort = [
            {
                [this.props.sortOptions[index].dataField]: {
                    order: this.props.sortOptions[index].sortBy,
                },
Severity: Major
Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 1 hr to fix
packages/vue/src/components/result/ReactiveList.jsx on lines 520..526

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

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 initialState = {
                config: {
                    ...config,
                    mapKey: props.mapKey,
                    themePreset
Severity: Major
Found in packages/vue/src/components/ReactiveBase/index.jsx and 1 other location - About 1 hr to fix
packages/web/src/components/basic/ReactiveBase.js on lines 107..113

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

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

List.propTypes = {
    data: types.data,
    setRef: types.func,
    onData: types.func,
    onEndReached: types.func,
Severity: Major
Found in packages/native/src/components/result/addons/List.js and 2 other locations - About 1 hr to fix
packages/native/src/components/range/addons/Histogram.js on lines 48..54
packages/native/src/components/shared/TouchableItem.js on lines 41..47

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

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

            options.sort = [
                {
                    [this.$props.sortOptions[index].dataField]: {
                        order: this.$props.sortOptions[index].sortBy,
                    },
Severity: Major
Found in packages/vue/src/components/result/ReactiveList.jsx and 1 other location - About 1 hr to fix
packages/web/src/components/result/ReactiveList.js on lines 455..461

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

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

TouchableItem.propTypes = {
    onPress: types.func,
    style: types.style,
    pressOpacity: types.number,
    pressColor: types.string,
Severity: Major
Found in packages/native/src/components/shared/TouchableItem.js and 2 other locations - About 1 hr to fix
packages/native/src/components/range/addons/Histogram.js on lines 48..54
packages/native/src/components/result/addons/List.js on lines 31..37

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

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

Histogram.propTypes = {
    stats: types.stats,
    range: types.range,
    interval: types.number,
    paddingHorizontal: types.number,
Severity: Major
Found in packages/native/src/components/range/addons/Histogram.js and 2 other locations - About 1 hr to fix
packages/native/src/components/result/addons/List.js on lines 31..37
packages/native/src/components/shared/TouchableItem.js on lines 41..47

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

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

    mounted() {
        this.addComponent(this.internalComponent);
        this.addComponent(this.$props.componentId);

        if (this.$props.stream) {
Severity: Minor
Found in packages/vue/src/components/result/ReactiveList.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 setStore has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        setStore(props) {
            const credentials
                = props.url && props.url.trim() !== '' && !props.credentials
                    ? null
                    : props.credentials;
Severity: Minor
Found in packages/vue/src/components/ReactiveBase/index.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 renderAsList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

        renderAsList({ item, triggerClickAnalytics }) {
            const onData = this.$props.onData || this.$scopedSlots.onData;
            const result = onData(item);
            if (result) {
                return (
Severity: Minor
Found in packages/vue/src/components/result/ResultList.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 render has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    render() {
        let style = {};

        if (this.props.showIcon) {
            if (this.props.iconPosition === 'left') {
Severity: Minor
Found in packages/native/src/components/basic/TextField.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 render has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    render() {
        const { currentDate, dateHovered } = this.state;
        const start = currentDate ? currentDate.start : '';
        const end = currentDate ? currentDate.end : '';
        const endDay = dateHovered || '';
Severity: Minor
Found in packages/web/src/components/date/DateRange.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 render has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    render() {
        let suggestionsList = [];
        let finalSuggestionsList = [];
        const {
            theme,
Severity: Minor
Found in packages/web/src/components/search/CategorySearch.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 componentWillReceiveProps has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    componentWillReceiveProps(nextProps) {
        checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
        checkPropChange(this.props.options, nextProps.options, () => {
            this.setState({
                options: nextProps.options[nextProps.dataField]
Severity: Minor
Found in packages/native/src/components/list/MultiDropdownList.js - About 1 hr to fix

    Function componentDidMount has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        componentDidMount() {
            this.props.addComponent(this.props.componentId);
            this.setReact(this.props);
    
            let startDate = null;
    Severity: Minor
    Found in packages/native/src/components/date/DateRange.js - About 1 hr to fix

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

      SingleList.defaultQuery = (value, props) => {
          if (props.selectAllLabel && props.selectAllLabel === value) {
              if (props.showMissing) {
                  return { match_all: {} };
              }
      Severity: Minor
      Found in packages/vue/src/components/list/SingleList.jsx - About 1 hr to fix

        Function booksReactiveList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            booksReactiveList(data) {
                return (
                    <div className="flex book-content" key={data._id}>
                        <img src={data.image} alt="Book Cover" className="book-image" />
                        <div className="flex column justify-center" style={{ marginLeft: 20 }}>
        Severity: Minor
        Found in packages/web/examples/MultiDropdownList/src/index.js - About 1 hr to fix

          Function booksReactiveList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              booksReactiveList(data) {
                  return (
                      <div className="flex book-content" key={data._id}>
                          <img src={data.image} alt="Book Cover" className="book-image" />
                          <div className="flex column justify-center" style={{ marginLeft: 20 }}>
          Severity: Minor
          Found in packages/web/examples/DataController/src/index.js - About 1 hr to fix

            Function booksReactiveList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                booksReactiveList(data) {
                    return (
                        <div className="flex book-content" key={data._id}>
                            <img src={data.image} alt="Book Cover" className="book-image" />
                            <div className="flex column justify-center" style={{ marginLeft: 20 }}>
            Severity: Minor
            Found in packages/web/examples/MultiList/src/index.js - About 1 hr to fix

              Function booksReactiveList has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  booksReactiveList(data) {
                      return (
                          <div className="flex book-content" key={data._id}>
                              <img src={data.image} alt="Book Cover" className="book-image" />
                              <div className="flex column justify-center" style={{ marginLeft: 20 }}>
              Severity: Minor
              Found in packages/web/examples/ReactiveList/src/index.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language