Showing 1,205 of 1,252 total issues
Function buildCrumbsData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const buildCrumbsData = (
matches: Match[],
location: Location,
state: CrumbState,
): CrumbsDataBuilderResult => {
- Create a ticketCreate a ticket
Function createTime
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async (dispatch) => {
const adaptedData: TimePostData = {
reference_time: {
lesson_plan_item_id: itemId,
start_at: time.startAt,
- Create a ticketCreate a ticket
Function updateTime
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async (dispatch) => {
const adaptedData: TimePostData = {
reference_time: {
start_at: time.startAt,
bonus_end_at: time.bonusEndAt,
- Create a ticketCreate a ticket
Function MaterialsSettings
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MaterialsSettings = (): JSX.Element => {
const reloadItems = useItemsReloader();
const { t } = useTranslation();
const [form, setForm] = useState<FormEmitter<MaterialsSettingsData>>();
const [submitting, setSubmitting] = useState(false);
- Create a ticketCreate a ticket
Function AnnouncementsSettings
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AnnouncementsSettings = (): JSX.Element => {
const reloadItems = useItemsReloader();
const { t } = useTranslation();
const [form, setForm] = useState<FormEmitter<AnnouncementsSettingsData>>();
const [submitting, setSubmitting] = useState(false);
- Create a ticketCreate a ticket
Function CommentsSettings
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CommentsSettings = (): JSX.Element => {
const reloadItems = useItemsReloader();
const { t } = useTranslation();
const [form, setForm] = useState<FormEmitter<CommentsSettingsData>>();
const [submitting, setSubmitting] = useState(false);
- Create a ticketCreate a ticket
Function ForumsSettings
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ForumsSettings = (): JSX.Element => {
const reloadItems = useItemsReloader();
const { t } = useTranslation();
const [form, setForm] = useState<FormEmitter<ForumsSettingsData>>();
const [submitting, setSubmitting] = useState(false);
- Create a ticketCreate a ticket
Function LeaderboardSettings
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LeaderboardSettings = (): JSX.Element => {
const reloadItems = useItemsReloader();
const { t } = useTranslation();
const [form, setForm] = useState<FormEmitter<LeaderboardSettingsData>>();
const [submitting, setSubmitting] = useState(false);
- Create a ticketCreate a ticket
Function UploadButton
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
(props, ref): JSX.Element => {
const { t } = useTranslation();
const handleFileInputChange: ChangeEventHandler<HTMLInputElement> = (e) => {
if (props.disabled) return;
- Create a ticketCreate a ticket
Function CourseItem
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CourseItem = (props: CourseItemProps): JSX.Element => {
const { in: data } = props;
const menuRef = useRef<ComponentRef<typeof CourseSwitcherPopupMenu>>(null);
- Create a ticketCreate a ticket
Function CoursesNew
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CoursesNew: FC<Props> = (props) => {
const { open, onClose } = props;
const { t } = useTranslation();
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function FolderNew
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const FolderNew: FC<Props> = (props) => {
const { folderId, isOpen, onClose } = props;
const { t } = useTranslation();
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function FolderEdit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const FolderEdit: FC<Props> = (props) => {
const { isOpen, onClose, folderId, initialValues } = props;
const { t } = useTranslation();
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function NewQuestionMenu
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const NewQuestionMenu = (props: NewQuestionMenuProps): JSX.Element => {
const { with: newQuestionUrls } = props;
const { t } = useTranslation();
const [creating, setCreating] = useState(false);
const newQuestionButton = useRef<HTMLButtonElement>(null);
- Create a ticketCreate a ticket
Function SaveDraftButton
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SaveDraftButton: FC = () => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const {
- Create a ticketCreate a ticket
Function TestCases
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TestCases: FC<Props> = (props) => {
const { testCase } = props;
return (
<div className="my-5 space-y-5">
- Create a ticketCreate a ticket
Function renderStatusBadge
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderStatusBadge = (email: EmailData): JSX.Element => {
if (email.isPrimary)
return (
<Chip
className="select-none"
- Create a ticketCreate a ticket
Function groupItemsUnderMilestones
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function groupItemsUnderMilestones(items, milestones) {
const sortedMilestones = [...milestones].sort(sortByStartAt);
const sortedItems = [...items].sort((a, b) => {
const startAtSortResult = sortByStartAt(a, b);
if (startAtSortResult !== 0) {
- 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 formatAnswerSpecific
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const formatAnswerSpecific = (answer) => {
const answerMap = {
[questionTypes.MultipleChoice]: () => ({
option_ids: answer.option_ids,
}),
- 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 getCreateGroupMessage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const getCreateGroupMessage = (intl) => (created, failed) => {
if (created.length === 0) {
if (failed.length === 1) {
return intl.formatMessage(translations.createSingleFailure, {
groupName: failed[0].name,
- 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"