Coursemology/coursemology2

View on GitHub

Showing 1,205 of 1,252 total issues

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

  renderDeleteDialog() {
    const { deleteFileName, deleteFileId, deleteConfirmation } = this.state;
    const { intl, handleDeleteFile } = this.props;
    return (
      <Prompt

Function renderCommentContent has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderCommentContent() {
    const { editMode } = this.state;
    const {
      editValue,
      post: { text, id },

Function renderLabel has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderLabel() {
    const { postPack } = this.props;
    const { forum, topic } = postPack;
    const courseId = getCourseId();

Function PostMenu has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const PostMenu = (props) => {
  const [anchorEl, setAnchorEl] = useState(null);

  const handleClick = (event) => {
    // This prevents ghost click.

Function renderAssessment has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderAssessment() {
    const { assessment, submission } = this.props;

    const renderFile = (file, index) => (
      <div key={index}>

Function MuiTableToolbar has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

  if (props.alternative?.when())
    return <ToolbarContainer>{props.alternative.render()}</ToolbarContainer>;
Severity: Minor
Found in client/app/lib/components/table/MuiTableAdapter/MuiTableToolbar.tsx - About 1 hr to fix

Function ComponentSettings has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ComponentSettings = (): JSX.Element => {
  const reloadItems = useItemsReloader();
  const { t } = useTranslation();
  const [submitting, setSubmitting] = useState(false);

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

Function SidebarSettings has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SidebarSettings = (): JSX.Element => {
  const { t } = useTranslation();
  const [submitting, setSubmitting] = useState(false);

  const handleSubmit = (
Severity: Minor
Found in client/app/bundles/course/admin/pages/SidebarSettings/index.tsx - About 1 hr to fix

Function handleEvaluationPolling has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const handleEvaluationPolling = (): void => {
    Object.values(questions).forEach((question) => {
      if (
        questionFlags[question.id]?.isAutograding &&
        questionFlags[question.id]?.jobUrl

Function unsubmitAllSubmissions has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function unsubmitAllSubmissions(type) {
  return (dispatch) => {
    dispatch({ type: actionTypes.UNSUBMIT_ALL_SUBMISSIONS_REQUEST });

    const handleSuccess = () => {

Function renderFolder has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderFolder(folder, indentLevel) {
    const { dispatch, selectedItems } = this.props;
    const { id, name, materials, subfolders } = folder;
    const checked = !!selectedItems[FOLDER][folder.id];
    const hasChildren = materials.length + subfolders.length > 0;

Function renderPostMenu has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderPostMenu() {
    const { forumTopicPostPacks } = this.props;

    if (forumTopicPostPacks == null || forumTopicPostPacks.length === 0) {
      return (

Function renderReminderConfirmation has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderReminderConfirmation(shownSubmissions, handleRemindParams) {
    const { dispatch } = this.props;
    const { assessmentId } = this.props.match.params;
    const { remindConfirmation } = this.state;
    const values = {

Function renderRowUsers has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderRowUsers() {
    const {
      dispatch,
      courseId,
      assessmentId,

Method validate_no_repeat_bundles has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def validate_no_repeat_bundles(assignment_set)
      attempted_questions = {}
      @assessment.question_bundle_assignments.where.not(submission: nil).pluck(:user_id, :bundle_id).
        each do |user_id, bundle_id|
        attempted_questions[user_id] ||= Set.new

Function getImage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getImage = (
  image: HTMLImageElement,
  crop: PixelCrop,
  rotation: number,
  type: string,
Severity: Minor
Found in client/app/lib/components/core/ImageCropper/utils.ts - About 1 hr to fix

Function WrappedComponent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const WrappedComponent = (props: P): JSX.Element => {
    const workerRef = useRef<HeartbeatWorker>();
    const [sessionId, setSessionId] = useState<number>();

    const params = useParams();
Severity: Minor
Found in client/app/workers/withHeartbeatWorker.tsx - About 1 hr to fix

Function fetchLeaderboard has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const fetchLeaderboard = (): Operation => {
  return async (dispatch) =>
    CourseAPI.leaderboard.index().then((response) => {
      const data: LeaderboardData = response.data;
      dispatch(
Severity: Minor
Found in client/app/bundles/course/leaderboard/operations.ts - About 1 hr to fix

Function PopupMenuButton has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const PopupMenuButton = (props: PopupMenuButtonProps): JSX.Element => {
  const { linkProps } = props;

  const { close } = useContext(PopupMenuContext);

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

Function UserVideoSubmissionsIndex has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const UserVideoSubmissionsIndex: FC<Props> = (props) => {
  const { intl } = props;
  const [isLoading, setIsLoading] = useState(true);
  const [videoSubmissions, setVideoSubmissions] = useState<
    VideoSubmissionListData[] | null
Severity
Category
Status
Source
Language