react-scheduler/react-big-schedule

View on GitHub

Showing 57 of 504 total issues

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

  setViewType(viewType = ViewType.Week, showAgenda = false, isEventPerspective = false) {
    this.showAgenda = showAgenda;
    this.isEventPerspective = isEventPerspective;
    this.cellUnit = CellUnit.Day;

Severity: Major
Found in src/components/SchedulerData.js - About 2 hrs to fix

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

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

      Function render has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

        render() {
          const { schedulerData, leftCustomHeader, rightCustomHeader } = this.props;
          const { viewType, renderData, showAgenda, config } = schedulerData;
          const width = schedulerData.getSchedulerWidth();
      
      
      Severity: Minor
      Found in src/components/index.jsx - About 2 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 BodyView has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

      function BodyView({ schedulerData }) {
        const { renderData, headers, config, behaviors } = schedulerData;
        const width = schedulerData.getContentCellWidth();
      
        const tableRows = renderData
      Severity: Minor
      Found in src/components/BodyView.jsx - About 2 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 hover has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          hover: (props, monitor, component) => {
            const { schedulerData, resourceEvents, movingEvent } = props;
            const { cellUnit, config, viewType, localeDayjs } = schedulerData;
            this.config = config;
            const item = monitor.getItem();
      Severity: Major
      Found in src/components/DnDContext.js - About 2 hrs to fix

        Function AddMorePopover has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function AddMorePopover(props) {
          const { schedulerData, headerItem, left, top, height, closeAction } = props;
          const { config, localeDayjs } = schedulerData;
          const { time, start, end, events } = headerItem;
        
        
        Severity: Minor
        Found in src/components/AddMorePopover.jsx - About 1 hr to fix

          Function AgendaResourceEvents has 47 lines of code (exceeds 25 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 1 hr to fix

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

              const renderSlotItem = (item, indents) => {
                let indent = <span key={`es${item.indent}`} className="expander-space" />;
            
                const iconProps = { key: `es${item.indent}`, onClick: () => handleToggleExpand(item) };
                if (item.hasChildren) {
            Severity: Minor
            Found in src/components/ResourceView.jsx - About 1 hr to fix

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

                render() {
                  const { viewModel } = this.state;
              
                  let popover = <div />;
                  if (this.state.headerItem !== undefined) {
              Severity: Minor
              Found in src/examples/AddMore.jsx - About 1 hr 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 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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language