streetmix/streetmix

View on GitHub
client/src/dialogs/GeotagDialog.jsx

Summary

Maintainability
C
1 day
Test Coverage

Function GeotagDialog has 169 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function GeotagDialog () {
  // this kinda goofy props object is a result of refactoring
  // some legacy code. definetly worth refactoring further in the future
  // if it causes other problems or confusion
  const props = {
Severity: Major
Found in client/src/dialogs/GeotagDialog.jsx - About 6 hrs to fix

File GeotagDialog.jsx has 262 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* global L */
import React, { useState } from 'react'
import PropTypes from 'prop-types'
import { useSelector, useDispatch, batch } from 'react-redux'
import { useIntl } from 'react-intl'
Severity: Minor
Found in client/src/dialogs/GeotagDialog.jsx - About 2 hrs to fix

Function getInitialState has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getInitialState (props) {
  // Determine initial map center, and what to display
  let mapCenter, zoom, markerLocation, label

  // If street has a location object, use its position and data
Severity: Minor
Found in client/src/dialogs/GeotagDialog.jsx - About 1 hr to fix

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

function GeotagDialog () {
  // this kinda goofy props object is a result of refactoring
  // some legacy code. definetly worth refactoring further in the future
  // if it causes other problems or confusion
  const props = {
Severity: Minor
Found in client/src/dialogs/GeotagDialog.jsx - 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

There are no issues that match your filters.

Category
Status