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()
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('')
- Read upRead up
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,
- Read upRead up
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('')
Function sortableTreeKeyboardCoordinates
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
(context, indicator, indentationWidth) =>
(
event,
{
currentCoordinates,
- Read upRead up
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)
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;
- Read upRead up
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'
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)
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
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()
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,
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;
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()
Function Menu
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
export const Menu: React.FC<MenuProps> = ({
id,
theme,
style,
className,
- Read upRead up
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,
- Read upRead up
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()
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()
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)
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()