react-scheduler/react-big-schedule

View on GitHub
src/components/SchedulerData.js

Summary

Maintainability
F
2 wks
Test Coverage

File SchedulerData.js has 987 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import dayjs from 'dayjs';
import quarterOfYear from 'dayjs/plugin/quarterOfYear';
import utc from 'dayjs/plugin/utc';
import weekday from 'dayjs/plugin/weekday';
import { RRuleSet, rrulestr } from 'rrule';
Severity: Major
Found in src/components/SchedulerData.js - About 2 days to fix

    SchedulerData has 75 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default class SchedulerData {
      constructor(date = dayjs(), viewType = ViewType.Week, showAgenda = false, isEventPerspective = false, newConfig = undefined, newBehaviors = undefined) {
        this.resources = [];
        this.events = [];
        this.eventGroups = [];
    Severity: Major
    Found in src/components/SchedulerData.js - About 1 day to fix

      Function _getSpan has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
      Open

        _getSpan(startTime, endTime, headers) {
          if (this.showAgenda) return 1;
      
          // function startOfWeek(date) {
          //   const day = date.getDay();
      Severity: Minor
      Found in src/components/SchedulerData.js - About 6 hrs 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 setViewType has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

        setViewType(viewType = ViewType.Week, showAgenda = false, isEventPerspective = false) {
          this.showAgenda = showAgenda;
          this.isEventPerspective = isEventPerspective;
          this.cellUnit = CellUnit.Day;
      
      
      Severity: Minor
      Found in src/components/SchedulerData.js - About 5 hrs 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 _createHeaders has a Cognitive Complexity of 36 (exceeds 5 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: Minor
      Found in src/components/SchedulerData.js - About 5 hrs 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 _createRenderData has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _createRenderData() {
          const initRenderData = this._createInitRenderData(this.isEventPerspective, this.eventGroups, this.resources, this.headers);
          // this.events.sort(this._compare);
          const cellMaxEventsCount = this.getCellMaxEvents();
          const cellMaxEventsCountValue = 30;
      Severity: Major
      Found in src/components/SchedulerData.js - About 3 hrs to fix

        Function _createInitRenderData has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _createInitRenderData(isEventPerspective, eventGroups, resources, headers) {
            const slots = isEventPerspective ? eventGroups : resources;
            const slotTree = [];
            const slotMap = new Map();
            slots.forEach(slot => {
        Severity: Major
        Found in src/components/SchedulerData.js - About 2 hrs to fix

          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

            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

              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 _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

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

                        toggleExpandStatus(slotId) {
                          let slotEntered = false;
                          let slotIndent = -1;
                          let isExpanded = false;
                          const expandedMap = new Map();
                      Severity: Minor
                      Found in src/components/SchedulerData.js - About 1 hr to fix

                        Function _createInitHeaderEvents has a Cognitive Complexity of 10 (exceeds 5 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

                        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 _createInitRenderData has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                          _createInitRenderData(isEventPerspective, eventGroups, resources, headers) {
                            const slots = isEventPerspective ? eventGroups : resources;
                            const slotTree = [];
                            const slotMap = new Map();
                            slots.forEach(slot => {
                        Severity: Minor
                        Found in src/components/SchedulerData.js - About 55 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

                        Avoid deeply nested control flow statements.
                        Open

                                    if (selectDate >= start && selectDate < end) {
                                      date = this.selectDate;
                                    }
                        Severity: Major
                        Found in src/components/SchedulerData.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                              } else if (this.cellUnit === CellUnit.Year) {
                                while (header >= start && header <= end) {
                                  const time = header.format(DATE_FORMAT);
                                  headers.push({ time });
                                  header = header.add(1, 'years').startOf('year');
                          Severity: Major
                          Found in src/components/SchedulerData.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                  while (header >= start && header <= end) {
                                    const time = header.format(DATE_FORMAT);
                                    headers.push({ time });
                                    header = header.add(1, 'months').startOf('month');
                                  }
                            Severity: Major
                            Found in src/components/SchedulerData.js - About 45 mins to fix

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

                                _compare(event1, event2) {
                                  const start1 = this.localeDayjs(event1.start);
                                  const start2 = this.localeDayjs(event2.start);
                                  if (start1 !== start2) return start1 < start2 ? -1 : 1;
                              
                              
                              Severity: Minor
                              Found in src/components/SchedulerData.js - 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

                                        if (viewType === ViewType.Day) {
                                          this.startDate = date;
                                          this.endDate = this.startDate;
                                          this.cellUnit = CellUnit.Hour;
                                        } else if (viewType === ViewType.Week) {
                              Severity: Major
                              Found in src/components/SchedulerData.js and 1 other location - About 1 day to fix
                              src/components/SchedulerData.js on lines 170..182

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

                              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 (viewType === ViewType.Week) {
                                          this.startDate = this.localeDayjs(new Date(date)).startOf('week');
                                          this.endDate = this.localeDayjs(new Date(this.startDate)).endOf('week');
                                        } else if (viewType === ViewType.Month) {
                                          this.startDate = this.localeDayjs(new Date(date)).startOf('month');
                              Severity: Major
                              Found in src/components/SchedulerData.js and 1 other location - About 1 day to fix
                              src/components/SchedulerData.js on lines 199..212

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

                              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

                                _validateResource(resources) {
                                  if (Object.prototype.toString.call(resources) !== '[object Array]') {
                                    throw new Error('Resources should be Array object');
                                  }
                              
                              
                              Severity: Major
                              Found in src/components/SchedulerData.js and 1 other location - About 6 hrs to fix
                              src/components/SchedulerData.js on lines 1044..1059

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

                              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

                                _validateEventGroups(eventGroups) {
                                  if (Object.prototype.toString.call(eventGroups) !== '[object Array]') {
                                    throw new Error('Event groups should be Array object');
                                  }
                              
                              
                              Severity: Major
                              Found in src/components/SchedulerData.js and 1 other location - About 6 hrs to fix
                              src/components/SchedulerData.js on lines 1027..1042

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

                              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

                              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

                                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

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

                                  } else if (this.cellUnit === CellUnit.Year) {
                                    while (header >= start && header <= end) {
                                      const time = header.format(DATE_FORMAT);
                                      headers.push({ time });
                                      header = header.add(1, 'years').startOf('year');
                              Severity: Major
                              Found in src/components/SchedulerData.js and 2 other locations - About 2 hrs to fix
                              src/components/SchedulerData.js on lines 709..727
                              src/components/SchedulerData.js on lines 715..727

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

                              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

                                  } else if (this.cellUnit === CellUnit.Week) {
                                    while (header >= start && header <= end) {
                                      const time = header.format(DATE_FORMAT);
                                      headers.push({ time });
                                      header = header.add(1, 'weeks').startOf('week');
                              Severity: Major
                              Found in src/components/SchedulerData.js and 2 other locations - About 2 hrs to fix
                              src/components/SchedulerData.js on lines 715..727
                              src/components/SchedulerData.js on lines 721..727

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

                              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

                                  } else if (this.cellUnit === CellUnit.Month) {
                                    while (header >= start && header <= end) {
                                      const time = header.format(DATE_FORMAT);
                                      headers.push({ time });
                                      header = header.add(1, 'months').startOf('month');
                              Severity: Major
                              Found in src/components/SchedulerData.js and 2 other locations - About 2 hrs to fix
                              src/components/SchedulerData.js on lines 709..727
                              src/components/SchedulerData.js on lines 721..727

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

                              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

                                isContentViewResponsive() {
                                  const contentCellWidth = this.getContentCellConfigWidth();
                                  return !!contentCellWidth.endsWith && contentCellWidth.endsWith('%');
                                }
                              Severity: Minor
                              Found in src/components/SchedulerData.js and 1 other location - About 30 mins to fix
                              src/components/SchedulerData.js on lines 269..272

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

                              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

                                          ? this.localeDayjs.utc(time).utcOffset(this.localeDayjs(new Date().utcOffset)(), true).format(DATETIME_FORMAT)
                              Severity: Minor
                              Found in src/components/SchedulerData.js and 1 other location - About 30 mins to fix
                              src/components/SchedulerData.js on lines 589..592

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

                              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

                                          ? this.localeDayjs
                                            .utc(time)
                                            .utcOffset(this.localeDayjs(new Date().utcOffset)(), true)
                                            .add(oldEnd.diff(oldStart), 'ms')
                              Severity: Minor
                              Found in src/components/SchedulerData.js and 1 other location - About 30 mins to fix
                              src/components/SchedulerData.js on lines 586..586

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

                              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

                                      .format(this.cellUnit === CellUnit.Year || this.cellUnit === CellUnit.Month || this.cellUnit === CellUnit.Week ? DATE_FORMAT : DATETIME_FORMAT);
                              Severity: Minor
                              Found in src/components/SchedulerData.js and 1 other location - About 30 mins to fix
                              src/components/SchedulerData.js on lines 1000..1000

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

                              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

                                isResourceViewResponsive() {
                                  const resourceTableWidth = this.getResourceTableConfigWidth();
                                  return !!resourceTableWidth.endsWith && resourceTableWidth.endsWith('%');
                                }
                              Severity: Minor
                              Found in src/components/SchedulerData.js and 1 other location - About 30 mins to fix
                              src/components/SchedulerData.js on lines 274..277

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

                              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

                                  } else if (this.viewType === ViewType.Week || this.viewType === ViewType.Month || this.viewType === ViewType.Quarter || this.viewType === ViewType.Year) {
                              Severity: Minor
                              Found in src/components/SchedulerData.js and 1 other location - About 30 mins to fix
                              src/components/SchedulerData.js on lines 809..809

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

                              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