Coursemology/coursemology2

View on GitHub

Showing 1,205 of 1,252 total issues

Function SurveysTable has 151 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SurveysTable = (props) => {
  const {
    surveys,
    courseId,
    surveysFlags: { canCreate, studentsCount },
Severity: Major
Found in client/app/bundles/course/survey/pages/SurveyIndex/SurveysTable.jsx - About 6 hrs to fix

Function Option has 151 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Option = forwardRef<OptionRef, OptionProps>((props, ref): JSX.Element => {
  const { disabled, adapter: texts, for: originalOption } = props;

  const [option, setOption] = useState(originalOption);
  const [toBeDeleted, setToBeDeleted] = useState(false);

Function GenerateQuestionPrototypeForm has 150 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const GenerateQuestionPrototypeForm: FC<Props> = (props) => {
  const { prototypeForm, lockStates, onToggleLock } = props;
  const { t } = useTranslation();
  const dispatch = useAppDispatch();
  const { onChange } = prototypeForm.register('question.title', {

Function SkillsIndex has 149 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SkillsIndex: FC<Props> = (props) => {
  const { intl } = props;
  const dispatch = useAppDispatch();
  const [isLoading, setIsLoading] = useState(true);
  const [dialogType, setDialogType] = useState(DialogTypes.NewSkill);

Function GenerateTabs has 149 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const GenerateTabs: FC<Props> = (props) => {
  const {
    onExport,
    createConversation,
    deleteConversation,

Function AssessmentsTable has 147 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AssessmentsTable = (props: AssessmentsTableProps): JSX.Element => {
  const { display, assessments } = props.assessments;
  const { t } = useTranslation();

  const columns: ColumnTemplate<AssessmentListData>[] = [

Function AnnouncementForm has 143 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AnnouncementForm: FC<Props> = (props) => {
  const { open, editing, title, onClose, initialValues, onSubmit, canSticky } =
    props;
  const { t } = useTranslation();
  const [whenToPublish, setWhenToPublish] = useState<PublishTime>('now');

Function EvaluatorFields has 142 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const EvaluatorFields = (props: EvaluatorFieldsProps): JSX.Element | null => {
  const { t } = useTranslation();

  const { control, watch } = useFormContext<ProgrammingFormData>();

Function HeartbeatsTimelineChart has 142 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const HeartbeatsTimelineChart = (
  props: HeartbeatsTimelineChartProps,
): JSX.Element => {
  const { in: heartbeats } = props;

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

export default function (state = initialState, action) {
  switch (action.type) {
    case actions.FETCH_SUBMISSION_SUCCESS:
      return {
        ...state,

Function EventForm has 139 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const EventForm = (props) => {
  const { onSubmit, initialValues, disabled, eventTypes, eventLocations } =
    props;
  const {
    control,

Function AnnouncementCard has 139 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AnnouncementCard: FC<Props> = (props) => {
  const {
    intl,
    announcement,
    showEditOptions,

Function LevelsManager has 139 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const LevelsManager = (): JSX.Element => {
  const { canManage, levels } = useAppSelector(getLevels);
  const { t } = useTranslation();
  const dispatch = useAppDispatch();

Severity: Major
Found in client/app/bundles/course/level/pages/LevelsIndex/LevelsManager.tsx - About 5 hrs to fix

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

export default function (state = initialState, action) {
  switch (action.type) {
    case actions.FETCH_SUBMISSION_SUCCESS: {
      const { expMultiplier } = state;
      const submission = action.payload.submission;

Function FileManager has 136 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const FileManager = (props: FileManagerProps): JSX.Element => {
  const { disabled, intl } = props;

  const [materials, setMaterials] = useState(props.materials ?? []);
  const [uploadingMaterials, setUploadingMaterials] = useState<Material[]>([]);
Severity: Major
Found in client/app/bundles/course/assessment/components/FileManager/index.tsx - About 5 hrs to fix

Function AssessmentConditionForm has 133 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AssessmentConditionForm = (
  props: AnyConditionProps<AssessmentConditionData> & {
    assessments: AvailableAssessments;
  },
): JSX.Element => {

Function ConditionsManager has 133 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ConditionsManager = (props: ConditionsManagerProps): JSX.Element => {
  const { t } = useTranslation();
  const [conditions, setConditions] = useState(props.conditionsData.conditions);
  const [conditionToCreate, setConditionToCreate] =
    useState<ConditionAbility>();
Severity: Major
Found in client/app/lib/components/extensions/conditions/ConditionsManager.tsx - About 5 hrs to fix

Function UsersIndex has 133 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const UsersIndex: FC<Props> = (props) => {
  const { intl } = props;
  const [isLoading, setIsLoading] = useState(false);
  const [filter, setFilter] = useState({ active: false, role: '' });
  const users = useAppSelector(getAllUserMiniEntities);

Function PersonalTimesShow has 132 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const PersonalTimesShow: FC<Props> = (props) => {
  const { intl } = props;
  const [isLoading, setIsLoading] = useState(true);
  const [isRecomputing, setIsRecomputing] = useState(false);
  const { userId } = useParams();
Severity: Major
Found in client/app/bundles/course/users/pages/PersonalTimesShow/index.tsx - About 5 hrs to fix

Function OptionsManager has 132 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  (props, ref): JSX.Element => {
    const { disabled, for: originalOptions } = props;
    const [options, setOptions] = useState(originalOptions);

    const optionRefs = useRef<Record<OptionEntity['id'], OptionRef>>({});
Severity
Category
Status
Source
Language