eventoL/eventoL

View on GitHub
eventol/front/src/utils/table.jsx

Summary

Maintainability
F
1 wk
Test Coverage
A
100%

File table.jsx has 390 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';

export const getOrganizersColumns = () => ({
  Header: gettext('Organizers'),
  columns: [
Severity: Minor
Found in eventol/front/src/utils/table.jsx - About 5 hrs to fix

    Function getAssitanceConfirmatedColumns has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const getAssitanceConfirmatedColumns = totals => {
      if (!totals.hasOwnProperty('attendees')) return {};
      return {
        Header: gettext('Assistance (confirmed)'),
        columns: [
    Severity: Major
    Found in eventol/front/src/utils/table.jsx - About 2 hrs to fix

      Function getAssistancesFullColumns has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const getAssistancesFullColumns = totals => {
        if (!totals.hasOwnProperty('attendees')) return {};
        return {
          attendees: getConfirmationColumnsBy(
            totals,
      Severity: Minor
      Found in eventol/front/src/utils/table.jsx - About 1 hr to fix

        Function getConfirmationColumnsBy has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const getConfirmationColumnsBy = (
          totals,
          category,
          totalCategory,
          field,
        Severity: Minor
        Found in eventol/front/src/utils/table.jsx - About 1 hr to fix

          Function getActivitiesColumns has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const getActivitiesColumns = totals => {
            if (!totals.hasOwnProperty('activities')) return {};
            return {
              Header: gettext('Activities'),
              columns: [
          Severity: Minor
          Found in eventol/front/src/utils/table.jsx - About 1 hr to fix

            Function getColumns has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const getColumns = (table, eventsPrivateData, count, totals) => {
              const eventColumns = getEventColumns(count);
              const locationColumns = getLocationColumns();
              const assistanceConfirmatedColumns = getAssitanceConfirmatedColumns(totals);
              const activitiesColumns = getActivitiesColumns(totals);
            Severity: Minor
            Found in eventol/front/src/utils/table.jsx - About 1 hr to fix

              Function getActivitiesFullColumns has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const getActivitiesFullColumns = totals => {
                const confirmationColumn = getConfirmationColumnsBy(
                  totals,
                  'activity',
                  'activities',
              Severity: Minor
              Found in eventol/front/src/utils/table.jsx - About 1 hr to fix

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

                      {
                        Header: gettext('Confirmed'),
                        id: `${title.toLowerCase()}_confirmed`,
                        accessor: data => data[field][category].confirmed,
                        total: totals[totalCategory].confirmed,
                Severity: Major
                Found in eventol/front/src/utils/table.jsx and 2 other locations - About 4 hrs to fix
                eventol/front/src/utils/table.jsx on lines 195..207
                eventol/front/src/utils/table.jsx on lines 208..220

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

                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

                      {
                        Header: gettext('Total'),
                        id: `${title.toLowerCase()}_total`,
                        accessor: data => data[field][category].total,
                        total: totals[totalCategory].total,
                Severity: Major
                Found in eventol/front/src/utils/table.jsx and 2 other locations - About 4 hrs to fix
                eventol/front/src/utils/table.jsx on lines 182..194
                eventol/front/src/utils/table.jsx on lines 195..207

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

                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

                      {
                        Header: gettext('Not Confirmed'),
                        id: `${title.toLowerCase()}_not_confirmed`,
                        accessor: data => data[field][category].not_confirmed,
                        total: totals[totalCategory].not_confirmed,
                Severity: Major
                Found in eventol/front/src/utils/table.jsx and 2 other locations - About 4 hrs to fix
                eventol/front/src/utils/table.jsx on lines 182..194
                eventol/front/src/utils/table.jsx on lines 208..220

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

                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

                      {
                        Header: gettext('Quantity'),
                        id: 'installations_quantity',
                        accessor: ({
                          report: {
                Severity: Major
                Found in eventol/front/src/utils/table.jsx and 2 other locations - About 3 hrs to fix
                eventol/front/src/utils/table.jsx on lines 133..149
                eventol/front/src/utils/table.jsx on lines 150..166

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

                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

                      {
                        Header: gettext('Installations'),
                        id: 'installations',
                        accessor: ({
                          report: {
                Severity: Major
                Found in eventol/front/src/utils/table.jsx and 2 other locations - About 3 hrs to fix
                eventol/front/src/utils/table.jsx on lines 133..149
                eventol/front/src/utils/table.jsx on lines 301..317

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

                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

                      {
                        Header: gettext('Activities'),
                        id: 'activities',
                        accessor: ({
                          report: {
                Severity: Major
                Found in eventol/front/src/utils/table.jsx and 2 other locations - About 3 hrs to fix
                eventol/front/src/utils/table.jsx on lines 150..166
                eventol/front/src/utils/table.jsx on lines 301..317

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

                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

                      {
                        Header: gettext('Attendees'),
                        id: 'attendees',
                        accessor: ({assistanceDetail: {attendees}}) => attendees.confirmed,
                        total: totals.attendees.confirmed,
                Severity: Major
                Found in eventol/front/src/utils/table.jsx and 3 other locations - About 3 hrs to fix
                eventol/front/src/utils/table.jsx on lines 72..84
                eventol/front/src/utils/table.jsx on lines 85..97
                eventol/front/src/utils/table.jsx on lines 98..110

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

                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

                      {
                        Header: gettext('Collaborators'),
                        id: 'collaborator',
                        accessor: ({report: {collaborator}}) => collaborator.confirmed,
                        total: totals.collaborators.confirmed,
                Severity: Major
                Found in eventol/front/src/utils/table.jsx and 3 other locations - About 3 hrs to fix
                eventol/front/src/utils/table.jsx on lines 59..71
                eventol/front/src/utils/table.jsx on lines 72..84
                eventol/front/src/utils/table.jsx on lines 98..110

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

                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

                      {
                        Header: gettext('Organizers'),
                        id: 'organizer',
                        accessor: ({report: {organizer}}) => organizer.confirmed,
                        total: totals.organizers.confirmed,
                Severity: Major
                Found in eventol/front/src/utils/table.jsx and 3 other locations - About 3 hrs to fix
                eventol/front/src/utils/table.jsx on lines 59..71
                eventol/front/src/utils/table.jsx on lines 85..97
                eventol/front/src/utils/table.jsx on lines 98..110

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

                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

                      {
                        Header: gettext('Installers'),
                        id: 'installer',
                        accessor: ({report: {installer}}) => installer.confirmed,
                        total: totals.installers.confirmed,
                Severity: Major
                Found in eventol/front/src/utils/table.jsx and 3 other locations - About 3 hrs to fix
                eventol/front/src/utils/table.jsx on lines 59..71
                eventol/front/src/utils/table.jsx on lines 72..84
                eventol/front/src/utils/table.jsx on lines 85..97

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

                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: gettext('Speakers'),
                        id: 'speakers',
                        accessor: ({report: {speakers}}) => speakers,
                        total: totals.speakers,
                Severity: Major
                Found in eventol/front/src/utils/table.jsx and 1 other location - About 3 hrs to fix
                eventol/front/src/utils/table.jsx on lines 256..268

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

                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

                    speakers: {
                      Header: gettext('Speakers'),
                      id: 'speakers',
                      accessor: ({report: {speakers}}) => speakers,
                      total: totals.speakers,
                Severity: Major
                Found in eventol/front/src/utils/table.jsx and 1 other location - About 3 hrs to fix
                eventol/front/src/utils/table.jsx on lines 111..123

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

                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