Coursemology/coursemology2

View on GitHub

Showing 1,205 of 1,252 total issues

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

const DownloadFolderButton: FC<Props> = (props) => {
  const { intl, currFolderId } = props;

  const [isLoading, setIsLoading] = useState(false);

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

const RoleMenu = (props: RoleMenuProps): JSX.Element => {
  const { for: user } = props;

  const dispatch = useAppDispatch();

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

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

  const submission = useAppSelector(getSubmission);

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

const AncestorOptions: FC<Props> = (props) => {
  const { t } = useTranslation();
  const {
    ancestors,
    parsedAssessmentId,

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

const RunCodeButton: FC<Props> = (props) => {
  const { t } = useTranslation();
  const dispatch = useAppDispatch();
  const { questionId } = props;

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

const UserManagementButtons: FC<Props> = (props) => {
  const { intl, user } = props;
  const dispatch = useAppDispatch();
  const [isDeleting, setIsDeleting] = useState(false);

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

const AnnouncementsIndex: FC<Props> = (props) => {
  const { intl } = props;
  const [isLoading, setIsLoading] = useState(true);
  const [isOpen, setIsOpen] = useState(false);

Severity: Minor
Found in client/app/bundles/system/admin/admin/pages/AnnouncementsIndex.tsx - About 1 hr to fix

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

const IndividualInvitations: FC<Props> = (props) => {
  const { isLoading, fieldsConfig, intl } = props;
  const { append, fields } = fieldsConfig;

  const appendNewRow = (): void => {

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

export default function (state = [], action) {
  switch (action.type) {
    case actionTypes.CREATE_SURVEY_SUCCESS: {
      return sortSurveysByDate([...state, sortSurveyElements(action.survey)]);
    }
Severity: Minor
Found in client/app/bundles/course/survey/reducers/surveys.js - About 1 hr to fix

Function groupItemsUnderMilestones has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function groupItemsUnderMilestones(items, milestones) {
  const sortedMilestones = [...milestones].sort(sortByStartAt);
  const sortedItems = [...items].sort((a, b) => {
    const startAtSortResult = sortByStartAt(a, b);
    if (startAtSortResult !== 0) {
Severity: Minor
Found in client/app/bundles/course/lesson-plan/reducers/utils.js - About 1 hr to fix

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

export default function (state = {}, action) {
  switch (action.type) {
    case actions.FETCH_SUBMISSION_SUCCESS:
    case actions.FINALISE_SUCCESS:
    case actions.UNSUBMIT_SUCCESS:

Function MultipleChoiceOptionsField has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const MultipleChoiceOptionsField = (props) => {
  const {
    disabled,
    field: { onChange, value },
    fieldState: { error },

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

  render() {
    const postPacks = this.props.field.value;
    const maxPosts = this.props.question.maxPosts;

    return (

Function FileInputField has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const FileInputField = (props) => {
  const {
    disabled,
    isMultipleAttachmentsAllowed,
    maxAttachmentsAllowed,

Function Programming has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Programming = (props) => {
  const { question, readOnly, answerId, saveAnswerAndUpdateClientVersion } =
    props;
  const fileSubmission = question.fileSubmission;
  const isSavingAnswer = useAppSelector((state) =>

Function EditorField has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  (props: EditorProps, ref: ForwardedRef<AceEditor>): JSX.Element => {
    const { language, value, disabled, onChange, cursorStart, ...otherProps } =
      props;

    return (
Severity: Minor
Found in client/app/lib/components/core/fields/EditorField.tsx - About 1 hr to fix

Function getTabTypesToRender has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getTabTypesToRender = (
  permissions: CommentPermissions,
  tabInfo: CommentTabInfo,
): CommentTabData[] => {
  const tabs = [] as CommentTabTypes[];

Function CollapsibleList has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CollapsibleList: FC<CollapsibleListProps> = (props) => {
  const {
    headerAction,
    collapsedByDefault = false,
    forceExpand,

Function TopicTypeIcon has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const TopicTypeIcon: FC<{ topic: ForumTopicEntity }> = (props) => {
  const { topic } = props;
  const { t } = useTranslation();
  let icon = <Icon />;
  switch (topic.topicType) {

Function ForumTopicEdit has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in client/app/bundles/course/forum/pages/ForumTopicEdit/index.tsx - About 1 hr to fix
Severity
Category
Status
Source
Language