Showing 110 of 370 total issues
Function ElevationControl
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function ElevationControl ({ position, segment, forceEnable = false }) {
const isSubscriber = useSelector((state) => state.user.isSubscriber)
const dispatch = useDispatch()
const intl = useIntl()
- Read upRead up
- Create a ticketCreate a ticket
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 drawSegmentImage
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
id,
ctx,
sx = 0,
sy = 0,
sw,
- Create a ticketCreate a ticket
Function render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
render () {
const { segment, enableAnalytics = true, capacitySource } = this.props
const segmentInfo = getSegmentInfo(segment.type)
- Read upRead up
- Create a ticketCreate a ticket
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 componentDidUpdate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
componentDidUpdate (prevProps, prevState) {
if (prevProps.street.width !== this.props.street.width) {
// We are permitted one setState in componentDidUpdate if
// it's inside of a condition, like it is now.
this.handleStreetResize()
- Read upRead up
- Create a ticketCreate a ticket
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 updateUnits
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function updateUnits (newUnits) {
let fromUndo
const street = store.getState().street
if (street.units === newUnits) {
return
- Read upRead up
- Create a ticketCreate a ticket
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 getMenuPosition
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function getMenuPosition (
el: HTMLElement | null, // menu container element
menuItemNode?: HTMLElement, // menu content element
contentDirection: 'ltr' | 'rtl' = 'ltr',
alignOpposite = false // whether element is right-aligned
- Read upRead up
- Create a ticketCreate a ticket
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 drawBuilding
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
ctx,
variant,
floors,
position,
totalWidth,
- Create a ticketCreate a ticket
Function drawSegmentContents
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
ctx,
type,
variantString,
actualWidth,
offsetLeft,
- Create a ticketCreate a ticket
Function onGlobalKeyDown
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function onGlobalKeyDown (event) {
const toExecute = []
const key = event.key
// There is a bug in Chrome where events can be fired with an
- Read upRead up
- Create a ticketCreate a ticket
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 parseStringForUnits
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Confirmed
function parseStringForUnits (widthInput: string, units: UnitsSetting): number {
if (widthInput.includes('-')) {
widthInput = widthInput.replace(/-/g, '') // Dashes would mean negative in the parseFloat
}
- Read upRead up
- Create a ticketCreate a ticket
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 drawStreetThumbnail
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function drawStreetThumbnail (
ctx,
street,
{
width,
- Read upRead up
- Create a ticketCreate a ticket
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 getRandomObjects
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function getRandomObjects (
pool,
maxWidth,
randSeed = 9123984, // self defined randSeed if one is not provided
minSpacing,
- Read upRead up
- Create a ticketCreate a ticket
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 ProfileSettings
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function ProfileSettings (props) {
const displayNameInputRef = useRef()
const user = useSelector((state) => state.user.signInData?.details)
const [displayNameValue, setDisplayNameValue] = useState(
user.displayName || user.id
- Read upRead up
- Create a ticketCreate a ticket
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 WhatsNewDialog
has 102 lines of code (exceeds 100 allowed). Consider refactoring. Open
const WhatsNewDialog = () => {
const locale = useSelector((state) => state.locale.locale)
const [state, setSubmitState] = useState('LOADING')
const [content, setContent] = useState(null)
const [scrollShade, setScrollShade] = useState(false)
- Create a ticketCreate a ticket
Function getRandomObjects
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
pool,
maxWidth,
randSeed = 9123984, // self defined randSeed if one is not provided
minSpacing,
maxSpacing,
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
(item.shiftKey === event.shiftKey || item.shiftKey === 'optional') &&
(item.altKey === event.altKey || item.altKey === 'optional') &&
(item.metaKey === event.metaKey ||
item.metaKey === event.ctrlKey ||
- Create a ticketCreate a ticket
Function drawSky
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
ctx,
street,
width,
height,
dpi,
- Create a ticketCreate a ticket
Function unpackServerStreetData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function unpackServerStreetData (
transmission,
id,
namespacedId,
checkIfNeedsToBeRemixed
- Read upRead up
- Create a ticketCreate a ticket
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 handleSegmentCanvasDrop
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function handleSegmentCanvasDrop (draggedItem, type) {
// `oldDraggingState` can be `null` or undefined, if so, bail
if (!oldDraggingState) return
const { segmentBeforeEl, segmentAfterEl, draggedSegment } = oldDraggingState
- Read upRead up
- Create a ticketCreate a ticket
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 ToastContainer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function ToastContainer (): React.ReactElement {
const config = TOAST_SPRING_CONFIG
const [refMap] = useState(() => new WeakMap())
const [cancelMap] = useState(() => new WeakMap())
const toasts = useSelector((state) => state.toasts)
- Read upRead up
- Create a ticketCreate a ticket
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"