Coursemology/coursemology2

View on GitHub

Showing 1,205 of 1,252 total issues

Function CikgoErrorPage has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CikgoErrorPage = (): JSX.Element => {
  const { t } = useTranslation();

  return (
    <Page className="h-full m-auto flex flex-col items-center justify-center text-center">
Severity: Minor
Found in client/app/bundles/course/stories/components/CikgoErrorPage.tsx - About 1 hr to fix

Function PasswordTextField has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  (props, ref): JSX.Element => {
    const {
      onChangePasswordVisibility,
      disablePasswordVisibilitySwitch,
      ...textFieldProps
Severity: Minor
Found in client/app/lib/components/core/fields/PasswordTextField.tsx - About 1 hr to fix

Function AchievementNew has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Function onDelete has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const onDelete = (): Promise<void> => {
    setIsDeleting(true);
    if (type === 'subfolder') {
      return dispatch(deleteFolder(itemId))
        .then(() => {

Function addPoints has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const addPoints = (): void => {
    const pointData = data as LeaderboardPoints[];
    columns.push(
      {
        name: 'level',

Function NonStudentStatusBadges has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const NonStudentStatusBadges = (
  props: NonStudentStatusBadgesProps,
): JSX.Element => {
  const { for: assessment } = props;
  const { t } = useTranslation();

Function DeleteQuestionButtonPrompt has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const DeleteQuestionButtonPrompt = (
  props: DeleteQuestionButtonPromptProps,
): JSX.Element => {
  const { for: question } = props;
  const { t } = useTranslation();

Function MarkButton has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const MarkButton: FC = () => {
  const { t } = useTranslation();
  const dispatch = useAppDispatch();

  const assessment = useAppSelector(getAssessment);

Function MultipleChoiceDetails has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const MultipleChoiceDetails = (
  props: QuestionAnswerDisplayDetails<'MultipleChoice'>,
): JSX.Element => {
  const { question, answer } = props;
  return (

Function DashboardPage has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const DashboardPage = (): JSX.Element => {
  const { courses, user } = useAppContext();

  const { t } = useTranslation();

Severity: Minor
Found in client/app/bundles/common/DashboardPage.tsx - About 1 hr to fix

Function fetchSubmissionsFromKoditsu has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function fetchSubmissionsFromKoditsu() {
  return (dispatch) => {
    dispatch({ type: actionTypes.FETCH_SUBMISSIONS_FROM_KODITSU_REQUEST });

    const handleSuccess = () => {

Function processed has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const processed = columns.map((column) => {
    if (!column.options?.alignCenter && !column.options?.hideInSmallScreen)
      return column;

    return produce(column, (draft) => {
Severity: Minor
Found in client/app/lib/components/core/layouts/DataTable.jsx - About 1 hr to fix

Function FormAutoCompleteField has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const FormAutoCompleteField = (props) => {
  const { field, fieldState, disabled, label, options, renderIf, ...custom } =
    props;
  if (!renderIf) {
    return null;
Severity: Minor
Found in client/app/lib/components/form/fields/AutoCompleteField.jsx - About 1 hr to fix

Function saveGrade has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function saveGrade(submissionId, grade, questionId, exp, published) {
  const expParam = published ? 'points_awarded' : 'draft_points_awarded';
  const modifiedGrade = { id: grade.id, grade: grade.grade };
  const payload = {
    submission: {

Function videoStateReducer has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function videoStateReducer(state = initialState, action) {
  // Only forceSeek if explicitly specified
  const transformState = generateStateTransformer(state);

  switch (action.type) {
Severity: Minor
Found in client/app/bundles/course/video/submission/reducers/video.js - About 1 hr to fix

Function renderLineStyleChips has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderLineStyleChips() {
    const { intl, lineToolType, selectedLineStyle, onClickLineStyleChip } =
      this.props;
    const lineStyles = [
      {

Function renderDeleteDialog has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderDeleteDialog() {
    const { deleteAttachmentName, deleteAttachmentId, deleteConfirmation } =
      this.state;
    const { intl, deleteAttachment } = this.props;
    return (

Function renderPlot has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderPlot() {
    const displayData = this.computeData(this.state.selectedSessionId);
    if (!displayData) {
      return <Scatter />;
    }

Method upcoming_items_from_course_by_type_for_course_user has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def self.upcoming_items_from_course_by_type_for_course_user(course_user)
    course = course_user.course
    opening_items = course.lesson_plan_items.published.
                    with_reference_times_for(course_user).
                    with_personal_times_for(course_user).
Severity: Minor
Found in app/models/course/lesson_plan/item.rb - About 1 hr to fix

Function ContextualErrorPage has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ContextualErrorPage = (
  props: UnrecoverableErrorPageProps,
): JSX.Element => {
  const { from: error, stack } = props;

Severity: Minor
Found in client/app/lib/components/core/layouts/ContextualErrorPage.tsx - About 1 hr to fix
Severity
Category
Status
Source
Language