Showing 7 of 9 total issues
Function DirSelect
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const DirSelect: React.FunctionComponent = () => {
const [data, setData] = useState(null);
const [selectedCount, setSelectedCount] = useState<number>(0);
const [selected, setSelected] = useState(null);
const [done, setDone] = useState(false);
File Questions.tsx
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useState, useEffect, useCallback, useMemo } from "react";
import chalk from "chalk";
import { convertBytes } from "g-factor";
import yn from "yn";
import { fork } from "child_process";
Function RemoveDirs
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const RemoveDirs = () => {
const [done, setDone] = useState(false);
const [successMessage, setSuccessMessage] = useState("");
useEffect(() => {
const Dir_List = SelectDirList(store.getState());
Function Interrogator
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Interrogator: React.FunctionComponent = () => {
const [RStore, setRStore] = useState(store.getState());
useEffect(() => {
const unsubscribe = store.subscribe(() => {
Function TextInput
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TextInput: React.FunctionComponent<ITextInputProps> = props => {
const [query, setQuery] = useState<string>("");
const [submitted, setSubmitted] = useState<boolean>(false);
const handleChange = (q: string) => {
setQuery(props.onChange(q));
Function ConfirmDeletion
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ConfirmDeletion: React.FunctionComponent<IConfirmDeletionProps> = props => {
const handleChange = q => {
return q;
};
Function DirSelect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
export const DirSelect: React.FunctionComponent = () => {
const [data, setData] = useState(null);
const [selectedCount, setSelectedCount] = useState<number>(0);
const [selected, setSelected] = useState(null);
const [done, setDone] = useState(false);
- 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"