Coursemology/coursemology2

View on GitHub

Showing 1,205 of 1,252 total issues

Function handleReply has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const handleReply = (): void => {
    setIsSubmittingReply(true);
    if (replyValue.text.trim() === '') {
      setIsSubmittingReply(false);
      toast.error(t(translations.emptyPost));
Severity: Minor
Found in client/app/bundles/course/forum/components/cards/ReplyCard.tsx - About 1 hr to fix

Function DeleteCoursePrompt has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const DeleteCoursePrompt = (props: DeleteCoursePromptProps): JSX.Element => {
  const challengeText = DEFAULT_CHALLENGE;

  const { t } = useTranslation();
  const [inputChallenge, setInputChallenge] = useState('');

Function AppearOnLeftGutter has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AppearOnLeftGutter = (props: ContainerProps): JSX.Element => {
  const [guttered, setGuttered] = useState(true);
  const [inside, setInside] = useState(false);

  useLayoutEffect(() => {
Severity: Minor
Found in client/app/bundles/course/container/Sidebar/SidebarContainer.tsx - About 1 hr to fix

Function addIndividual has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const addIndividual = (): void => {
    const individualData = data as
      | LeaderboardPoints[]
      | LeaderboardAchievement[];
    columns.push({

Function CourseContainer has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CourseContainer = (): JSX.Element => {
  const location = useLocation();

  const data = useCourseLoader();

Severity: Minor
Found in client/app/bundles/course/container/CourseContainer.tsx - About 1 hr to fix

Function LogsHead has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const LogsHead: FC<Props> = (props) => {
  const { t } = useTranslation();
  const { with: info } = props;

  return (

Function toggleViewHistoryMode has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function toggleViewHistoryMode(
  viewHistory,
  submissionQuestionId,
  questionId,
  answersLoaded,
Severity: Minor
Found in client/app/bundles/course/assessment/submission/actions/index.js - About 1 hr to fix

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

  render() {
    const { duplicationMode, disabled, isDuplicating, isDuplicationSuccess } =
      this.props;
    if (duplicationMode !== duplicationModes.COURSE) {
      return null;

Function renderStats has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderStats = (realResponsesStatuses, phantomResponsesStatuses) => {
    const chartData = [NOT_STARTED, RESPONDING, SUBMITTED].map((data) => {
      const count = state.includePhantomsInStats
        ? realResponsesStatuses[data] + phantomResponsesStatuses[data]
        : realResponsesStatuses[data];
Severity: Minor
Found in client/app/bundles/course/survey/pages/ResponseIndex/index.jsx - About 1 hr to fix

Function NewSurveyButton has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const NewSurveyButton = (props) => {
  const { canCreate, intl } = props;
  const navigate = useNavigate();

  const createSurveyHandler = (data, setError) => {

Function renderBorderComponent has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderBorderComponent() {
    const {
      intl,
      lineToolType,
      selectedLineStyle,

Function Expandable has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Expandable = (props: ExpandableProps): JSX.Element => {
  const { over: minHeightPx } = props;

  const { t } = useTranslation();

Severity: Minor
Found in client/app/lib/components/core/Expandable.tsx - About 1 hr to fix

Function renderRating has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderRating = (): JSX.Element | null => {
    if (!post.canUpdate) {
      return null;
    }
    return (

Function MarkdownPage has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const MarkdownPage = (props: MarkdownPageProps): JSX.Element => {
  const { markdown, ...pageProps } = props;
  return (
    <Page {...pageProps}>
      <ReactMarkdown
Severity: Minor
Found in client/app/lib/components/core/layouts/MarkdownPage.tsx - About 1 hr to fix

Function ForumEdit has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ForumEdit: FC<Props> = (props) => {
  const { isOpen, onClose, forum, navigateToShowAfterUpdate } = props;
  const { t } = useTranslation();
  const navigate = useNavigate();

Severity: Minor
Found in client/app/bundles/course/forum/pages/ForumEdit/index.tsx - About 1 hr to fix

Function InstanceDropdown has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const InstanceDropdown: FC<InstanceDropdownProps> = (props) => {
  const { disabled, field, fieldState } = props;
  const instances = useAppSelector(selectDestinationInstances);
  const metadata = useAppSelector(selectMetadata);
  const instanceIds = useMemo(() => Object.keys(instances), [instances]);

Function ExperiencePointsReasonField has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ExperiencePointsReasonField: FC<Props> = (props) => {
  const { record, rowData, disabled, setIsDirty, defaultReason, setRowData } =
    props;
  const [errorReasonText, setErrorReasonText] = useState('');

Function renderUserStats has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderUserStats = (): JSX.Element | null => {
    return (
      <Grid
        className={styles.userStatsContainer}
        container
Severity: Minor
Found in client/app/bundles/course/users/components/misc/UserProfileCard.tsx - About 1 hr to fix

Function SelectCourseUser has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SelectCourseUser: FC<Props> = (props) => {
  const { initialUser = null, intl } = props;
  const users = useAppSelector(getAllUserOptionMiniEntities);
  const [user, setUser] = useState<CourseUserBasicMiniEntity | null>(
    initialUser,

Function Sidebar has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  (props, ref): JSX.Element => {
    const { from: data, onChangeVisibility, activePath } = props;

    const { t } = useTranslation();

Severity: Minor
Found in client/app/bundles/course/container/Sidebar/Sidebar.tsx - About 1 hr to fix
Severity
Category
Status
Source
Language