ui/src/modules/customers/components/list/CustomersList.tsx

Summary

Maintainability
F
6 days
Test Coverage

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

  render() {
    const {
      type,
      totalCount,
      bulk,
Severity: Major
Found in ui/src/modules/customers/components/list/CustomersList.tsx - About 1 day to fix

    File CustomersList.tsx has 465 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import gql from 'graphql-tag';
    import Button from 'modules/common/components/Button';
    import DataWithLoader from 'modules/common/components/DataWithLoader';
    import DateFilter from 'modules/common/components/DateFilter';
    import DropdownToggle from 'modules/common/components/DropdownToggle';
    Severity: Minor
    Found in ui/src/modules/customers/components/list/CustomersList.tsx - About 7 hrs to fix

      Function renderContent has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        renderContent() {
          const {
            customers,
            columnsConfig,
            bulk,
      Severity: Minor
      Found in ui/src/modules/customers/components/list/CustomersList.tsx - About 1 hr to fix

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

          render() {
            const {
              type,
              totalCount,
              bulk,
        Severity: Minor
        Found in ui/src/modules/customers/components/list/CustomersList.tsx - About 35 mins 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

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

                  <thead>
                    <tr>
                      <th>
                        <FormControl
                          checked={isAllSelected}
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 1 other location - About 6 hrs to fix
        ui/src/modules/companies/components/list/CompaniesList.tsx on lines 135..151

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

        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

                  <Dropdown className="dropdown-btn" alignRight={true}>
                    <Dropdown.Toggle as={DropdownToggle} id="dropdown-customize">
                      <Button btnStyle="simple" size="small">
                        {__('Change phone status ')} <Icon icon="angle-down" />
                      </Button>
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 1 other location - About 4 hrs to fix
        ui/src/modules/customers/components/list/CustomersList.tsx on lines 459..472

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

        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

                  <Dropdown
                    className="dropdown-btn"
                    alignRight={true}
                    onClick={this.onTargetSelect}
                  >
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 1 other location - About 4 hrs to fix
        ui/src/modules/customers/components/list/CustomersList.tsx on lines 474..483

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

        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

            for (const status of PHONE_VALIDATION_STATUSES) {
              phoneVerificationStatusList.push(
                <li key={status.value}>
                  <a
                    id={status.value}
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 1 other location - About 2 hrs to fix
        ui/src/modules/customers/components/list/CustomersList.tsx on lines 262..274

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

        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

            for (const status of EMAIL_VALIDATION_STATUSES) {
              emailVerificationStatusList.push(
                <li key={status.value}>
                  <a
                    id={status.value}
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 1 other location - About 2 hrs to fix
        ui/src/modules/customers/components/list/CustomersList.tsx on lines 278..290

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

        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

            const {
              type,
              totalCount,
              bulk,
              emptyBulk,
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 2 other locations - About 2 hrs to fix
        ui/src/modules/settings/calendars/components/scheduler/PageForm.tsx on lines 101..115
        ui/src/modules/settings/calendars/components/scheduler/PageForm.tsx on lines 199..218

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

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

                <FormControl
                  type="text"
                  placeholder={__('Type to search')}
                  onChange={this.search}
                  value={this.state.searchValue}
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 4 other locations - About 1 hr to fix
        ui/src/modules/automations/components/List.tsx on lines 176..183
        ui/src/modules/companies/components/list/CompaniesList.tsx on lines 258..265
        ui/src/modules/settings/productService/components/product/ProductList.tsx on lines 145..152
        ui/src/modules/settings/templates/components/actionBar/ActionBar.tsx on lines 112..119

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

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

              const onClick = () =>
                confirm()
                  .then(() => {
                    this.removeCustomers(bulk);
                  })
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 3 other locations - About 1 hr to fix
        ui/src/modules/companies/components/list/CompaniesList.tsx on lines 195..202
        ui/src/modules/settings/productService/components/product/ProductList.tsx on lines 225..232
        ui/src/modules/settings/templates/components/product/ProductList.tsx on lines 190..197

        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

                content={
                  <DataWithLoader
                    data={this.renderContent()}
                    loading={loading}
                    count={customers.length}
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 1 other location - About 1 hr to fix
        ui/src/modules/settings/importExport/import/components/list/Histories.tsx on lines 197..204

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

        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

                header={
                  <Wrapper.Header
                    title={__(`Customers`) + ` (${totalCount})`}
                    queryParams={queryParams}
                    submenu={menuContacts}
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 1 other location - About 1 hr to fix
        ui/src/modules/companies/components/list/CompaniesList.tsx on lines 317..323

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

        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

                    <li>
                      <a
                        href="#verifyPhone"
                        onClick={this.verifyCustomers.bind(this, 'phone')}
                      >
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 1 other location - About 1 hr to fix
        ui/src/modules/customers/components/list/CustomersList.tsx on lines 372..379

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

        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

                    <li>
                      <a
                        href="#verifyEmail"
                        onClick={this.verifyCustomers.bind(this, 'email')}
                      >
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 1 other location - About 1 hr to fix
        ui/src/modules/customers/components/list/CustomersList.tsx on lines 380..387

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

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

          moveCursorAtTheEnd(e) {
            const tmpValue = e.target.value;
        
            e.target.value = '';
            e.target.value = tmpValue;
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 3 other locations - About 55 mins to fix
        ui/src/modules/inbox/components/conversationDetail/workarea/facebook/ReplyingMessage.tsx on lines 60..65
        ui/src/modules/settings/productService/components/product/ProductList.tsx on lines 109..114
        ui/src/modules/settings/templates/components/product/ProductList.tsx on lines 122..127

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

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

          afterTag = () => {
            this.props.emptyBulk();
        
            if (this.props.refetch) {
              this.props.refetch();
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 2 other locations - About 55 mins to fix
        ui/src/modules/automations/components/List.tsx on lines 94..100
        ui/src/modules/companies/components/list/CompaniesList.tsx on lines 106..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 53.

        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

                  {bulk.length === 2 && (
                    <ModalTrigger
                      title="Merge Customers"
                      size="lg"
                      dialogClassName="modal-1000w"
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 2 other locations - About 45 mins to fix
        ui/src/modules/companies/components/list/CompaniesList.tsx on lines 219..227
        ui/src/modules/settings/productService/components/product/ProductList.tsx on lines 242..250

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

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

            const {
              customers,
              columnsConfig,
              bulk,
              toggleBulk,
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 22 other locations - About 35 mins to fix
        dashboard-ui/src/modules/dashboard/components/QueryBuilder/ExploreQueryBuilder.tsx on lines 59..67
        ui/src/modules/boards/components/MainActionBar.tsx on lines 123..131
        ui/src/modules/boards/components/MainActionBar.tsx on lines 311..319
        ui/src/modules/boards/components/stage/ItemList.tsx on lines 196..204
        ui/src/modules/boards/containers/ListGroupBy.tsx on lines 122..130
        ui/src/modules/boards/containers/MainActionBar.tsx on lines 104..112
        ui/src/modules/boards/containers/ViewGroupBy.tsx on lines 36..44
        ui/src/modules/calendar/components/Detail.tsx on lines 67..75
        ui/src/modules/engage/components/AutoAndManualForm.tsx on lines 246..254
        ui/src/modules/engage/components/VisitorForm.tsx on lines 154..162
        ui/src/modules/engage/containers/withFormMutations.tsx on lines 42..50
        ui/src/modules/inbox/components/conversationDetail/workarea/WorkArea.tsx on lines 158..166
        ui/src/modules/inbox/components/leftSidebar/ConversationList.tsx on lines 23..31
        ui/src/modules/knowledgeBase/components/knowledge/KnowledgeList.tsx on lines 25..33
        ui/src/modules/leads/components/List.tsx on lines 46..54
        ui/src/modules/leads/components/step/preview/SuccessPreview.tsx on lines 17..25
        ui/src/modules/segments/components/form/Form.tsx on lines 676..684
        ui/src/modules/segments/containers/form/SegmentsForm.tsx on lines 160..168
        ui/src/modules/settings/boards/containers/Pipelines.tsx on lines 46..54
        ui/src/modules/settings/productService/containers/product/ProductList.tsx on lines 43..51
        ui/src/modules/settings/templates/components/product/ProductList.tsx on lines 130..138
        widgets/client/messenger/components/ConversationHeadContent.tsx on lines 37..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 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

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

            const manageColumns = props => {
              return (
                <ManageColumns
                  {...props}
                  contentType={type}
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 3 other locations - About 35 mins to fix
        ui/src/modules/customers/components/list/CustomersList.tsx on lines 320..329
        ui/src/modules/settings/productService/components/product/ProductList.tsx on lines 207..216
        ui/src/modules/settings/skills/components/SkillRow.tsx on lines 30..39

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

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

            const customersMerge = props => {
              return (
                <CustomersMerge
                  {...props}
                  objects={bulk}
        Severity: Major
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 3 other locations - About 35 mins to fix
        ui/src/modules/customers/components/list/CustomersList.tsx on lines 298..307
        ui/src/modules/settings/productService/components/product/ProductList.tsx on lines 207..216
        ui/src/modules/settings/skills/components/SkillRow.tsx on lines 30..39

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

        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

                  <TaggerPopover
                    type="customer"
                    successCallback={this.afterTag}
                    targets={bulk}
                    trigger={tagButton}
        Severity: Minor
        Found in ui/src/modules/customers/components/list/CustomersList.tsx and 1 other location - About 35 mins to fix
        ui/src/modules/companies/components/list/CompaniesList.tsx on lines 211..217

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

        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