Showing 1,205 of 1,252 total issues
Avoid too many return
statements within this function. Open
Open
return {
...state,
[answerId]: {
...state[answerId],
isEnableObjectSelection: false,
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return {
...state,
[answerId]: {
...state[answerId],
isCanvasSave: false,
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return {
...state,
[answerId]: {
...state[answerId],
isRedo: false,
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return { ...state, disabled: false };
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return {
...state,
[answerId]: {
...state[answerId],
fontSize,
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return {
...state,
[answerId]: {
...state[answerId],
hasNoFill,
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return {
...state,
[answerId]: {
...state[answerId],
colors: { ...colors, [coloringTool]: color },
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return produce(state, (draft) => {
const currentState = draft[answerId];
if (!currentState) throw new Error(`currentState is ${currentState}`);
const currentStateIndex = currentState.currentStateIndex;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return {
...state,
[answerId]: {
...state[answerId],
activeObject,
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return {
...state,
[answerId]: {
...state[answerId],
isDelete: false,
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return {
...state,
[answerId]: {
...state[answerId],
isEnableObjectSelection: true,
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return redirect(`/courses/${courseId}/videos`);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return state;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return a.updatedAt > b.updatedAt ? -1 : 1;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return a.updatedAt > b.updatedAt ? 1 : -1;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return drafting ? value : parsedValue;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return INVALID_HEARTBEAT_COLOR;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return VALID_HEARTBEAT_COLOR;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return t(translations.wrong);
- Create a ticketCreate a ticket
Function formatErrorMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
export const formatErrorMessage = (errorOrWarning, intl = false) => {
if (!errorOrWarning || typeof errorOrWarning === 'string') {
return errorOrWarning;
}
if (Array.isArray(errorOrWarning)) {
- 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"