greylemon/redux-spreadsheet

View on GitHub

Showing 93 of 241 total issues

Function createFormulaParser has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
Open

export const createFormulaParser = (sheetsMap: ISheetsMap): FormulaParser =>
  new FormulaParser({
    onCell: ({ sheet, row: rowIndex, col: columnIndex }) => {
      let value: string | number | null = null

Severity: Minor
Found in src/tools/formula/parser.ts - About 7 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

File formula.ts has 479 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import uniqid from 'uniqid'
import {
  ISheetName,
  ISheetsMap,
  IDependentReferences,
Severity: Minor
Found in src/tools/formula/formula.ts - About 7 hrs to fix

    File SheetNavigation.tsx has 402 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, {
      useCallback,
      FunctionComponent,
      useRef,
      RefObject,
    Severity: Minor
    Found in src/components/sheetNavigation/SheetNavigation.tsx - About 5 hrs to fix

      File parser.ts has 382 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {
        Workbook,
        Worksheet,
        CellRichTextValue,
        WorksheetView,
      Severity: Minor
      Found in src/tools/parser.ts - About 5 hrs to fix

        File Sheet.tsx has 357 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, {
          FunctionComponent,
          useCallback,
          useMemo,
          KeyboardEvent,
        Severity: Minor
        Found in src/components/canvas_sheet/Sheet.tsx - About 4 hrs to fix

          Function MERGE_AREA has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          export const MERGE_AREA = (
            state: IExcelState,
            action: PayloadAction<IGeneralActionPayload & { activeCell: ICell }>
          ): IExcelState => {
            const data = nSelectActiveSheetData(state)
          Severity: Minor
          Found in src/redux/reducers/operations.ts - About 4 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

          File area.ts has 313 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {
            IPosition,
            ISelectionArea,
            IRange,
            IArea,
          Severity: Minor
          Found in src/tools/area.ts - About 3 hrs to fix

            Function deletePositions has 86 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const deletePositions = (
              sheetName: ISheetName,
              positions: IPosition[],
              sheetsMap: ISheetsMap,
              dependents: IDependentReferences,
            Severity: Major
            Found in src/tools/formula/formula.ts - About 3 hrs to fix

              Function selectFactoryIsStyle has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
              Open

              export const selectFactoryIsStyle = (
                editorStyle: DraftInlineStyleType,
                inlineStyleEqFn: IInlineStyleEqFn
              ) =>
                createSelector(
              Severity: Minor
              Found in src/redux/selectors/style.ts - About 3 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 isCellEqualOtherCell has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

              export const isCellEqualOtherCell = (
                cell: ICell,
                otherCell: ICell
              ): boolean => {
                if (cell === otherCell || (cell === undefined && otherCell === undefined))
              Severity: Minor
              Found in src/redux/tools/compare.ts - About 3 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 computeSelectionAreaBottomRightStyle has 81 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const computeSelectionAreaBottomRightStyle: IComputeSelectionAreaStyle = (
                columnWidths: IColumnWidths,
                columnOffsets: IColumnOffsets,
                rowHeights: IRowHeights,
                rowOffsets: IRowOffsets,
              Severity: Major
              Found in src/tools/styles/bottom_right_pane.ts - About 3 hrs to fix

                Function updateActiveCellRef has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const updateActiveCellRef = (
                  sheetName: ISheetName,
                  position: IPosition,
                  sheetsMap: ISheetsMap,
                  dependents: IDependentReferences,
                Severity: Major
                Found in src/tools/formula/formula.ts - About 3 hrs to fix

                  File mouse.ts has 296 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { PayloadAction } from '@reduxjs/toolkit'
                  import { EditorState } from 'draft-js'
                  import {
                    IPosition,
                    IExcelState,
                  Severity: Minor
                  Found in src/redux/reducers/mouse.ts - About 3 hrs to fix

                    Function EditorCell has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const EditorCell: FunctionComponent = () => {
                      const dispatch = useDispatch()
                    
                      const {
                        isEditMode,
                    Severity: Major
                    Found in src/components/canvas_sheet/EditableCell.tsx - About 3 hrs to fix

                      Function computeSelectionAreaBottomLeftStyle has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const computeSelectionAreaBottomLeftStyle: IComputeSelectionAreaStyle = (
                        columnWidths: IColumnWidths,
                        columnOffsets: IColumnOffsets,
                        rowHeights: IRowHeights,
                        rowOffsets: IRowOffsets,
                      Severity: Major
                      Found in src/tools/styles/bottom_left_pane.ts - About 2 hrs to fix

                        Function computeSelectionAreaBottomRightStyle has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const computeSelectionAreaBottomRightStyle: IComputeSelectionAreaStyle = (
                          columnWidths: IColumnWidths,
                          columnOffsets: IColumnOffsets,
                          rowHeights: IRowHeights,
                          rowOffsets: IRowOffsets,
                        Severity: Minor
                        Found in src/tools/styles/bottom_right_pane.ts - 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

                        File factory.ts has 287 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /* eslint-disable */
                        import { createSelector } from '@reduxjs/toolkit'
                        import {
                          normalizeRowHeightFromArray,
                          normalizeColumnWidthFromArray,
                        Severity: Minor
                        Found in src/redux/selectors/factory.ts - About 2 hrs to fix

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

                          export const computeSelectionAreaTopRightStyle: IComputeSelectionAreaStyle = (
                            columnWidths: IColumnWidths,
                            columnOffsets: IColumnOffsets,
                            rowHeights: IRowHeights,
                            rowOffsets: IRowOffsets,
                          Severity: Major
                          Found in src/tools/styles/top_right_pane.ts - About 2 hrs to fix

                            File ContentPane.tsx has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import React, { FunctionComponent, useMemo, useCallback } from 'react'
                            import { Group, Rect, Line } from 'react-konva'
                            import { useDispatch } from 'react-redux'
                            import { IGenericPaneProps } from '../../@types/components'
                            import { IBlockStyles, IPosition } from '../../@types/state'
                            Severity: Minor
                            Found in src/components/canvas_sheet/ContentPane.tsx - About 2 hrs to fix

                              Function createValueFromEditorState has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export const createValueFromEditorState = (
                                editorState: EditorState
                              ): Partial<ICell> => {
                                const richText: IRichTextValue = []
                              
                              
                              Severity: Minor
                              Found in src/tools/text.ts - 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

                              Severity
                              Category
                              Status
                              Source
                              Language