Showing 1,214 of 1,261 total issues
Function StudentPerformanceTable
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
Open
const StudentPerformanceTable: FC<Props> = (props) => {
const {
students,
hasPersonalizedTimeline,
isCourseGamified,
- 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 reducer
has 152 lines of code (exceeds 25 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 };
- Create a ticketCreate a ticket
Function SurveysTable
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SurveysTable = (props) => {
const {
surveys,
courseId,
surveysFlags: { canCreate, studentsCount },
- Create a ticketCreate a ticket
Function Option
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Option = forwardRef<OptionRef, OptionProps>((props, ref): JSX.Element => {
const { disabled, adapter: texts, for: originalOption } = props;
const [option, setOption] = useState(originalOption);
const [toBeDeleted, setToBeDeleted] = useState(false);
- Create a ticketCreate a ticket
Function SkillsIndex
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SkillsIndex: FC<Props> = (props) => {
const { intl } = props;
const dispatch = useAppDispatch();
const [isLoading, setIsLoading] = useState(true);
const [dialogType, setDialogType] = useState(DialogTypes.NewSkill);
- Create a ticketCreate a ticket
Function GenerateTabs
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const GenerateTabs: FC<Props> = (props) => {
const {
onExport,
createConversation,
deleteConversation,
- Create a ticketCreate a ticket
Function AssessmentsTable
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AssessmentsTable = (props: AssessmentsTableProps): JSX.Element => {
const { display, assessments } = props.assessments;
const { t } = useTranslation();
const columns: ColumnTemplate<AssessmentListData>[] = [
- Create a ticketCreate a ticket
Function AnnouncementForm
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AnnouncementForm: FC<Props> = (props) => {
const { open, editing, title, onClose, initialValues, onSubmit, canSticky } =
props;
const { t } = useTranslation();
const [whenToPublish, setWhenToPublish] = useState<PublishTime>('now');
- Create a ticketCreate a ticket
Function HeartbeatsTimelineChart
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const HeartbeatsTimelineChart = (
props: HeartbeatsTimelineChartProps,
): JSX.Element => {
const { in: heartbeats } = props;
- Create a ticketCreate a ticket
Function default
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (state = initialState, action) {
switch (action.type) {
case actions.FETCH_SUBMISSION_SUCCESS:
return {
...state,
- Create a ticketCreate a ticket
Function EventForm
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const EventForm = (props) => {
const { onSubmit, initialValues, disabled, eventTypes, eventLocations } =
props;
const {
control,
- Create a ticketCreate a ticket
Function AnnouncementCard
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AnnouncementCard: FC<Props> = (props) => {
const {
intl,
announcement,
showEditOptions,
- Create a ticketCreate a ticket
Function LevelsManager
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LevelsManager = (): JSX.Element => {
const { canManage, levels } = useAppSelector(getLevels);
const { t } = useTranslation();
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function default
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (state = initialState, action) {
switch (action.type) {
case actions.FETCH_SUBMISSION_SUCCESS: {
const { expMultiplier } = state;
const submission = action.payload.submission;
- Create a ticketCreate a ticket
Function FileManager
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const FileManager = (props: FileManagerProps): JSX.Element => {
const { disabled, intl } = props;
const [materials, setMaterials] = useState(props.materials ?? []);
const [uploadingMaterials, setUploadingMaterials] = useState<Material[]>([]);
- Create a ticketCreate a ticket
Function ConditionsManager
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ConditionsManager = (props: ConditionsManagerProps): JSX.Element => {
const { t } = useTranslation();
const [conditions, setConditions] = useState(props.conditionsData.conditions);
const [conditionToCreate, setConditionToCreate] =
useState<ConditionAbility>();
- Create a ticketCreate a ticket
Function AssessmentConditionForm
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AssessmentConditionForm = (
props: AnyConditionProps<AssessmentConditionData> & {
assessments: AvailableAssessments;
},
): JSX.Element => {
- Create a ticketCreate a ticket
Function UsersIndex
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UsersIndex: FC<Props> = (props) => {
const { intl } = props;
const [isLoading, setIsLoading] = useState(true);
const [filter, setFilter] = useState({ active: false, role: '' });
const users = useAppSelector(getAllUserMiniEntities);
- Create a ticketCreate a ticket
Function PersonalTimesShow
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PersonalTimesShow: FC<Props> = (props) => {
const { intl } = props;
const [isLoading, setIsLoading] = useState(true);
const [isRecomputing, setIsRecomputing] = useState(false);
const { userId } = useParams();
- Create a ticketCreate a ticket
Function OptionsManager
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(props, ref): JSX.Element => {
const { disabled, for: originalOptions } = props;
const [options, setOptions] = useState(originalOptions);
const optionRefs = useRef<Record<OptionEntity['id'], OptionRef>>({});
- Create a ticketCreate a ticket