appbaseio/dejaVu

View on GitHub
packages/browser/src/components/DataBrowser/AddRowModal.js

Summary

Maintainability
F
4 days
Test Coverage

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

    render() {
        const { indexTypeMap, typePropertyMapping } = this.props;
        const {
            addDataError,
            documentId,
Severity: Major
Found in packages/browser/src/components/DataBrowser/AddRowModal.js - About 6 hrs to fix

    File AddRowModal.js has 356 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // @flow
    
    import React, { Component, Fragment } from 'react';
    import { Modal, Input, Select, Row, Col, Button, Tabs } from 'antd';
    import { PlusOutlined } from '@ant-design/icons';
    Severity: Minor
    Found in packages/browser/src/components/DataBrowser/AddRowModal.js - About 4 hrs to fix

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

                          <Row>
                              <Col span={12}>
                                  <Item style={{ marginRight: '15px' }} label="Index">
                                      <Select
                                          defaultValue={selectedIndex}
      Severity: Major
      Found in packages/browser/src/components/DataBrowser/AddRowModal.js and 2 other locations - About 1 day to fix
      packages/browser/src/components/DataBrowser/AddFieldModal.js on lines 279..317
      packages/browser/src/components/DataBrowser/ExportData.js on lines 358..396

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

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

                  {
                      isShowingModal: false,
                      addDataError: false,
                      addDataValue: `{\n}`,
                      documentId: '',
      Severity: Major
      Found in packages/browser/src/components/DataBrowser/AddRowModal.js and 1 other location - About 5 hrs to fix
      packages/browser/src/components/DataBrowser/AddRowModal.js on lines 56..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 141.

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

          state = {
              isShowingModal: false,
              addDataError: false,
              addDataValue: `{\n}`,
              documentId: '',
      Severity: Major
      Found in packages/browser/src/components/DataBrowser/AddRowModal.js and 1 other location - About 5 hrs to fix
      packages/browser/src/components/DataBrowser/AddRowModal.js on lines 98..112

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

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

          handleIndexChange = selectedIndex => {
              this.setState({
                  selectedIndex,
                  types: this.props.indexTypeMap[selectedIndex],
                  selectedType: this.props.indexTypeMap[selectedIndex][0],
      Severity: Major
      Found in packages/browser/src/components/DataBrowser/AddRowModal.js and 1 other location - About 1 hr to fix
      packages/browser/src/components/DataBrowser/AddFieldModal.js on lines 197..203

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

      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

          toggleModal = () => {
              this.setState(prevState => ({
                  isShowingModal: !prevState.isShowingModal,
              }));
              this.props.setMode(MODES.EDIT);
      Severity: Major
      Found in packages/browser/src/components/DataBrowser/AddRowModal.js and 1 other location - About 1 hr to fix
      packages/browser/src/components/DataBrowser/AddFieldModal.js on lines 223..228

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

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

              const {
                  addDataError,
                  addDataValue,
                  selectedIndex,
                  selectedType,
      Severity: Major
      Found in packages/browser/src/components/DataBrowser/AddRowModal.js and 6 other locations - About 35 mins to fix
      packages/browser/src/components/ConnectApp/ConnectApp.js on lines 447..455
      packages/browser/src/components/DataBrowser/AddFieldModal.js on lines 125..133
      packages/browser/src/components/DataBrowser/DataBrowser.js on lines 75..83
      packages/browser/src/components/DataBrowser/UpdateRow.js on lines 81..89
      packages/browser/src/components/DataTable/DataGrid.js on lines 120..128
      packages/browser/src/components/DataTable/DataGrid.js on lines 170..178

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

      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

      There are no issues that match your filters.

      Category
      Status