Coursemology/coursemology2

View on GitHub

Showing 1,205 of 1,252 total issues

Function render has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const {
      intl,
      open,
      onCancel,
Severity: Major
Found in client/app/lib/components/core/dialogs/ConfirmationDialog.jsx - About 4 hrs to fix

Function PostCard has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const PostCard: FC<Props> = (props) => {
  const { postId, level } = props;
  const [isEditing, setIsEditing] = useState(false);
  const [isReplying, setIsReplying] = useState(false);
  const [editValue, setEditValue] = useState('');
Severity: Major
Found in client/app/bundles/course/forum/components/cards/PostCard.tsx - About 4 hrs to fix

Function renderTestCases has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderTestCases(testCases, testCaseType, warn, isDraftAnswer) {
    const {
      collapsible,
      testCases: { canReadTests },
      graderView,

Function InlineEditTextField has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const InlineEditTextField: FC<Props> = (props): JSX.Element | null => {
  const {
    updateValue,
    value,
    disabled,

Function InvitationResultInvitationsTable has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const InvitationResultInvitationsTable: FC<Props> = (props) => {
  const { title, invitations, intl } = props;

  if (invitations && invitations.length === 0) return null;

Function SidebarSettingsForm has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SidebarSettingsForm = (props: SidebarSettingsFormProps): JSX.Element => {
  const { t } = useTranslation();
  const [settings, setSettings] = useState(props.data);

  const moveItem = (sourceIndex: number, destinationIndex: number): void => {

Function WorkbinTableButtons has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const WorkbinTableButtons: FC<Props> = (props) => {
  const {
    currFolderId,
    itemId,
    itemName,

Function JavaTestCase has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const JavaTestCase = (props: TestCaseProps): JSX.Element => {
  const { t } = useTranslation();

  const [showCode, setShowCode] = useState(true);

Function CreateRenameTimelinePrompt has 106 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CreateRenameTimelinePrompt = (
  props: CreateRenameTimelinePromptProps,
): JSX.Element => {
  const { renames: timeline } = props;

Function default has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function (state = initialState, action) {
  switch (action.type) {
    case actions.FETCH_SUBMISSIONS_REQUEST:
      return { ...state, isLoading: true };
    case actions.FETCH_SUBMISSION_SUCCESS:

Function reducer has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  (draft: InstanceAdminState, action: InstanceAdminActionType) => {
    switch (action.type) {
      case SAVE_ANNOUNCEMENT_LIST: {
        const announcementList = action.announcementList;
        const entityList = announcementList.map((data) => ({ ...data }));
Severity: Major
Found in client/app/bundles/system/admin/instance/instance/store.ts - About 4 hrs to fix

Function RejectWithMessageForm has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const RejectWithMessageForm: FC<Props> = (props) => {
  const { open, onClose, roleRequest } = props;
  const { t } = useTranslation();
  const dispatch = useAppDispatch();

Function UpgradeToStaff has 104 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const UpgradeToStaff: FC<Props> = (props) => {
  const { intl } = props;

  const students = useAppSelector(getStudentOptionMiniEntities);
  const [isLoading, setIsLoading] = useState(false);
Severity: Major
Found in client/app/bundles/course/users/components/misc/UpgradeToStaff.tsx - About 4 hrs to fix

Function FolderShow has 104 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const FolderShow: FC = () => {
  const { folderId } = useParams();
  const { t } = useTranslation();
  const dispatch = useAppDispatch();

Severity: Major
Found in client/app/bundles/course/material/folders/pages/FolderShow/index.tsx - About 4 hrs to fix

Function CommonQuestionFields has 104 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CommonQuestionFields = <T extends FieldValues>(
  props: CommonQuestionFieldsProps<T>,
): JSX.Element => {
  const { disabled: submitting, control, availableSkills, skillsUrl } = props;

Function renderSpecificFields has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderSpecificFields = () => {
    const numberOfFilledOptions = options ? countFilledOptions(options) : 0;

    return (
      <>

Function render has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const { assessment, isLoading, submissions } = this.props;
    const {
      includePhantoms,
      tab,

Function Form has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Form = <
  D extends Data = any,
  M extends boolean = false,
  V extends AnyObjectSchema = never,
>(
Severity: Major
Found in client/app/lib/components/form/Form.tsx - About 4 hrs to fix

Function FolderForm has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const FolderForm: FC<Props> = (props) => {
  const { open, editing, onClose, initialValues, onSubmit, title } = props;
  const { t } = useTranslation();
  const advanceStartAt = useAppSelector(getAdvanceStartAt);

Function TextResponse has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const TextResponse = (props) => {
  const {
    answerId,
    graderView,
    handleUploadTextResponseFiles,
Severity
Category
Status
Source
Language