Coursemology/coursemology2

View on GitHub

Showing 1,205 of 1,252 total issues

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

const TimelineMenu = (props: TimelineMenuProps): JSX.Element => {
  const { for: user, timelines, timelinesMap } = props;

  const dispatch = useAppDispatch();

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

  const submitForm = async (rawData: ProgrammingFormData): Promise<void> => {
    if (!props.onSubmit) return undefined;

    setSubmitting(true);

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

const InstanceField = (props: InstanceFieldProps): JSX.Element => {
  const { for: instance, field, link } = props;

  const dispatch = useAppDispatch();

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

export const remainingTimeDisplay = (remainingTime: number): JSX.Element => {
  const hours = Math.floor(remainingTime / 1000 / 60 / 60) % 24;
  const minutes = Math.floor(remainingTime / 1000 / 60) % 60;
  const seconds = Math.floor(remainingTime / 1000) % 60;

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

const HistoryToggle: FC<HistoryToggleProps> = (props) => {
  const { historyQuestions, question } = props;
  const { t } = useTranslation();
  const dispatch = useAppDispatch();

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

const InstancesIndex: FC = () => {
  const { t } = useTranslation();
  const [isLoading, setIsLoading] = useState(true);
  const [isOpen, setIsOpen] = useState(false);

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

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

const InstanceUsersTabs: FC<Props> = (props) => {
  const { currentTab, intl } = props;
  const [tabValue, setTabValue] = useState(currentTab);

  return (

Function NotificationBar has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const NotificationBar = (props) => {
  const { notification, autoHideDuration = 5000, ...options } = props;
  const message = notification && notification.message;
  const errors = notification && notification.errors;
  const [open, setOpen] = useState(false);
Severity: Minor
Found in client/app/lib/components/core/NotificationBar.jsx - About 1 hr to fix

Function createResponse has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function createResponse(surveyId, navigate) {
  const courseId = getCourseId();
  const goToResponse = (responseId) =>
    navigate(
      `/courses/${courseId}/surveys/${surveyId}/responses/${responseId}`,
Severity: Minor
Found in client/app/bundles/course/survey/actions/responses.js - About 1 hr to fix

Function downloadSubmissions has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function downloadSubmissions(type, downloadFormat) {
  const actions =
    downloadFormat === 'zip'
      ? {
          request: actionTypes.DOWNLOAD_SUBMISSIONS_FILES_REQUEST,

Function deleteTextResponseFile has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function deleteTextResponseFile(answerId, questionId, attachmentId) {
  return (dispatch) => {
    const payload = { attachment_id: attachmentId };

    dispatch({

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

  render() {
    const {
      prompt,
      courses,
      onChange,

Function ResponseAnswer has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ResponseAnswer = (props) => {
  const { TEXT, MULTIPLE_CHOICE, MULTIPLE_RESPONSE } = questionTypes;
  const { control, disabled, intl, question, questionIndex, sectionIndex } =
    props;
  if (!question) {

Function showEditSurveyForm has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const showEditSurveyForm = () => {
    const { showSurveyForm } = surveyActions;
    const {
      title,
      description,

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

  render() {
    const { color, disabled, isIcon, responseId } = this.props;
    return (
      <>
        {isIcon ? (
Severity: Minor
Found in client/app/bundles/course/survey/containers/UnsubmitButton.jsx - About 1 hr to fix

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

  render() {
    const {
      control,
      question,
      recording,

Function useDynamicNest has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const useDynamicNest = (): UseDynamicNestHook => {
  const matches = useMatches();
  const location = useLocation();

  const [state, setState] = useState<CrumbState>({});
Severity: Minor
Found in client/app/lib/hooks/router/dynamicNest/useDynamicNest.ts - About 1 hr to fix

Function ImageCropDialog has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ImageCropDialog = (props: ImageCropDialogProps): JSX.Element => {
  const { t } = useTranslation();
  const [disabled, setDisabled] = useState(false);
  const [imageCropper, setImageCropper] = useState<ImageCropperEmitter>();

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

Function SwitchableTextField has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SwitchableTextField = (props: SwitchableTextFieldProps): JSX.Element => {
  const { editable, textProps, ...textFieldProps } = props;

  const { typography } = useTheme();

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

Function withHeartbeatWorker has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const withHeartbeatWorker = <P extends WrappedComponentProps>(
  Component: ComponentType<P>,
): ComponentType<P> => {
  const workerType = getWorkerType();
  if (!workerType) return Component;
Severity: Minor
Found in client/app/workers/withHeartbeatWorker.tsx - About 1 hr to fix
Severity
Category
Status
Source
Language