Showing 332 of 806 total issues
Function getSegmentSprites
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getSegmentSprites (components) {
// 1) Loop through each component group that makes up the segment.
const sprites = Object.entries(components).reduce(
(graphicsArray, componentGroup) => {
const [group, groupItems] = componentGroup
- 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 updateStreetMargin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function updateStreetMargin (
canvasRef,
streetOuterRef,
dontDelay = false
) {
- 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 handleSegmentResizeStart
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function handleSegmentResizeStart (event) {
let x, y
if (app.readOnly) {
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 GalleryPanel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function GalleryPanel (): React.ReactElement {
// Mode is set in state after streets have loaded
// We use RTK Query to load user data in this component
// There might be a better way of combining these requests!
const mode = useSelector((state) => state.gallery.mode)
- 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 isOwnedByCurrentUser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function isOwnedByCurrentUser () {
const state = store.getState()
if (!state) return false
- 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 CustomScale
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function CustomScale ({ scale, baseDimensions = {}, onChange = () => {} }) {
const units = useSelector((state) => state.settings.units)
const allowCustomScale = useSelector(
(state) => state.flags.SAVE_AS_IMAGE_CUSTOM_DPI.value
)
- 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 drawWatermark
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function drawWatermark (ctx, dpi, invert = false) {
const text = formatMessage(
'export.watermark',
'Made with {streetmixWordmark}',
{
- 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 handleSegmentResizeMove
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function handleSegmentResizeMove (event) {
let x, y, resizeType
if (event.touches && event.touches[0]) {
x = event.touches[0].pageX
y = event.touches[0].pageY
- 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 makeSpaceBetweenSegments
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function makeSpaceBetweenSegments (dataNo, draggingState) {
const { segmentBeforeEl, segmentAfterEl } = draggingState
let spaceBetweenSegments = 0
- 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 Warnings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Warnings = (props: WarningsProps): React.ReactElement | null => {
const { segment } = props
const messages = []
if (segment?.warnings === undefined) return null
- 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 MenuBarItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function MenuBarItem ({
translation = '',
label = '',
tooltip,
url,
- 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 getSegmentCapacity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getSegmentCapacity (
segment: Segment,
source: string = DEFAULT_CAPACITY_SOURCE
): CapacityForDisplay | undefined {
let capacity = getCapacityData(source).segments[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"