Coursemology/coursemology2

View on GitHub

Showing 1,205 of 1,252 total issues

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

const ComponentSettingsForm = (
  props: ComponentSettingsFormProps,
): JSX.Element => {
  const { t } = useTranslation();
  const [components, setComponents] = useState(props.data);

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

const TimelineSidebarItem = (props: TimelineSidebarItemProps): JSX.Element => {
  const { for: timeline, assigned } = props;

  const { t } = useTranslation();

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

const PhantomSwitch = (props: PhantomSwitchProps): JSX.Element => {
  const { for: user } = props;

  const dispatch = useAppDispatch();

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

const VideoDetails = (props: Props): JSX.Element => {
  const { for: video } = props;
  const { t } = useTranslation();

  return (
Severity: Minor
Found in client/app/bundles/course/video/pages/VideoShow/VideoDetails.tsx - About 1 hr to fix

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

const FilterAutocomplete = (props: FilterAutocompleteProps): JSX.Element => {
  const { t } = useTranslation();
  const monitoring = useMonitoring();

  return (

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

const ConfirmEmailPage = (): JSX.Element => {
  const { t } = useTranslation();

  const email = useLoaderData() as string;

Severity: Minor
Found in client/app/bundles/users/pages/ConfirmEmailPage.tsx - About 1 hr to fix

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

const CourseListItem = (props: CourseListItemProps): JSX.Element => {
  const { course } = props;

  const { t } = useTranslation();

Severity: Minor
Found in client/app/bundles/common/DashboardPage.tsx - About 1 hr to fix

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

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

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

export default function (state = initialState, action) {
  switch (action.type) {
    case actionTypes.ASSESSMENT_FORM_SHOW: {
      return { ...state, visible: true };
    }
Severity: Minor
Found in client/app/bundles/course/assessment/reducers/formDialog.js - About 1 hr to fix

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

  renderDropDown() {
    const sessionKeys = Object.keys(this.props.sessions);
    const items = sessionKeys.map((key) => {
      const session = this.props.sessions[key];
      const startTime = new Date(session.sessionStart);

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

  generateToolTipOptions() {
    return {
      tooltip: {
        displayColors: false,
        bodyFont: {

Method group_names_hash has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def group_names_hash
    group_names = Course::Group.find_by_sql(<<-SQL.squish
      WITH course_students AS (
        SELECT cgu.group_id, cgu.course_user_id
        FROM course_group_users cgu
Severity: Minor
Found in app/controllers/concerns/course/statistics/users_concern.rb - About 1 hr to fix

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

const SettingsNavigation = (): JSX.Element => {
  const data = useLoaderData() as CourseAdminItems;

  const [items, setItems] = useState(data);

Severity: Minor
Found in client/app/bundles/course/admin/components/SettingsNavigation.tsx - About 1 hr to fix

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

const CommentIndex: FC<Props> = (props) => {
  const { intl } = props;
  const dispatch = useAppDispatch();

  const settings = useAppSelector(getSettings);

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

  const rearrange = (result: DropResult): void => {
    if (!result.destination) return;

    const source = result.source;
    const destination = result.destination;

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

const subscribe = (
  url: string,
  courseId: number,
  monitorId: number,
  receivers: LiveMonitoringChannelCallbacks,

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

const getMultipleChoiceData = (optionCount) => {
  const options: unknown[] =
    optionCount < 1
      ? []
      : [

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

const TopicPostTrees: FC<Props> = (props) => {
  const { level, postIdsArray } = props;

  if (!postIdsArray || postIdsArray?.length === 0) return null;

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

  const ForumPostLabel = (): JSX.Element => {
    const { forum, topic } = postPack;
    return (
      <div className="flex items-center">
        {isExpanded ? (

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

export const validateBasedOnQuestionType = (
  question: SubmissionQuestionData<keyof typeof QuestionType>,
  attachments: Attachment[],
): ErrorStruct => {
  const errors: ErrorType[] = [];
Severity
Category
Status
Source
Language