Showing 137 of 185 total issues

Function Report has 306 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function Report(): JSX.Element {
  const [report, setReport] = useRecoilState(reportState)
  const [onlyCompleted, setOnlyCompleted] = useState(true)
  const { tags } = useTagHistory()
  const manager = useTaskManager()
Severity: Major
Found in src/components/Report.tsx - About 1 day to fix

    Function TodoEditor has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
    Open

    export function TodoEditor(): JSX.Element {
      const manager = useTaskManager()
      const rootText = manager.getText()
      const [saving] = useStorageWatcher()
      const [text, setText] = useState('')
    Severity: Minor
    Found in src/components/TodoEditor.tsx - About 1 day 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 SortableTree has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
    Open

    export function SortableTree({
      collapsible,
      indicator = false,
      indentationWidth = 20,
      removable,
    Severity: Minor
    Found in src/components/Tree/SortableTree.tsx - About 1 day 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 TodoEditor has 207 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function TodoEditor(): JSX.Element {
      const manager = useTaskManager()
      const rootText = manager.getText()
      const [saving] = useStorageWatcher()
      const [text, setText] = useState('')
    Severity: Major
    Found in src/components/TodoEditor.tsx - About 1 day to fix

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

        (context, indicator, indentationWidth) =>
        (
          event,
          {
            currentCoordinates,
      Severity: Minor
      Found in src/components/Tree/keyboardCoordinates.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

      Function SyncModal has 163 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function SyncModal(): JSX.Element {
        const manager = useTaskManager()
        const analytics = useAnalytics()
        const isLoggedIn = useOauthState()
        const [visible, setVisible] = useModal(MODAL.SYNC)
      Severity: Major
      Found in src/components/Sync/SyncModal.tsx - About 6 hrs to fix

        Function createKeyboardController has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

        export function createKeyboardController() {
          const menuList = new Map<HTMLElement, Menu>();
          let focusedIndex: number;
          let parentNode: HTMLElement;
          let isRoot: boolean;
        Severity: Minor
        Found in src/lib/react-contexify/components/keyboardController.ts - 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

        File Report.tsx has 395 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { useState } from 'react'
        import { atom, useRecoilState } from 'recoil'
        import { color } from 'd3-color'
        
        import { Checkbox } from '@/components/Checkbox'
        Severity: Minor
        Found in src/components/Report.tsx - About 5 hrs to fix

          Function Autocomplete has 121 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            (props: AutocompleteProps, ref: React.RefObject<HTMLDivElement>) => {
              const { tags } = useTagHistory()
              const { times } = useTimeHistory()
              const [cursor, setCursor] = useState(CURSOR_NONE)
              const tokenPosition = useRef(0)
          Severity: Major
          Found in src/components/Autocomplete.tsx - About 4 hrs to fix

            Function TaskItem has 112 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const TaskItem: React.FC<TaskItemProps> = (
              props: TaskItemProps,
            ): JSX.Element => {
              const checkboxProps = props.checkboxProps
              const node = props.node
            Severity: Major
            Found in src/components/TaskItem.tsx - About 4 hrs to fix

              Function TagPicker has 107 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const TagPicker = (props: Props): JSX.Element => {
                const [currentTags, setCurrentTags] = useState(props.initialTags)
                const [inputTxt, setInputTxt] = useState('')
                const [tmpTag, setTmpTag] = useState<string>(null)
                const { tags, upsertTag } = useTagHistory()
              Severity: Major
              Found in src/components/Tag/TagPicker.tsx - About 4 hrs to fix

                File SortableTree.tsx has 341 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { useEffect, useMemo, useRef, useState } from 'react'
                import { createPortal } from 'react-dom'
                import {
                  Announcements,
                  DndContext,
                Severity: Minor
                Found in src/components/Tree/SortableTree.tsx - About 4 hrs to fix

                  Function createKeyboardController has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function createKeyboardController() {
                    const menuList = new Map<HTMLElement, Menu>();
                    let focusedIndex: number;
                    let parentNode: HTMLElement;
                    let isRoot: boolean;
                  Severity: Major
                  Found in src/lib/react-contexify/components/keyboardController.ts - About 4 hrs to fix

                    Function AlarmEditor has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function AlarmEditor(): JSX.Element {
                      const [minutes, setMinutes] = useState<number>(0)
                      const [timing, setTiming] = useState<Timing>({} as Timing)
                      const [alarms, setAlarms] = useStorage<AlarmRule[]>(STORAGE_KEY.ALARMS)
                      const analytics = useAnalytics()
                    Severity: Major
                    Found in src/components/Alarm/AlarmEditor.tsx - About 3 hrs to fix

                      Function Menu has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const Menu: React.FC<MenuProps> = ({
                        id,
                        theme,
                        style,
                        className,
                      Severity: Minor
                      Found in src/lib/react-contexify/components/Menu.tsx - 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 moveLine has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function moveLine(
                        current: number,
                        from: number,
                        to: number,
                        length: number,
                      Severity: Minor
                      Found in src/services/util.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 LineEditor has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function LineEditor(props: Props): JSX.Element {
                        const line = props.line
                        const manager = useTaskManager()
                        const analytics = useAnalytics()
                        const finishEdit = useEditFinish()
                      Severity: Major
                      Found in src/components/LineEditor.tsx - About 3 hrs to fix

                        Function useTaskManager has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function useTaskManager(): ITaskManager {
                          const [root, setRoot] = useRecoilState<Node>(nodeState)
                          const { moveTracking } = useTrackingMove()
                          const { moveEventLine } = useEventAlarm()
                          const { tags, upsertTag } = useTagHistory()
                        Severity: Major
                        Found in src/hooks/useTaskManager.ts - About 3 hrs to fix

                          Function TagContextMenu has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const TagContextMenu = (props: TagContextMenuProps) => {
                            const tag = props.tag
                            const manager = useTaskManager()
                            const [menuVisible, setMenuVisible] = useState(false)
                            const [pickerVisible, setPickerVisible] = useState(false)
                          Severity: Major
                          Found in src/components/Tag/TagContextMenu.tsx - About 3 hrs to fix

                            Function MyCalendar has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function MyCalendar(props: Props): JSX.Element {
                              const [visible, setVisible] = useState(false)
                              const { date, range, setDate, setDateRange } = useCalendarDate()
                              const { setKey, recordKeys } = useTaskRecordKey()
                              const analytics = useAnalytics()
                            Severity: Major
                            Found in src/components/Menu/Calendar.tsx - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language