Showing 110 of 370 total issues
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 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 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 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 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 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 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 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 SentimentSurveyContainer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function SentimentSurveyContainer (props) {
const [isVisible, setVisible] = useState(false)
const [isDismissed, setDismissed] = useState(false)
const [streetId, setStreetId] = useState(null)
const street = useSelector((state) => state.street)
- 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function execute (input, event) {
// Check if condition is satisfied
if (!input.condition()) return
// Check if focus is on the correct place
- 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"