Showing 287 of 1,073 total issues
Method to_turbo_stream
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def to_turbo_stream
controller.render(options.merge(formats: :html))
rescue ActionView::MissingTemplate => e
raise e if get?
- Read upRead up
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
Method sudo_update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sudo_update
unless current_user.valid_password?(params.dig(:user, :sudo_password))
Rails.logger.debug "Wrong password"
return render_400(:incorrect_password)
- Read upRead up
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
Method user
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def user
custom_data = event.metadata['custom']
return unless custom_data
user_id = custom_data.gsub(/^user-/, '').to_i
- Read upRead up
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 useLockedSolutionMentoringNote
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function useLockedSolutionMentoringNote(
request: MentorSessionRequest
): useLockedSolutionMentoringNoteReturns {
const [lockedUntil, setLockedUntil] = useState(dayjs(request.lockedUntil))
const [diff, setDiff] = useState(lockedUntil.diff(dayjs(), 'minute'))
- Read upRead up
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 Component
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Component = ({
sizeVariant = 'large',
tracks,
isFetching,
value,
- Read upRead up
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 Credits
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function Credits({
topLabel,
topCount,
bottomLabel,
bottomCount,
- Read upRead up
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 DiscussionActions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const DiscussionActions = ({
discussion,
links,
donation,
}: DiscussionActionsProps): JSX.Element => {
- Read upRead up
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 Component
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Component = ({
sizeVariant = 'large',
tracks,
isFetching,
value,
- Read upRead up
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 UnrevealedBadge
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const UnrevealedBadge = ({
badge,
cacheKey,
}: {
badge: BadgeProps
- Read upRead up
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 CroppingStep
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const CroppingStep = ({
state,
dispatch,
}: {
state: State
- Read upRead up
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 Introducer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function Introducer({
icon,
content,
children,
endpoint,
- Read upRead up
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 Representations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function Representations({
tracks,
counts,
links,
representationsRequest,
- Read upRead up
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 Component
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Component = ({
sizeVariant = 'large',
tracks,
isFetching,
value,
- Read upRead up
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
Avoid too many return
statements within this function. Open
return compartment.of(StreamLanguage.define(abapMode))
Avoid too many return
statements within this function. Open
return compartment.of(StreamLanguage.define(shell))
Avoid too many return
statements within this function. Open
if (parser.version) return compareVersions(parser.version, '80') >= 0
Avoid too many return
statements within this function. Open
return compartment.of(php())
Avoid too many return
statements within this function. Open
return compartment.of(rust())
Avoid too many return
statements within this function. Open
if (parser.version) return compareVersions(parser.version, '14.9') >= 0
Avoid too many return
statements within this function. Open
if (parser.version) return compareVersions(parser.version, '49') >= 0