Showing 1,205 of 1,252 total issues
Function ProgrammingForm
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const ProgrammingForm = (props: ProgrammingFormProps): JSX.Element => {
const [data, setData] = useState(props.with);
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 WorkbinTableButtons
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const WorkbinTableButtons: FC<Props> = (props) => {
const {
currFolderId,
itemId,
itemName,
- 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 TestCaseComponent
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const TestCaseComponent: FC<TestCaseComponentProps> = (props) => {
const { testCaseResults, testCaseType } = props;
const { t } = useTranslation();
const isProgrammingAnswerEvaluated =
- 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 AuthenticatableApp
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AuthenticatableApp = (): JSX.Element => {
const auth = useAuthAdapter();
switch (auth.activeNavigator) {
case 'signinRedirect':
- Create a ticketCreate a ticket
Function AdminPopupMenuList
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AdminPopupMenuList = (): JSX.Element | null => {
const { t } = useTranslation();
const { user } = useAppContext();
- Create a ticketCreate a ticket
Function onFormSubmit
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onFormSubmit = (data: DisbursementFormData): void => {
setIsSubmitting(true);
const courseUserFields = filteredCourseUsers.map(
(user) => `courseUser_${user.id}`,
);
- Create a ticketCreate a ticket
Function LevelRing
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LevelRing = (props: LevelRingProps): JSX.Element => {
const { in: progress } = props;
const [percentage, setPercentage] = useState<number>();
- Create a ticketCreate a ticket
Function UserManagementButtons
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const UserManagementButtons: FC<Props> = (props) => {
const { intl, user } = props;
const dispatch = useAppDispatch();
const [isDeleting, setIsDeleting] = useState(false);
- Create a ticketCreate a ticket
Function TestCases
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TestCases = (props: TestCasesProps): JSX.Element => {
const { byIdentifier, as: component, name, ...otherProps } = props;
const TestCaseComponent = component ?? TestCase;
- Create a ticketCreate a ticket
Function PublishButton
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PublishButton: FC = () => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const assessment = useAppSelector(getAssessment);
- Create a ticketCreate a ticket
Function QuestionStepper
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const QuestionStepper: FC = () => {
return (
questionIds &&
questionIds.length > 1 && (
<Stepper
- Create a ticketCreate a ticket
Function SaveGradeButton
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SaveGradeButton: FC = () => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const submission = useAppSelector(getSubmission);
- Create a ticketCreate a ticket
Function MultipleResponseDetails
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MultipleResponseDetails = (
props: QuestionAnswerDisplayDetails<'MultipleResponse'>,
): JSX.Element => {
const { question, answer } = props;
return (
- Create a ticketCreate a ticket
Function ResendConfirmationEmailLandingPage
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ResendConfirmationEmailLandingPage = (): JSX.Element => {
const { t } = useTranslation();
const email = useEmailFromLocationState();
if (!email) return <Navigate to="/users/confirmation/new" />;
- Create a ticketCreate a ticket
Function renderOptionRow
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
static renderOptionRow(breakdown, hasImage, option, index, anonymous) {
const percentage = (100 * breakdown[option.id].count) / breakdown.length;
const {
id,
option: optionText,
- Create a ticketCreate a ticket
Function default
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (state = {}, action) {
switch (action.type) {
case actions.GET_PAST_ANSWERS_SUCCESS: {
return {
...state,
- Create a ticketCreate a ticket
Function renderEmailSettingsTable
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderEmailSettingsTable() {
const { emailSettings } = this.props;
if (emailSettings.length < 1) {
return (
- Create a ticketCreate a ticket
Function renderTextResultsTable
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
static renderTextResultsTable(answers, anonymous) {
return (
<Table>
<TableHead>
<TableRow>
- Create a ticketCreate a ticket
Function renderTextResponseSolutions
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderTextResponseSolutions(question) {
return (
<>
<hr />
<Typography variant="h6">
- Create a ticketCreate a ticket
Function renderPastAnswerSelect
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderPastAnswerSelect() {
const {
answers,
answerIds,
selectedAnswerIds,
- Create a ticketCreate a ticket