civictechindex/CTI-website-frontend

View on GitHub
src/pages/TagGeneratorWizard/index.js

Summary

Maintainability
F
3 days
Test Coverage
B
85%

Function TagGeneratorWizard has 429 lines of code (exceeds 150 allowed). Consider refactoring.
Open

const TagGeneratorWizard = () => {
  const theme = useTheme();
  const classes = useStyles();
  const [changeValue, setChangeValue] = useQueryParam(
    'changeValue',
Severity: Major
Found in src/pages/TagGeneratorWizard/index.js - About 1 day to fix

File index.js has 505 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable max-lines-per-function */
/* eslint-disable complexity */

import React, { useState, useEffect, useRef } from 'react';
import Link from '../../components/common/Link';
Severity: Major
Found in src/pages/TagGeneratorWizard/index.js - About 1 day to fix

Function TagGeneratorWizard has a Cognitive Complexity of 37 (exceeds 8 allowed). Consider refactoring.
Open

const TagGeneratorWizard = () => {
  const theme = useTheme();
  const classes = useStyles();
  const [changeValue, setChangeValue] = useQueryParam(
    'changeValue',
Severity: Minor
Found in src/pages/TagGeneratorWizard/index.js - 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

Function renderCurrentState has 161 lines of code (exceeds 150 allowed). Consider refactoring.
Open

  const renderCurrentState = () => {
    switch (displayState) {
    case 'ProjectUrl':
      return (
        <>
Severity: Major
Found in src/pages/TagGeneratorWizard/index.js - About 1 hr to fix

There are no issues that match your filters.

Category
Status