Showing 1,205 of 1,252 total issues
Function reducer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
(draft: InstanceAdminState, action: InstanceAdminActionType) => {
switch (action.type) {
case SAVE_ANNOUNCEMENT_LIST: {
const announcementList = action.announcementList;
const entityList = announcementList.map((data) => ({ ...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 questionHandle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const questionHandle: DataHandle = (match, location) => {
if (
location.pathname.endsWith('new') ||
location.pathname.endsWith('generate')
)
- 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 ForumManagementButtons
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const ForumManagementButtons: FC<Props> = (props) => {
const {
forum,
navigateToIndexAfterDelete,
navigateToShowAfterUpdate,
- 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 SavedIndicator
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const SavedIndicator = (props: SavedIndicatorProps): JSX.Element => {
const { at: lastSaved, success } = props;
const { t } = useTranslation();
- 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 AchievementTable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const AchievementTable: FC<Props> = (props) => {
const { achievements, permissions, onTogglePublished, isReordering } = props;
if (achievements && achievements.length === 0) {
return (
- 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 HorizontallyResizable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const HorizontallyResizable = (
props: HorizontallyResizableProps,
): JSX.Element => {
const [resizingHandle, setResizingHandle] = useState<ResizeHandle>();
- 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 FolderShow
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const FolderShow: FC = () => {
const { folderId } = useParams();
const { t } = useTranslation();
const dispatch = useAppDispatch();
- 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 LevelsManager
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const LevelsManager = (): JSX.Element => {
const { canManage, levels } = useAppSelector(getLevels);
const { t } = useTranslation();
const dispatch = useAppDispatch();
- 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 SkillsIndex
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const SkillsIndex: FC<Props> = (props) => {
const { intl } = props;
const dispatch = useAppDispatch();
const [isLoading, setIsLoading] = useState(true);
const [dialogType, setDialogType] = useState(DialogTypes.NewSkill);
- 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 StepperButton
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const StepperButton: FC<Props> = (props) => {
const { questionId, questionIndex, stepIndex } = props;
const explanations = useAppSelector(getExplanations);
- 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 AccountSettingsForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const AccountSettingsForm = (props: AccountSettingsFormProps): JSX.Element => {
const { t } = useTranslation();
const [stagedImage, setStagedImage] = useState<File>();
const [requirePasswordConfirmation, setRequirePasswordConfirmation] =
useState(true);
- 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 AddEmailSubsection
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const AddEmailSubsection = (props: AddEmailSubsectionProps): JSX.Element => {
const { t } = useTranslation();
const [email, setEmail] = useState('');
const [error, setError] = useState('');
const [expanded, setExpanded] = useState(false);
- 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 updateCodaveri
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
fileId,
topicId,
postId,
codaveriId,
text,
- Create a ticketCreate a ticket
Function duplicateCourse
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
fields,
destinationHost,
successMessage,
pendingMessage,
failureMessage,
- Create a ticketCreate a ticket
Function updateGroup
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
categoryId,
groupId,
{ name, description },
successMessage,
failureMessage,
- Create a ticketCreate a ticket
Function updateResponse
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
responseId,
payload,
successMessage,
failureMessage,
navigate,
- Create a ticketCreate a ticket
Function create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
submissionId,
answerId,
fileId,
line,
text,
- Create a ticketCreate a ticket
Function getGroupData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const getGroupData = (data, existingNames) => {
const groupData = [];
const isSingle = data.is_single === 'true' || data.is_single === true;
if (isSingle) {
groupData.push({ name: data.name, description: data.description });
- 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
Avoid deeply nested control flow statements. Open
if (this.ellipse && this.ellipse.type === 'ellipse') {
this.ellipse.selectable = false;
}
- Create a ticketCreate a ticket
Function TextResponse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const TextResponse = (props) => {
const {
answerId,
graderView,
handleUploadTextResponseFiles,
- 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"