react-scheduler/react-big-schedule

View on GitHub

Showing 57 of 504 total issues

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

        drop: (props, monitor, component) => {
          const { schedulerData, resourceEvents } = props;
          const { cellUnit, localeDayjs } = schedulerData;
          const type = monitor.getItemType();
          const pos = getPos(component.eventContainer);
    Severity: Minor
    Found in src/components/DnDContext.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 render has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

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

          Function getCustomDate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          export const getCustomDate = (schedulerData, num, date = schedulerData.startDate) => {
            const { viewType, localeDayjs } = schedulerData;
            let startDate;
            let endDate;
            let cellUnit;
          Severity: Minor
          Found in src/helper/behaviors.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

          Function EventItemPopover has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          function EventItemPopover({
            schedulerData,
            eventItem,
            title,
            startTime,
          Severity: Minor
          Found in src/components/EventItemPopover.jsx - 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

          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

              Function componentDidMount has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                componentDidMount(props, state) {
                  const { schedulerData, parentRef } = this.props;
              
                  this.resolveScrollbarSize();
              
              
              Severity: Minor
              Found in src/components/index.jsx - About 45 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

              Function AgendaResourceEvents has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              function AgendaResourceEvents(props) {
                const { schedulerData, resourceEvents, slotClickedFunc, slotItemTemplateResolver } = props;
                const { startDate, endDate, config, localeDayjs } = schedulerData;
                const width = schedulerData.getResourceTableWidth() - 2;
              
              
              Severity: Minor
              Found in src/components/AgendaResourceEvents.jsx - About 45 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

                    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

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

                Function componentDidUpdate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  componentDidUpdate(props, state) {
                    this.resolveScrollbarSize();
                
                    const { schedulerData } = this.props;
                    const { localeDayjs, behaviors } = schedulerData;
                Severity: Minor
                Found in src/components/index.jsx - About 25 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

                Function Summary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                function Summary({ schedulerData, summary, left, width, top }) {
                  const { config } = schedulerData;
                  const color = summary.color !== undefined ? summary.color : config.summaryColor;
                  let textAlign = 'center';
                
                
                Severity: Minor
                Found in src/components/Summary.jsx - About 25 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

                Severity
                Category
                Status
                Source
                Language