Showing 1,205 of 1,252 total issues
Function Form
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
const Form = <
D extends Data = any,
M extends boolean = false,
V extends AnyObjectSchema = never,
>(
- 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 render
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { fieldVisible } = this.state;
const {
fileId,
lineNumber,
- Create a ticketCreate a ticket
Function IndividualInviteForm
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const IndividualInviteForm: FC<Props> = (props) => {
const { openResultDialog, intl } = props;
const [isLoading, setIsLoading] = useState(false);
const dispatch = useAppDispatch();
const sharedData = useAppSelector(getManageCourseUsersSharedData);
- Create a ticketCreate a ticket
Function TimeBar
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TimeBar = (props: TimeBarProps): JSX.Element => {
const [{ start, bonus, end }, setTime] = useState<TimeTriplet>(
generateTriplet(props.startsAt, props.bonusEndsAt, props.endsAt),
);
- Create a ticketCreate a ticket
Function PackageFields
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PackageFields = (props: PackageFieldsProps): JSX.Element => {
const { t } = useTranslation();
const { control, watch } = useFormContext<ProgrammingFormData>();
- Create a ticketCreate a ticket
Function AssessmentAuthenticate
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AssessmentAuthenticate = (
props: AssessmentAuthenticateProps,
): JSX.Element => {
const { for: assessment } = props;
const [submitting, setSubmitting] = useState(false);
- Create a ticketCreate a ticket
Function ForgotPasswordPage
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForgotPasswordPage = (): JSX.Element => {
const { t } = useTranslation();
const [email, setEmail] = useEmailFromAuthPagesContext();
- Create a ticketCreate a ticket
Function ForumTopicShow
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForumTopicShow: FC = () => {
const { t } = useTranslation();
const { forumId, topicId } = useParams();
// Need to get the topic Id number below as sometimes, the topicId in the URL is in the form of slug.
// The topic id number is required to to select the entity from the redux store.
- Create a ticketCreate a ticket
Function LeaderboardSettingsForm
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LeaderboardSettingsForm = (
props: LeaderboardSettingsFormProps,
): JSX.Element => {
const { t } = useTranslation();
- Create a ticketCreate a ticket
Class SubmissionsController
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Course::Assessment::Submission::SubmissionsController < # rubocop:disable Metrics/ClassLength
Course::Assessment::Submission::Controller
include Course::Assessment::Submission::SubmissionsControllerServiceConcern
include Signals::EmissionConcern
include Course::Assessment::Submission::MonitoringConcern
- Create a ticketCreate a ticket
Function renderCommentContent
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderCommentContent = (): JSX.Element => {
if (editMode) {
return (
<>
{renderRating()}
- Create a ticketCreate a ticket
Function ExperiencePointsDetails
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ExperiencePointsDetails = (): JSX.Element => {
const [pageNum, setPageNum] = useState(1);
const [isLoading, setIsLoading] = useState(true);
const [isDownloading, setIsDownloading] = useState(false);
- Create a ticketCreate a ticket
Function PointManagementButtons
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PointManagementButtons: FC<Props> = (props) => {
const {
permissions,
data,
isManuallyAwarded,
- Create a ticketCreate a ticket
Function InvitationResultUsersTable
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InvitationResultUsersTable: FC<Props> = (props) => {
const { title, users, intl } = props;
const options: TableOptions = {
download: true,
- Create a ticketCreate a ticket
Function UserRequests
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UserRequests: FC<Props> = (props) => {
const { intl } = props;
const [isLoading, setIsLoading] = useState(true);
const enrolRequests = useAppSelector(getAllEnrolRequestEntities);
const permissions = useAppSelector(getManageCourseUserPermissions);
- Create a ticketCreate a ticket
Function PostCreatorObject
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PostCreatorObject = (props: PostCreatorProps): PostCreatorReturnProps => {
const { creator, canViewAnonymous = false, isAnonymous = false } = props;
const { t } = useTranslation();
const [hideAvatar, setHideAvatar] = useState(true);
- Create a ticketCreate a ticket
Function StaffStatisticsTable
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const StaffStatisticsTable: FC<Props> = (props) => {
const { staffs } = props;
const { t } = useTranslation();
const formattedStaffs = staffs.map(processStaff);
- Create a ticketCreate a ticket
Function IndividualInviteForm
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const IndividualInviteForm: FC<Props> = (props) => {
const { openResultDialog, intl } = props;
const [isLoading, setIsLoading] = useState(false);
const dispatch = useAppDispatch();
const emptyInvitation = {
- Create a ticketCreate a ticket
Function reducer
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
const reducer = produce((draft: CoursesState, action: CoursesActionType) => {
switch (action.type) {
case SAVE_COURSE_LIST: {
const courseList = action.courseList;
const entityList = courseList.map((data) => ({
- 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 VideosTabsManager
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const VideosTabsManager = (props: VideosTabsManagerProps): JSX.Element => {
const { tabs } = props;
const { t } = useTranslation();
const renameTab = (index: number, newTitle: VideosTab['title']): void =>
- Create a ticketCreate a ticket