ethanneff/example

View on GitHub

Showing 49 of 120 total issues

Function LapsTable has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const LapsTable = ({ laps, timer }: LapTableProperties) => {
  const finishedLaps = laps.slice(1);
  let min = Number.MAX_SAFE_INTEGER;
  let max = Number.MIN_SAFE_INTEGER;
  if (finishedLaps.length >= 2)
Severity: Minor
Found in src/apps/Playground/Creations/AppleStopwatch/LapsTable.tsx - About 55 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

Function EditItem has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const EditItem = () => {
  const dispatch = useAppDispatch();
  const activeMessage = useAppSelector(getActiveChatMessage);
  const messageReference = useRef(activeMessage?.message ?? '');

Severity: Minor
Found in src/apps/Playground/Features/Chat/EditItem.tsx - About 35 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

Avoid too many return statements within this function.
Open

      return (
        <Notification
          onCancel={handleClose}
          title="bob"
        />
Severity: Major
Found in src/apps/Playground/Components/Modals/index.tsx - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return null;
    Severity: Major
    Found in src/apps/Playground/Components/Modals/index.tsx - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return (
              <Modal
                onBackgroundPress={handleClose}
                showOverlay
              >
      Severity: Major
      Found in src/apps/Playground/Components/Modals/index.tsx - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return (
                <Modal
                  onBackgroundPress={handleClose}
                  showOverlay
                >
        Severity: Major
        Found in src/apps/Playground/Components/Modals/index.tsx - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return <Loading onBackgroundPress={handleClose} />;
          Severity: Major
          Found in src/apps/Playground/Components/Modals/index.tsx - About 30 mins to fix

            Function RateApp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export const RateApp = ({ onComplete }: Properties) => {
              const ratingReference = useRef(0);
              const navigatedToAppStore = useRef(false);
              const [form, setForm] = useState<State>(initialState);
              const styles = StyleSheet.create({
            Severity: Minor
            Found in src/features/RateApp/index.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

            Function getPosition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export const getPosition = (position: Position): Vector => {
              const dx = position.current.x - position.change.dx;
              const dy = position.current.y + position.change.dy;
              const y =
                dy < 0
            Severity: Minor
            Found in src/apps/Playground/Games/Drift/utils.ts - 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