Showing 1,205 of 1,252 total issues
Function PersonalTimeEditor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const PersonalTimeEditor: FC<Props> = (props) => {
const { item, intl } = props;
const initialValues = {
fixed: item.fixed,
startAt: item.personalStartAt,
- 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 CoursesIndex
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const CoursesIndex: FC = () => {
const { t } = useTranslation();
const [params] = useSearchParams();
- 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 McqWidget
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const McqWidget = (props: McqWidgetProps): JSX.Element | null => {
const { for: question } = props;
const { t } = useTranslation();
const [expanded, setExpanded] = useState(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 FinaliseButton
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const FinaliseButton: FC = () => {
const { t } = useTranslation();
const assessment = useAppSelector(getAssessment);
const submission = useAppSelector(getSubmission);
const questions = useAppSelector(getQuestions);
- 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
Avoid too many return
statements within this function. Open
return { ...state, isUnsubmittingResponse: false };
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return state;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return { ...state, isLoadingSurveys: false };
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return { ...state, isQuestionMoved: true };
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return { ...state, isQuestionMoved: false, disableSurveyShow: false };
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return (
<Typography color="error" variant="body2">
<FormattedMessage
defaultMessage="Failed submitting this form. Please try again."
id="lib.components.core.ErrorText.error"
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return { ...state, isUnsubmittingResponse: true };
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return { ...state, confirmationOpen: true };
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return { ...state, confirmationOpen: false };
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return produce(state, (draft) => {
draft.clientVersionByAnswerId[answerId] = clientVersion;
});
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return { ...state, isDuplicating: false, isDuplicationSuccess: true };
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return {
...state,
isUpdatingComment: false,
posts: {
...state.posts,
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return state;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return {
...state,
milestones,
groups: groupItemsUnderMilestones(state.items, milestones),
};
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return {
...state,
response: action.response,
flags: { ...state.flags, ...action.flags },
};
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return {
...state,
[questionId]: {
...state[questionId],
isResetting: false,
- Create a ticketCreate a ticket