Coursemology/coursemology2

View on GitHub

Showing 1,205 of 1,252 total issues

Function ImageCropper has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ImageCropper = (props: ImageCropperProps): JSX.Element => {
  const [crop, setCrop] = useState<PercentCrop>();
  const [completedCrop, setCompletedCrop] = useState<PixelCrop>();
  const [rotation, setRotation] = useState(0);
  const imgRef = useRef<HTMLImageElement>(null);
Severity: Major
Found in client/app/lib/components/core/ImageCropper/index.tsx - About 2 hrs to fix

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

  (draft: InvitationsState, action: InvitationsActionType) => {
    switch (action.type) {
      case SAVE_INVITATION_LIST: {
        const invitationList = action.invitationList;
        const entityList = invitationList.map((data) => ({
Severity: Major
Found in client/app/bundles/course/user-invitations/store.ts - About 2 hrs to fix

Function VideoSubmissionsIndex has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const VideoSubmissionsIndex: FC<Props> = (props) => {
  const { intl } = props;
  const [isLoading, setIsLoading] = useState(true);
  const [data, setData] = useState<VideoSubmission>();

Function SkillsAutocomplete has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SkillsAutocomplete = (props: SkillsAutocompleteProps): JSX.Element => {
  const { t } = useTranslation();

  const availableSkillIds = useMemo(
    () => Object.keys(props.availableSkills),

Function PendingInvitationsButtons has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const PendingInvitationsButtons: FC<Props> = (props) => {
  const { intl, invitation } = props;
  const dispatch = useAppDispatch();
  const [isResending, setIsResending] = useState(false);
  const [isDeleting, setIsDeleting] = useState(false);

Function GroupIndex has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const GroupIndex = (props) => {
  const { intl } = props;
  const [isLoading, setIsLoading] = useState(true);
  const [groupCategories, setGroupCategories] = useState({
    groupCategories: [],
Severity: Major
Found in client/app/bundles/course/group/pages/GroupIndex/index.jsx - About 2 hrs to fix

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

  render() {
    const { selectedItems, courses, destinationCourseId } = this.props;
    // Disabled models for cherry pick duplication as defined in `disabled_cherrypickable_types`.
    const unduplicableObjectTypes = courses.find(
      (course) => course.id === destinationCourseId,

Function FontFamilyField has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const FontFamilyField = (props) => {
  const { intl, fontFamilyValue, onChangeFontFamily } = props;
  const fontFamilies = [
    {
      key: intl.formatMessage(translations.arial),

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

const UsersIndex: FC<Props> = (props) => {
  const { intl } = props;
  const courseId = getCourseId();
  const [isLoading, setIsLoading] = useState(true);
  const users = useAppSelector(getAllStudentMiniEntities);
Severity: Major
Found in client/app/bundles/course/users/pages/UsersIndex/index.tsx - About 2 hrs to fix

Function LastAttemptIndex has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const LastAttemptIndex: FC<Props> = (props) => {
  const { curAnswerId, index } = props;
  const { courseId, assessmentId } = useParams();
  const { t } = useTranslation();

Function ExplanationPanel has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ExplanationPanel: FC<Props> = (props) => {
  const { questionId } = props;

  const { t } = useTranslation();

Function QuestionContent has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const QuestionContent: FC<Props> = (props) => {
  const { handleNext, stepIndex } = props;

  const assessment = useAppSelector(getAssessment);
  const submission = useAppSelector(getSubmission);

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

export default function (survey = initialState, action) {
  if (String(survey.id) !== String(action.surveyId)) {
    return survey;
  }

Severity: Major
Found in client/app/bundles/course/survey/reducers/survey.js - About 2 hrs to fix

Function renderOptionsResultsTable has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderOptionsResultsTable() {
    const { anonymous, options, questionType } = this.props;
    const { MULTIPLE_CHOICE, MULTIPLE_RESPONSE } = questionTypes;
    const { byWeight } = sorts;
    const breakdown = this.getOptionsBreakdown();

Function NewCourseForm has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const NewCourseForm = (props) => {
  const { onSubmit, initialValues, disabled } = props;
  const {
    control,
    handleSubmit,

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

  render() {
    const {
      disabled,
      fieldState: { error },
      field: { value },

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

  render() {
    const {
      intl,
      createComment,
      inputId,

Function buildTanStackColumns has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const buildTanStackColumns = <D extends Data>(
  columns: ColumnTemplate<D>[],
  hasCheckboxes?: boolean,
  hasIndices?: boolean,
): BuiltColumns<D, ColumnDef<D, unknown>> => {

Function ForumsIndex has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ForumsIndex: FC = () => {
  const { t } = useTranslation();
  const [isLoading, setIsLoading] = useState(true);
  const [isForumNewDialogOpen, setIsForumNewDialogOpen] = useState(false);
  const [isMarking, setIsMarking] = useState(false);
Severity: Major
Found in client/app/bundles/course/forum/pages/ForumsIndex/index.tsx - About 2 hrs to fix

Function DayCalendar has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  (props, ref): JSX.Element => {
    const { t } = useTranslation();

    const calendarRef = useRef<List>(null);

Severity
Category
Status
Source
Language