react-scheduler/react-big-schedule

View on GitHub

Showing 504 of 504 total issues

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

  onViewChange = (schedulerData, view) => {
    schedulerData.setViewType(view.viewType, view.showAgenda, view.isEventPerspective);
    schedulerData.setEvents(DemoData.events);
    this.setState({
      viewModel: schedulerData,
Severity: Major
Found in src/examples/AddMore.jsx and 5 other locations - About 1 hr to fix
src/examples/AddResource.jsx on lines 86..90
src/examples/CustomEventStyle.jsx on lines 69..75
src/examples/CustomHeader.jsx on lines 75..81
src/examples/CustomPopoverStyle.jsx on lines 63..69
src/examples/OverlapCheck.jsx on lines 55..59

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

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

  onViewChange = (schedulerData, view) => {
    schedulerData.setViewType(view.viewType, view.showAgenda, view.isEventPerspective);
    schedulerData.setEvents(DemoData.events);
    this.setState({
      viewModel: schedulerData,
Severity: Major
Found in src/examples/CustomHeader.jsx and 5 other locations - About 1 hr to fix
src/examples/AddMore.jsx on lines 91..97
src/examples/AddResource.jsx on lines 86..90
src/examples/CustomEventStyle.jsx on lines 69..75
src/examples/CustomPopoverStyle.jsx on lines 63..69
src/examples/OverlapCheck.jsx on lines 55..59

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

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

  onViewChange = (schedulerData, view) => {
    schedulerData.setViewType(view.viewType, view.showAgenda, view.isEventPerspective);
    schedulerData.setEvents(DemoData.events);
    this.setState({ viewModel: schedulerData });
  };
Severity: Major
Found in src/examples/OverlapCheck.jsx and 5 other locations - About 1 hr to fix
src/examples/AddMore.jsx on lines 91..97
src/examples/AddResource.jsx on lines 86..90
src/examples/CustomEventStyle.jsx on lines 69..75
src/examples/CustomHeader.jsx on lines 75..81
src/examples/CustomPopoverStyle.jsx on lines 63..69

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

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

  onViewChange = (schedulerData, view) => {
    schedulerData.setViewType(view.viewType, view.showAgenda, view.isEventPerspective);
    schedulerData.setEvents(DemoData.events);
    this.setState({
      viewModel: schedulerData,
Severity: Major
Found in src/examples/CustomPopoverStyle.jsx and 5 other locations - About 1 hr to fix
src/examples/AddMore.jsx on lines 91..97
src/examples/AddResource.jsx on lines 86..90
src/examples/CustomEventStyle.jsx on lines 69..75
src/examples/CustomHeader.jsx on lines 75..81
src/examples/OverlapCheck.jsx on lines 55..59

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

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

  onViewChange = (schedulerData, view) => {
    schedulerData.setViewType(view.viewType, view.showAgenda, view.isEventPerspective);
    schedulerData.setEvents(DemoData.events);
    this.setState({ viewModel: schedulerData });
  };
Severity: Major
Found in src/examples/AddResource.jsx and 5 other locations - About 1 hr to fix
src/examples/AddMore.jsx on lines 91..97
src/examples/CustomEventStyle.jsx on lines 69..75
src/examples/CustomHeader.jsx on lines 75..81
src/examples/CustomPopoverStyle.jsx on lines 63..69
src/examples/OverlapCheck.jsx on lines 55..59

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

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 (this.supportTouch) {
      if (ev.changedTouches.length === 0) return;
      const touch = ev.changedTouches[0];
      clientX = touch.pageX;
    } else {
Severity: Major
Found in src/components/EventItem.jsx and 1 other location - About 1 hr to fix
src/components/EventItem.jsx on lines 249..255

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

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

  _resolveDate(num, date = undefined) {
    if (date !== undefined) {
      this.selectDate = this.localeDayjs(date);
    }

Severity: Minor
Found in src/components/SchedulerData.js - About 1 hr to fix

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

        if (this.schedulerContent) {
          contentScrollbarHeight = this.schedulerContent.offsetHeight - this.schedulerContent.clientHeight;
          contentScrollbarWidth = this.schedulerContent.offsetWidth - this.schedulerContent.clientWidth;
        }
    Severity: Major
    Found in src/components/index.jsx and 1 other location - About 1 hr to fix
    src/components/index.jsx on lines 315..318

    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

        if (this.schedulerResource) {
          resourceScrollbarHeight = this.schedulerResource.offsetHeight - this.schedulerResource.clientHeight;
          resourceScrollbarWidth = this.schedulerResource.offsetWidth - this.schedulerResource.clientWidth;
        }
    Severity: Major
    Found in src/components/index.jsx and 1 other location - About 1 hr to fix
    src/components/index.jsx on lines 311..314

    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

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

      render() {
        const { viewModel } = this.state;
    
        const leftCustomHeader = (
          <div>
    Severity: Minor
    Found in src/examples/CustomHeader.jsx - About 1 hr to fix

      Function _createInitHeaderEvents has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _createInitHeaderEvents(header) {
          const start = this.localeDayjs(new Date(header.time));
          const startValue = start.format(DATETIME_FORMAT);
      
          let endValue;
      Severity: Minor
      Found in src/components/SchedulerData.js - About 1 hr to fix

        Function getDateLabel has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        export const getDateLabel = (schedulerData, viewType, startDate, endDate) => {
          const { localeDayjs } = schedulerData;
          const start = localeDayjs(new Date(startDate));
          const end = localeDayjs(endDate);
          let dateLabel = '';
        Severity: Minor
        Found in src/helper/behaviors.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function _resolveDate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          _resolveDate(num, date = undefined) {
            if (date !== undefined) {
              this.selectDate = this.localeDayjs(date);
            }
        
        
        Severity: Minor
        Found in src/components/SchedulerData.js - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function AgendaEventItem has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function AgendaEventItem(props) {
          const { eventItem, isStart, isEnd, eventItemClick, schedulerData, eventItemTemplateResolver } = props;
          const { config, behaviors } = schedulerData;
        
          let roundCls = 'round-none';
        Severity: Minor
        Found in src/components/AgendaEventItem.jsx - About 1 hr to fix

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

            render() {
              const { viewModel } = this.state;
          
              const leftCustomHeader = (
                <div>
          Severity: Minor
          Found in src/examples/AddResource.jsx - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                      if ((start >= eStart && start < eEnd) || (end > eStart && end <= eEnd) || (eStart >= start && eStart < end) || (eEnd > start && eEnd <= end)) {
                        hasConflict = true;
                      }
            Severity: Critical
            Found in src/components/EventItem.jsx - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                        if ((start >= eStart && start < eEnd) || (end > eStart && end <= eEnd) || (eStart >= start && eStart < end) || (eEnd > start && eEnd <= end)) hasConflict = true;
              Severity: Critical
              Found in src/components/EventItem.jsx - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                          if ((start >= eStart && start < eEnd) || (end > eStart && end <= eEnd) || (eStart >= start && eStart < end) || (eEnd > start && eEnd <= end)) hasConflict = true;
                Severity: Critical
                Found in src/components/ResourceEvents.jsx - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                              if ((start >= eStart && start < eEnd) || (end > eStart && end <= eEnd) || (eStart >= start && eStart < end) || (eEnd > start && eEnd <= end)) hasConflict = true;
                  Severity: Critical
                  Found in src/components/DnDSource.js - About 1 hr to fix

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

                    export { DATE_FORMAT, DATETIME_FORMAT, Scheduler, SchedulerData, ViewType, CellUnit, SummaryPos, DnDSource, DnDContext, AddMorePopover, DemoData, wrapperFun };
                    Severity: Major
                    Found in src/components/index.jsx and 1 other location - About 1 hr to fix
                    src/index.js on lines 1..14

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

                    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