pranshuchittora/autarky

View on GitHub

Showing 7 of 9 total issues

Function DirSelect has 124 lines of code (exceeds 25 allowed). Consider refactoring.
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);
Severity: Major
Found in src/ui/containers/Interrogator/Questions.tsx - About 4 hrs to fix

    File Questions.tsx has 256 lines of code (exceeds 250 allowed). Consider refactoring.
    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";
    Severity: Minor
    Found in src/ui/containers/Interrogator/Questions.tsx - About 2 hrs to fix

      Function RemoveDirs has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const RemoveDirs = () => {
        const [done, setDone] = useState(false);
        const [successMessage, setSuccessMessage] = useState("");
        useEffect(() => {
          const Dir_List = SelectDirList(store.getState());
      Severity: Major
      Found in src/ui/containers/Interrogator/Questions.tsx - About 2 hrs to fix

        Function Interrogator has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const Interrogator: React.FunctionComponent = () => {
          const [RStore, setRStore] = useState(store.getState());
        
          useEffect(() => {
            const unsubscribe = store.subscribe(() => {
        Severity: Minor
        Found in src/ui/containers/Interrogator/index.tsx - About 1 hr to fix

          Function TextInput has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          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));
          Severity: Minor
          Found in src/ui/components/TextInput/index.tsx - About 1 hr to fix

            Function ConfirmDeletion has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const ConfirmDeletion: React.FunctionComponent<IConfirmDeletionProps> = props => {
              const handleChange = q => {
                return q;
              };
            
            
            Severity: Minor
            Found in src/ui/containers/Interrogator/Questions.tsx - About 1 hr to fix

              Function DirSelect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              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);
              Severity: Minor
              Found in src/ui/containers/Interrogator/Questions.tsx - About 25 mins 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