react-scheduler/react-big-schedule

View on GitHub

Showing 537 of 537 total issues

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

  getContentCellConfigWidth() {
    const viewConfigMap = {
      [ViewType.Week]: 'weekCellWidth',
      [ViewType.Day]: 'dayCellWidth',
      [ViewType.Month]: 'monthCellWidth',
Severity: Major
Found in src/components/SchedulerData.js and 1 other location - About 2 hrs to fix
src/components/SchedulerData.js on lines 340..352

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

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

  getCellMaxEvents() {
    const viewConfigMap = {
      [ViewType.Week]: 'weekMaxEvents',
      [ViewType.Day]: 'dayMaxEvents',
      [ViewType.Month]: 'monthMaxEvents',
Severity: Major
Found in src/components/SchedulerData.js and 1 other location - About 2 hrs to fix
src/components/SchedulerData.js on lines 504..516

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

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

      if (type === DnDTypes.RESOURCE) {
        newEvent = {
          ...newEvent,
          groupId: slotId,
          groupName: slotName,
Severity: Major
Found in src/examples/pages/Drag-And-Drop/class-based.jsx and 1 other location - About 2 hrs to fix
src/examples/pages/Drag-And-Drop/functional-based.jsx on lines 108..121

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

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

      if (type === DnDTypes.RESOURCE) {
        newEvent = {
          ...newEvent,
          groupId: slotId,
          groupName: slotName,
Severity: Major
Found in src/examples/pages/Drag-And-Drop/functional-based.jsx and 1 other location - About 2 hrs to fix
src/examples/pages/Drag-And-Drop/class-based.jsx on lines 142..155

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

Function _getSpan has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _getSpan(startTime, endTime, headers) {
    if (this.showAgenda) return 1;

    // function startOfWeek(date) {
    //   const day = date.getDay();
Severity: Major
Found in src/components/SchedulerData.js - About 2 hrs to fix

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

      onScrollRight = (schedulerData, schedulerContent, maxScrollLeft) => {
        if (schedulerData.ViewTypes === ViewType.Day) {
          schedulerData.next();
          schedulerData.setEvents(DemoData.events);
          this.setState({ viewModel: schedulerData });
    Severity: Major
    Found in src/examples/pages/Basic/class-based.jsx and 1 other location - About 2 hrs to fix
    src/examples/pages/Custom-Time/class-based.jsx on lines 154..162

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

    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

      onScrollRight = (schedulerData, schedulerContent, maxScrollLeft) => {
        if (schedulerData.ViewTypes === ViewType.Day) {
          schedulerData.next();
          schedulerData.setEvents(DemoData.events);
          this.setState({ viewModel: schedulerData });
    Severity: Major
    Found in src/examples/pages/Custom-Time/class-based.jsx and 1 other location - About 2 hrs to fix
    src/examples/pages/Basic/class-based.jsx on lines 149..157

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

    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

    Scheduler has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Scheduler extends Component {
      constructor(props) {
        super(props);
    
        const { schedulerData, dndSources, parentRef } = props;
    Severity: Minor
    Found in src/components/index.jsx - About 2 hrs to fix

      Function _createHeaders has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _createHeaders() {
          const headers = [];
          let start = this.localeDayjs(new Date(this.startDate));
          let end = this.localeDayjs(new Date(this.endDate));
          let header = start;
      Severity: Major
      Found in src/components/SchedulerData.js - About 2 hrs to fix

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

          addResource(resource) {
            const existedResources = this.resources.filter(x => x.id === resource.id);
            if (existedResources.length === 0) {
              this.resources.push(resource);
              this._createRenderData();
        Severity: Major
        Found in src/components/SchedulerData.js and 1 other location - About 2 hrs to fix
        src/components/SchedulerData.js on lines 99..105

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

        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

          addEventGroup(eventGroup) {
            const existedEventGroups = this.eventGroups.filter(x => x.id === eventGroup.id);
            if (existedEventGroups.length === 0) {
              this.eventGroups.push(eventGroup);
              this._createRenderData();
        Severity: Major
        Found in src/components/SchedulerData.js and 1 other location - About 2 hrs to fix
        src/components/SchedulerData.js on lines 91..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 84.

        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

          onScrollLeft = (schedulerData, schedulerContent) => {
            if (schedulerData.ViewTypes === ViewType.Day) {
              schedulerData.prev();
              schedulerData.setEvents(DemoData.events);
              this.setState({ viewModel: schedulerData });
        Severity: Major
        Found in src/examples/pages/Custom-Time/class-based.jsx and 1 other location - About 2 hrs to fix
        src/examples/pages/Basic/class-based.jsx on lines 159..167

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

        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

          onScrollLeft = (schedulerData, schedulerContent) => {
            if (schedulerData.ViewTypes === ViewType.Day) {
              schedulerData.prev();
              schedulerData.setEvents(DemoData.events);
              this.setState({ viewModel: schedulerData });
        Severity: Major
        Found in src/examples/pages/Basic/class-based.jsx and 1 other location - About 2 hrs to fix
        src/examples/pages/Custom-Time/class-based.jsx on lines 164..172

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

        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 _handleRecurringEvents has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _handleRecurringEvents() {
            const recurringEvents = this.events.filter(x => !!x.rrule);
            recurringEvents.forEach(item => {
              this._detachEvent(item);
            });
        Severity: Major
        Found in src/components/SchedulerData.js - About 2 hrs to fix

          Function setViewType has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            setViewType(viewType = ViewType.Week, showAgenda = false, isEventPerspective = false) {
              this.showAgenda = showAgenda;
              this.isEventPerspective = isEventPerspective;
              this.cellUnit = CellUnit.Day;
          
          
          Severity: Major
          Found in src/components/SchedulerData.js - About 2 hrs to fix

            Function endDrag has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                endDrag: (props, monitor) => {
                  if (!monitor.didDrop()) return;
            
                  const { moveEvent, newEvent, schedulerData } = props;
                  const { events, config, viewType, localeDayjs } = schedulerData;
            Severity: Major
            Found in src/components/DnDSource.js - About 2 hrs to fix

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

                const updateEventStart = (schedulerData, event, newStart) => {
                  if (confirm(`Do you want to adjust the start of the event? {eventId: ${event.id}, eventTitle: ${event.title}, newStart: ${newStart}}`)) {
                    schedulerData.updateEventStart(event, newStart);
                  }
                  dispatch({ type: 'UPDATE_SCHEDULER', payload: schedulerData });
              Severity: Major
              Found in src/examples/pages/Add-More/functional-based.jsx and 3 other locations - About 2 hrs to fix
              src/examples/pages/Add-More/functional-based.jsx on lines 111..116
              src/examples/pages/Drag-And-Drop/functional-based.jsx on lines 128..133
              src/examples/pages/Drag-And-Drop/functional-based.jsx on lines 135..140

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

              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 updateEventStart = (schedulerData, event, newStart) => {
                  if (confirm(`Do you want to adjust the start of the event? {eventId: ${event.id}, eventTitle: ${event.title}, newStart: ${newStart}}`)) {
                    schedulerData.updateEventStart(event, newStart);
                  }
                  dispatch({ type: 'UPDATE_SCHEDULER', payload: schedulerData });
              Severity: Major
              Found in src/examples/pages/Drag-And-Drop/functional-based.jsx and 3 other locations - About 2 hrs to fix
              src/examples/pages/Add-More/functional-based.jsx on lines 104..109
              src/examples/pages/Add-More/functional-based.jsx on lines 111..116
              src/examples/pages/Drag-And-Drop/functional-based.jsx on lines 135..140

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

              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 updateEventEnd = (schedulerData, event, newEnd) => {
                  if (confirm(`Do you want to adjust the end of the event? {eventId: ${event.id}, eventTitle: ${event.title}, newEnd: ${newEnd}}`)) {
                    schedulerData.updateEventEnd(event, newEnd);
                  }
                  dispatch({ type: 'UPDATE_SCHEDULER', payload: schedulerData });
              Severity: Major
              Found in src/examples/pages/Drag-And-Drop/functional-based.jsx and 3 other locations - About 2 hrs to fix
              src/examples/pages/Add-More/functional-based.jsx on lines 104..109
              src/examples/pages/Add-More/functional-based.jsx on lines 111..116
              src/examples/pages/Drag-And-Drop/functional-based.jsx on lines 128..133

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

              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 updateEventEnd = (schedulerData, event, newEnd) => {
                  if (confirm(`Do you want to adjust the end of the event? {eventId: ${event.id}, eventTitle: ${event.title}, newEnd: ${newEnd}}`)) {
                    schedulerData.updateEventEnd(event, newEnd);
                  }
                  dispatch({ type: 'UPDATE_SCHEDULER', payload: schedulerData });
              Severity: Major
              Found in src/examples/pages/Add-More/functional-based.jsx and 3 other locations - About 2 hrs to fix
              src/examples/pages/Add-More/functional-based.jsx on lines 104..109
              src/examples/pages/Drag-And-Drop/functional-based.jsx on lines 128..133
              src/examples/pages/Drag-And-Drop/functional-based.jsx on lines 135..140

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

              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

              Severity
              Category
              Status
              Source
              Language