Showing 1,205 of 1,252 total issues
Function GenerateProgrammingQuestionPage
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
const GenerateProgrammingQuestionPage = (): JSX.Element => {
const params = useParams();
const id = parseInt(params?.assessmentId ?? '', 10) || undefined;
if (!id)
throw new Error(
- 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 WarningDialog
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
const WarningDialog: FC = () => {
const { t } = useTranslation();
const assessment = useAppSelector(getAssessment);
const submission = useAppSelector(getSubmission);
- 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 default
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (state = initialState, action) {
const { type } = action;
switch (type) {
case actionTypes.LOAD_SURVEY_REQUEST: {
- Create a ticketCreate a ticket
Function render
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
intl,
conditionAttributes,
disabled,
- Create a ticketCreate a ticket
Function GlobalAnnouncements
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const GlobalAnnouncements = (
props: GlobalAnnouncementsProps,
): JSX.Element | null => {
const [announcements, setAnnouncements] = useState(props.in);
- Create a ticketCreate a ticket
Function CommentField
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CommentField: FC<Props> = (props: Props) => {
const { intl, topic, updateStatus } = props;
const dispatch = useAppDispatch();
const [value, setValue] = useState('');
const [disableCommentButton, setDisableCommentButton] = useState(true);
- Create a ticketCreate a ticket
Function CommentsSettingsForm
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CommentsSettingsForm = (
props: CommentsSettingsFormProps,
): JSX.Element => {
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function Breadcrumbs
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Breadcrumbs = (props: BreadcrumbProps): JSX.Element => {
const { in: crumbs } = props;
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function TimeLimitBanner
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TimeLimitBanner: FC<Props> = (props) => {
const { submissionTimeLimitAt } = props;
const initialCurrentTime = new Date().getTime();
const initialRemainingTime = submissionTimeLimitAt - initialCurrentTime;
- Create a ticketCreate a ticket
Function InstanceUserRoleRequestsIndex
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InstanceUserRoleRequestsIndex: FC<Props> = (props) => {
const { intl } = props;
const [isLoading, setIsLoading] = useState(true);
const roleRequests = useAppSelector(getAllRoleRequestsMiniEntities);
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function saveAnswer
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function saveAnswer(answerData, answerId, currentTime, resetField) {
const answer = formatAnswer(answerData, currentTime);
const payload = { answer };
return (dispatch, getState) => {
- Create a ticketCreate a ticket
Function default
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (state = {}, action) {
switch (action.type) {
case actions.FETCH_SUBMISSION_SUCCESS:
case actions.FINALISE_SUCCESS:
case actions.UNSUBMIT_SUCCESS:
- Create a ticketCreate a ticket
Function render
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { section, index: sectionIndex } = this.props;
return (
<Card>
<CardHeader
- Create a ticketCreate a ticket
Function ResponseSection
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ResponseSection = (props) => {
const { control, disabled, section, sectionIndex } = props;
const { fields: questionFields } = useFieldArray({
control,
name: `sections.${sectionIndex}.questions`,
- Create a ticketCreate a ticket
Function renderComments
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderComments(lineNumber, annotation) {
const {
activeComment,
answerId,
fileId,
- Create a ticketCreate a ticket
Function renderTestCaseRow
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderTestCaseRow(testCase) {
const {
testCases: { canReadTests },
} = this.props;
const { showPublicTestCasesOutput } = this.props;
- Create a ticketCreate a ticket
Function useMonitoring
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useMonitoring = (): UseMonitoringHook => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
return {
- Create a ticketCreate a ticket
Function reducer
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const reducer = produce((state, action) => {
const { type } = action;
switch (type) {
case actionTypes.FETCH_SKILLS_REQUEST:
- Create a ticketCreate a ticket
Function DeleteButton
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DeleteButton = (props: DeleteButtonProps): JSX.Element => {
const {
disabled,
onClick,
confirmMessage,
- Create a ticketCreate a ticket
Function ManageStudents
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ManageStudents: FC<Props> = (props) => {
const { intl } = props;
const [isLoading, setIsLoading] = useState(true);
const students = useAppSelector(getAllStudentMiniEntities);
- Create a ticketCreate a ticket