Showing 110 of 371 total issues
Function drawSegmentContents
has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring. Open
export function drawSegmentContents (
ctx,
type,
variantString,
actualWidth,
- 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 Variants
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
function Variants (props) {
const { type, position } = props
// Get the appropriate variant information
const variant = useSelector((state) => {
- 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 getVariantInfoDimensions
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
export function getVariantInfoDimensions (variantInfo, actualWidth = 0) {
// Convert actualWidth to units that work with images' intrinsic dimensions
const displayWidth = actualWidth * TILE_SIZE_ACTUAL
const center = displayWidth / 2
- 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 doDropHeuristics
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
function doDropHeuristics (draggedItem, draggedItemType) {
// Automatically figure out width
const street = store.getState().street
const { variantString, type, actualWidth } = draggedItem
- 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
File BlockingError.jsx
has 535 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* BlockingError.jsx
*
* Displays a blocking error message on top of the application.
*
- Create a ticketCreate a ticket
File thumbnail.js
has 512 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { images } from '../app/load_resources'
import { drawLine } from '../util/canvas_drawing'
import { prettifyWidth } from '../util/width_units'
import { getSkyboxDef, makeCanvasGradientStopArray } from '../sky'
import {
- Create a ticketCreate a ticket
File InfoBubble.jsx
has 508 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { IntlProvider, FormattedMessage } from 'react-intl'
import debounce from 'just-debounce-it'
- Create a ticketCreate a ticket
Function SaveAsImageDialog
has 268 lines of code (exceeds 100 allowed). Consider refactoring. Open
function SaveAsImageDialog (props) {
const imageCanvas = useRef()
const [scale, setScale] = useState(1)
const [isLoading, setIsLoading] = useState(false)
const [isSaving, setIsSaving] = useState(false)
- Create a ticketCreate a ticket
Function drawSegmentContents
has 252 lines of code (exceeds 100 allowed). Consider refactoring. Open
export function drawSegmentContents (
ctx,
type,
variantString,
actualWidth,
- Create a ticketCreate a ticket
File street.ts
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { createSlice } from '@reduxjs/toolkit'
import type { PayloadAction } from '@reduxjs/toolkit'
import { getVariantString } from '../../segments/variant_utils'
import { DEFAULT_SKYBOX } from '../../sky/constants'
import {
- Create a ticketCreate a ticket
Function Variants
has 196 lines of code (exceeds 100 allowed). Consider refactoring. Open
function Variants (props) {
const { type, position } = props
// Get the appropriate variant information
const variant = useSelector((state) => {
- Create a ticketCreate a ticket
Function ProfileSettings
has 194 lines of code (exceeds 100 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
- Create a ticketCreate a ticket
File xhr.js
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
import clone from 'just-clone'
import { showError, ERRORS } from '../app/errors'
import {
checkIfEverythingIsLoaded,
setServerContacted
- Create a ticketCreate a ticket
Function drawBuilding
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export function drawBuilding (
ctx,
variant,
floors,
position,
- 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
File buildings.js
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
import seedrandom from 'seedrandom'
import { generateRandSeed } from '../util/random'
import { prettifyWidth, round } from '../util/width_units'
import { images } from '../app/load_resources'
import {
- Create a ticketCreate a ticket
Function processCommands
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
function processCommands (commands) {
// If a string, force to one-element array, otherwise expect an array of strings
if (typeof commands === 'string') {
commands = new Array(commands)
}
- 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 registerKeypress
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
export function registerKeypress (commands, options, callback) {
// Defaults
// For shiftKey, metaKey, and altKey, specifies what it should
// match on the event object reported by the browser. For instance,
// if event.metaKey is false, it means the command must be executed
- 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
File SignInDialog.jsx
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react'
import { FormattedMessage } from 'react-intl'
import {
goEmailSignIn,
goTwitterSignIn,
- Create a ticketCreate a ticket
Function Scrollable
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
const WrappedScrollable = forwardRef(function Scrollable (
props: ScrollableProps,
ref: React.Ref<HTMLDivElement>
): React.ReactElement {
const {
- 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 _signInLoaded
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function _signInLoaded () {
loadSettings()
const street = store.getState().street
let mode = getMode()
- 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"