Coursemology/coursemology2

View on GitHub

Showing 1,214 of 1,261 total issues

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

  render() {
    const { scribing } = this.props;
    const toolBarStyle = !scribing.isCanvasLoaded
      ? styles.disabledToolbar
      : styles.toolBar;

Function GenerateProgrammingQuestionPage has 372 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const GenerateProgrammingQuestionPage = (): JSX.Element => {
  const params = useParams();
  const id = parseInt(params?.assessmentId ?? '', 10) || undefined;
  if (!id)
    throw new Error(

Function EnrolRequestsTable has 371 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const EnrolRequestsTable: FC<Props> = (props) => {
  const {
    title,
    enrolRequests,
    pendingEnrolRequests = false,

Function WorkbinTable has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
Open

const WorkbinTable: FC<Props> = (props) => {
  const {
    currFolderId,
    subfolders,
    materials,

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function LeaderboardTable has 321 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const LeaderboardTable: FC<Props> = (props: Props) => {
  const { data, id: tableType } = props;
  const tabletView = useMedia.MinWidth('sm');
  const phoneView = useMedia.MinWidth('xs');
  const [maxAvatars, setMaxAvatars] = useState(6);

Function InstanceUserRoleRequestsTable has 300 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const InstanceUserRoleRequestsTable: FC<Props> = (props) => {
  const {
    title,
    roleRequests,
    pendingRoleRequests = false,

Function CourseSettingsForm has 294 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CourseSettingsForm = (props: CourseSettingsFormProps): JSX.Element => {
  const { t } = useTranslation();
  const [offsetTimesPrompt, setOffsetTimesPrompt] = useState(false);
  const [deletingCourse, setDeletingCourse] = useState(false);
  const [stagedLogo, setStagedLogo] = useState<File>();

Function UsersTable has 284 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const UsersTable: FC<Props> = (props) => {
  const { title, renderRowActionComponent, intl, filter, users, userCounts } =
    props;
  const [isLoading, setIsLoading] = useState(false);
  const dispatch = useAppDispatch();

Function StudentPerformanceTable has 282 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const StudentPerformanceTable: FC<Props> = (props) => {
  const {
    students,
    hasPersonalizedTimeline,
    isCourseGamified,

Function SkillsTable has 267 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SkillsTable: FC<Props> = (props: Props) => {
  const {
    data,
    intl,
    tableType,

Function QuestionForm has 256 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const QuestionForm = (props) => {
  const { disabled, initialValues, onSubmit, intl } = props;
  const {
    control,
    handleSubmit,

Function ResponseIndex has 254 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ResponseIndex = (props) => {
  const { dispatch, survey, responses, isLoading } = props;
  const { palette } = useTheme();
  const { NOT_STARTED, RESPONDING, SUBMITTED } = responseStatus;
  const dataColor = {
Severity: Major
Found in client/app/bundles/course/survey/pages/ResponseIndex/index.jsx - About 1 day to fix

Function SubmissionsTableRow has 254 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const SubmissionsTableRow = (props) => {
  const { assessment, assessmentId, courseId, dispatch, submission } = props;
  const palette = useTheme().palette;
  const [state, setState] = useState({
    unsubmitConfirmation: false,

Function AccountSettingsForm has 254 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AccountSettingsForm = (props: AccountSettingsFormProps): JSX.Element => {
  const { t } = useTranslation();
  const [stagedImage, setStagedImage] = useState<File>();
  const [requirePasswordConfirmation, setRequirePasswordConfirmation] =
    useState(true);
Severity: Major
Found in client/app/bundles/user/AccountSettings/AccountSettingsForm.tsx - About 1 day to fix

Function LiveFeedbackStatisticsTable has 253 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const LiveFeedbackStatisticsTable: FC<Props> = (props) => {
  const { t } = useTranslation();
  const { courseId } = useParams();
  const { includePhantom, liveFeedbackStatistics } = props;

Function UsersTable has 252 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const UsersTable: FC<Props> = (props) => {
  const { title, renderRowActionComponent, intl, users, userCounts, filter } =
    props;
  const [isLoading, setIsLoading] = useState(false);
  const dispatch = useAppDispatch();

Function AchievementAwardManager has 245 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const AchievementAwardManager: FC<Props> = (props) => {
  const { achievement, isLoading, handleClose, intl, setIsDirty } = props;
  const achievementUsers = achievement.achievementUsers;

  const [openConfirmation, setOpenConfirmation] = useState(false);

Function StudentMarksPerQuestionTable has 242 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const StudentMarksPerQuestionTable: FC<Props> = (props) => {
  const { t } = useTranslation();
  const { courseId, assessmentId } = useParams();
  const { includePhantom } = props;

Function GenerateExportDialog has 229 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const GenerateExportDialog: FC<Props> = (props) => {
  const { open, setOpen, saveActiveFormData, languages } = props;
  const { t } = useTranslation();
  const dispatch = useAppDispatch();
  const generatePageData = useAppSelector(getAssessmentGenerateQuestionsData);

Function CodaveriCommentCard has 220 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CodaveriCommentCard: FC<Props> = (props) => {
  const { intl, post } = props;
  const dispatch = useAppDispatch();
  const [editMode, setEditMode] = useState(false);
  const [isSaving, setIsSaving] = useState(false);
Severity
Category
Status
Source
Language