civictechindex/CTI-website-frontend

View on GitHub

Showing 25 of 39 total issues

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

Function Faq has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
Open

const Faq = () => {
  const classes = useStyles();
  const theme = useTheme();
  const largeScreen = useMediaQuery(theme.breakpoints.up('sm'), {
    noSsr: true,
Severity: Minor
Found in src/pages/Faq/index.js - About 1 hr 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 IndvPageContainer has a Cognitive Complexity of 12 (exceeds 8 allowed). Consider refactoring.
Open

export const IndvPageContainer = (props) => {
  const classes = useStyles();
  const projectsPerPage = 4;

  const inputSortMethodList = ['best match', 'updated', 'stars'];
Severity: Minor
Found in src/pages/IndvOrganization/IndvPageContainer.js - 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 OrgChange has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring.
Open

export const OrgChange = ({
  value,
  orgName,
  setOrgName,
  setOrgTags,
Severity: Minor
Found in src/pages/TagGeneratorWizard/Organization.js - About 45 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 SortDropdown has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring.
Open

export const SortDropdown = ({
  inputSortMethodList,
  defaultSortMethod,
  setSortMethod,
}) => {
Severity: Minor
Found in src/components/SortDropdown.js - About 45 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