Showing 1,205 of 1,252 total issues
Function buildGenerateRequestPayload
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const buildGenerateRequestPayload = (
codaveriData: CodaveriGenerateFormData,
questionData: QuestionPrototypeFormData,
): FormData => {
const data = new FormData();
- 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 Tab
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Tab = (props: TabProps): JSX.Element => {
const { tab, index, stationary, disabled } = props;
const { t } = useTranslation();
const { settings, deleteTabInCategory, moveAssessments } =
useAssessmentSettings();
- 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 Link
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Link = forwardRef<LinkRef, LinkProps>((props, ref): JSX.Element => {
const {
opensInNewTab,
external,
to: route,
- 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 CKEditorRichText
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const CKEditorRichText = (props: Props) => {
const {
label,
value,
onChange,
- 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 (
draft.pageState.tabValue === CommentTabTypes.MY_STUDENTS_PENDING ||
draft.pageState.tabValue === CommentTabTypes.MY_STUDENTS
) {
draft.tabs.myStudentUnreadCount! += 1;
- Create a ticketCreate a ticket
Function AchievementNew
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const AchievementNew: FC<Props> = (props) => {
const { open, onClose } = props;
const { t } = useTranslation();
const dispatch = useAppDispatch();
const navigate = useNavigate();
- 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 ExperiencePointsTableRow
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const ExperiencePointsTableRow: FC<Props> = (props) => {
const { record, isStudentPage, disabled } = props;
const [isDirty, setIsDirty] = useState(false);
const [rowData, setRowData] = useState({
id: record.id,
- 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 OptionsManager
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
(props, ref): JSX.Element => {
const { disabled, for: originalOptions } = props;
const [options, setOptions] = useState(originalOptions);
const optionRefs = useRef<Record<OptionEntity['id'], OptionRef>>({});
- 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 DataFilesManager
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const DataFilesManager = (props: DataFilesManagerProps): JSX.Element => {
const { t } = useTranslation();
const { control } = useFormContext<ProgrammingFormData>();
- 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 LevelsTableRow
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const LevelsTableRow: FC<Props> = ({
row,
index,
isThresholdOrderedCorrectly,
canManage,
- 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 VideoShow
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const VideoShow: FC<Props> = (props) => {
const { intl } = props;
const { videoId } = useParams();
const [isLoading, setIsLoading] = useState(true);
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 TestCaseRow
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const TestCaseRow: FC<Props> = (props) => {
const { result } = props;
const nameRegex = /\/?(\w+)$/;
const idMatch = result.identifier?.match(nameRegex);
- 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
Consider simplifying this complex logical expression. Open
if (
(sections && sections.length) < 1 ||
(sections[0].questions && sections[0].questions.length < 1) ||
(sections[0].questions[0].answers &&
sections[0].questions[0].answers.length < 1)
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (editMode) {
return (
<>
{renderRating()}
<TextField
- Create a ticketCreate a ticket
Function saveGrade
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function saveGrade(submissionId, grade, questionId, exp, published) {
- Create a ticketCreate a ticket
Function updateCategory
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
id,
{ name, description },
successMessage,
failureMessage,
setError,
- Create a ticketCreate a ticket
Function updateSurveySection
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
sectionId,
data,
successMessage,
failureMessage,
setError,
- Create a ticketCreate a ticket
Function updateSurvey
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
surveyId,
surveyFields,
successMessage,
failureMessage,
setError,
- Create a ticketCreate a ticket
Function updateSurveyQuestion
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
questionId,
data,
successMessage,
failureMessage,
setError,
- Create a ticketCreate a ticket
Function createSurvey
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
surveyFields,
successMessage,
failureMessage,
navigate,
setError,
- Create a ticketCreate a ticket