Showing 1,205 of 1,252 total issues
Function ScribingQuestionForm
has 170 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ScribingQuestionForm = (props) => {
const { data, initialValues, scribingId } = props;
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function Solution
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(props, ref): JSX.Element => {
const { disabled, for: originalSolution } = props;
const [solution, setSolution] = useState(originalSolution);
const [toBeDeleted, setToBeDeleted] = useState(false);
- Create a ticketCreate a ticket
Function AssessmentShowPage
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AssessmentShowPage = (props: AssessmentShowPageProps): JSX.Element => {
const { for: assessment } = props;
const { t } = useTranslation();
const isKoditsu = assessment.isKoditsuAssessmentEnabled;
- Create a ticketCreate a ticket
Function DisbursementForm
has 166 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DisbursementForm: FC<Props> = (props) => {
const { intl, courseUsers } = props;
const courseGroups = useAppSelector(getAllCourseGroupMiniEntities);
- Create a ticketCreate a ticket
Function PendingTodosTable
has 165 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PendingTodosTable: FC<Props> = (props) => {
const { intl, todos, todoType } = props;
const [shavedTodos, setShavedTodos] = useState(todos.slice(0, 5));
const [end, setEnd] = useState(10);
- Create a ticketCreate a ticket
Function EmailsList
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const EmailsList = (props: EmailCardProps): JSX.Element => {
const { t } = useTranslation();
const [emailToRemove, setEmailToRemove] = useState<EmailData>();
const removeEmail = (email: EmailData): void => {
- Create a ticketCreate a ticket
Function CodaveriCommentCard
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CodaveriCommentCard = (props) => {
const {
editValue,
handleChange,
updateComment,
- Create a ticketCreate a ticket
Function SubmissionsTable
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SubmissionsTable: FC<Props> = (props) => {
const {
intl,
isGamified,
submissions,
- Create a ticketCreate a ticket
Function StudentProgressionChart
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const StudentProgressionChart: FC<Props> = (props) => {
const { assessments, submissions } = props;
const { t } = useTranslation();
const [selectedStudentIndex, setSelectedStudentIndex] = useState(null);
const [showOpeningTimes, setShowOpeningTimes] = useState(true);
- Create a ticketCreate a ticket
Function useTanStackTableBuilder
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useTanStackTableBuilder = <D extends object>(
props: TableTemplate<D>,
): TanStackTableProps<D> => {
const [columns, getRealColumn] = buildTanStackColumns(
props.columns,
- Create a ticketCreate a ticket
Function SubmissionTabs
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SubmissionTabs: FC<Props> = (props) => {
const {
intl,
canManage,
isTeachingStaff,
- Create a ticketCreate a ticket
Function Dashboard
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Dashboard = (props) => {
const { dispatch, intl, isLoading, nodes, response, selectedElement } = props;
const [deleteArrowConfirmation, setDeleteArrowConfirmation] = useState(false);
const isEmptyResponse =
- Create a ticketCreate a ticket
Function VideoForm
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const VideoForm: FC<Props> = (props) => {
const {
open,
editing,
title,
- Create a ticketCreate a ticket
Function LeaderboardIndex
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LeaderboardIndex: FC<Props> = (props) => {
const { intl } = props;
const dispatch = useAppDispatch();
const tabView = useMedia.MinWidth('lg');
const [isLoading, setIsLoading] = useState(true);
- Create a ticketCreate a ticket
Function ForumTable
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForumTable: FC<Props> = (props) => {
const { forums } = props;
const { t } = useTranslation();
if (forums && forums.length === 0) {
return <Note message={t(translations.noForum)} />;
- Create a ticketCreate a ticket
Function ForumDisbursementTable
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForumDisbursementTable: FC<Props> = (props: Props) => {
const { intl, forumUsers, onPostClick } = props;
const columns: TableColumns[] = [
{
- Create a ticketCreate a ticket
Function Tab
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Tab = (props: TabProps): JSX.Element => {
const { tab, index, stationary, disabled } = props;
const { t } = useTranslation();
const { settings, deleteTabInCategory, moveAssessments } =
useAssessmentSettings();
- Create a ticketCreate a ticket
Function ForumPostTable
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForumPostTable: FC<Props> = (props: Props) => {
const { intl, posts: data } = props;
const columns: TableColumns[] = [
{
- Create a ticketCreate a ticket
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