Showing 1,205 of 1,252 total issues
Function StudentsStatisticsTable
has 219 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const StudentsStatisticsTable: FC<Props> = (props) => {
const {
metadata: {
isCourseGamified,
showVideo,
- Create a ticketCreate a ticket
Function ForumTopicTable
has 217 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForumTopicTable: FC<Props> = (props) => {
const { forum, forumTopics } = props;
const { t } = useTranslation();
if (!forum || forumTopics.length === 0) {
- Create a ticketCreate a ticket
Function CommentCard
has 213 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CommentCard: FC<Props> = (props) => {
const { intl, post } = props;
const dispatch = useAppDispatch();
const [editMode, setEditMode] = useState(false);
const [isSaving, setIsSaving] = useState(false);
- Create a ticketCreate a ticket
Function UserInvitationsTable
has 211 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UserInvitationsTable: FC<Props> = (props) => {
const {
title,
invitations,
pendingInvitations = false,
- Create a ticketCreate a ticket
Function Category
has 209 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Category = (props: CategoryProps): JSX.Element => {
const { category, index } = props;
const { t } = useTranslation();
const { settings, createTabInCategory, deleteCategory, moveTabs } =
useAssessmentSettings();
- Create a ticketCreate a ticket
Function VideoTable
has 209 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const VideoTable: FC<Props> = (props) => {
const { videos, permissions, onTogglePublished, intl } = props;
const videoMetadata = useAppSelector(getVideoMetadata);
if (videos && videos.length === 0) {
- Create a ticketCreate a ticket
Function PersonalTimeEditor
has 207 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PersonalTimeEditor: FC<Props> = (props) => {
const { item, intl } = props;
const initialValues = {
fixed: item.fixed,
startAt: item.personalStartAt,
- Create a ticketCreate a ticket
Function QuestionGrade
has 206 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const QuestionGrade: FC<QuestionGradeProps> = (props) => {
const { questionId, isSaving } = props;
const { t } = useTranslation();
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function TopicCard
has 204 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TopicCard: FC<TopicCardProps> = (props) => {
const { topic } = props;
const { t } = useTranslation();
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function reducer
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
Open
const reducer = produce((draft: CommentState, action: CommentActionType) => {
switch (action.type) {
case SAVE_COMMENT_TAB: {
draft.permissions = { ...action.permissions };
draft.settings = { ...action.settings };
- Read upRead up
- Create a ticketCreate a ticket
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 SurveyForm
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SurveyForm = (props) => {
const { intl, onSubmit, disabled, disableAnonymousToggle, initialValues } =
props;
const {
control,
- Create a ticketCreate a ticket
Function SkillDialog
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
Open
const SkillDialog: FC<Props> = (props) => {
const {
open,
onClose,
dialogType,
- Read upRead up
- Create a ticketCreate a ticket
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 AssessmentsStatisticsTable
has 196 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AssessmentsStatisticsTable: FC<Props> = (props) => {
const { numStudents, assessments } = props;
const courseId = getCourseId();
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function StudentAttemptCountTable
has 196 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const StudentAttemptCountTable: FC<Props> = (props) => {
const { t } = useTranslation();
const { courseId, assessmentId } = useParams();
const { includePhantom } = props;
- Create a ticketCreate a ticket
Function AchievementTable
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AchievementTable: FC<Props> = (props) => {
const { achievements, permissions, onTogglePublished, isReordering } = props;
if (achievements && achievements.length === 0) {
return (
- Create a ticketCreate a ticket
Function SubmissionForm
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SubmissionForm: FC<Props> = (props) => {
const { step } = props;
const { t } = useTranslation();
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function SurveyDetails
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SurveyDetails = (props) => {
const { survey, courseId, disabled } = props;
const navigate = useNavigate();
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function UserInvitationsTable
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UserInvitationsTable: FC<Props> = (props) => {
const {
title,
invitations,
pendingInvitations = false,
- Create a ticketCreate a ticket
Function ManageUsersTable
has 171 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ManageUsersTable = (props: ManageUsersTableProps): JSX.Element => {
const { users, manageStaff, timelinesMap, renderRowActionComponent } = props;
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function GroupCreationForm
has 170 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const GroupCreationForm = (props) => {
const { dispatch, existingGroups, initialValues, onSubmit } = props;
const {
control,
handleSubmit,
- Create a ticketCreate a ticket