Coursemology/coursemology2

View on GitHub

Showing 1,205 of 1,252 total issues

Function AttachmentDetails has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AttachmentDetails: FC<Props> = (props) => {
  const { attachments } = props;
  const { t } = useTranslation();

  const AttachmentComponent = (): JSX.Element => (

Function reevaluateAnswer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function reevaluateAnswer(submissionId, answerId, questionId) {
  return (dispatch) => {
    dispatch({
      type: actionTypes.REEVALUATE_REQUEST,
      payload: { questionId },

Function questionTypes.ForumPostResponse has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    [questionTypes.ForumPostResponse]: () => {
      const selectedPostPacks = answer.selected_post_packs.map((postPack) =>
        produce({}, (draftState) => {
          const corePost = {
            id: postPack.corePost.id,
Severity: Minor
Found in client/app/bundles/course/assessment/submission/actions/utils.js - About 1 hr to fix

Function downloadStatistics has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function downloadStatistics(type) {
  return (dispatch) => {
    dispatch({ type: actionTypes.DOWNLOAD_STATISTICS_REQUEST });

    const handleSuccess = (successData) => {

Function forceSubmitSubmissions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function forceSubmitSubmissions(type) {
  return (dispatch) => {
    dispatch({ type: actionTypes.FORCE_SUBMIT_SUBMISSIONS_REQUEST });

    const handleSuccess = () => {

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

export default function (state = {}, action) {
  switch (action.type) {
    case actions.FETCH_SUBMISSION_SUCCESS:
    case actions.FETCH_ANNOTATION_SUCCESS:
      return {
Severity: Minor
Found in client/app/bundles/course/assessment/submission/reducers/posts.js - About 1 hr to fix

Function finalizeOrder has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function finalizeOrder(successMessage, failureMessage, onError) {
  return (dispatch, getState) => {
    const {
      surveysFlags: { isQuestionMoved },
      surveys,
Severity: Minor
Found in client/app/bundles/course/survey/actions/questions.js - About 1 hr to fix

Function deleteAllSubmissions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function deleteAllSubmissions(type) {
  return (dispatch) => {
    dispatch({ type: actionTypes.DELETE_ALL_SUBMISSIONS_REQUEST });

    const handleSuccess = () => {

Function publishSubmissions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function publishSubmissions(type) {
  return (dispatch) => {
    dispatch({ type: actionTypes.PUBLISH_SUBMISSIONS_REQUEST });

    const handleSuccess = () => {

Function withSurveyLayout has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const withSurveyLayout = (Component) => {
  const WrappedComponent = ({ surveys }) => {
    const params = useParams();
    const surveyId = params.surveyId;
    const courseId = params.courseId;
Severity: Minor
Found in client/app/bundles/course/survey/containers/SurveyLayout/index.jsx - About 1 hr to fix

Function ArrowOverlay has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ArrowOverlay = (props) => {
  const {
    gateInputSizeThreshold,
    getGateConnectionPointId,
    getGateInputId,

Function renderSidebarItem has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderSidebarItem(panelKey, titleKey, count, className) {
    const { dispatch, enabledComponents } = this.props;
    if (!enabledComponents.includes(panelKey)) {
      return null;
    }

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

export default function (state = {}, action) {
  switch (action.type) {
    case actions.GET_PAST_ANSWERS_SUCCESS: {
      return {
        ...state,

Function renderFillComponent has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderFillComponent() {
    const {
      intl,
      onClickFillColorPicker,
      fillColorPickerPopoverOpen,

Function displayFileNames has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  displayFileNames(files) {
    const { disabled } = this.props;
    const { dropzoneActive } = this.state;
    if (dropzoneActive) {
      return <FileUpload style={{ width: 60, height: 60 }} />;

Function MultipleResponse has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const MultipleResponse = (props) => {
  const {
    answerId,
    graderView,
    question,

Function renderGradeRow has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderGradeRow(question, showGrader) {
    const questionGrading = this.props.grading.questions[question.id];
    const parsedGrade = parseFloat(questionGrading?.grade);
    const questionGrade = Number.isNaN(parsedGrade) ? '' : parsedGrade;

Function getAnswersHistory has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  getAnswersHistory(question, answer) {
    const { intl } = this.props;
    switch (question.type) {
      case questionTypes.Programming:
        return <PastProgrammingAnswer answer={answer} question={question} />;

Function MultipleChoice has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const MultipleChoice = (props) => {
  const {
    answerId,
    graderView,
    question,

Method text_response_question_params has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def text_response_question_params
    permitted_params = [
      :title, :description, :staff_only_comments, :maximum_grade, :max_attachments,
      :hide_text, :is_comprehension, :is_attachment_required, :max_attachment_size,
      question_assessment: { skill_ids: [] }
Severity
Category
Status
Source
Language