Showing 1,205 of 1,252 total issues
Function UsersIndex
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
const UsersIndex: FC<Props> = (props) => {
const { intl } = props;
const [isLoading, setIsLoading] = useState(false);
const [filter, setFilter] = useState({ active: false, role: '' });
const users = useAppSelector(getAllUserMiniEntities);
- 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 InstanceUserRoleRequestsTable
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
const InstanceUserRoleRequestsTable: FC<Props> = (props) => {
const {
title,
roleRequests,
pendingRoleRequests = 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 render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { label, errorText, name, disabled, style } = this.props;
const value = this.props.value ? moment(this.props.value) : null;
- Create a ticketCreate a ticket
Function default
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (state = initialState, action) {
switch (action.type) {
case actions.FETCH_SUBMISSION_SUCCESS:
case actions.FINALISE_SUCCESS: {
return produce(state, (draft) => {
- Create a ticketCreate a ticket
Function formatQuestionFormData
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const formatQuestionFormData = (data) => {
const payload = new FormData();
const filledOptions = data.options.filter(
(option) => option && (option.option || option.file || option.image_url),
);
- Create a ticketCreate a ticket
Function default
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (state = initialState, action) {
const { type } = action;
switch (type) {
case actionTypes.CREATE_RESPONSE_REQUEST:
case actionTypes.LOAD_RESPONSE_EDIT_REQUEST:
- Create a ticketCreate a ticket
Function renderLessonPlanItemAssessmentSettingsTable
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderLessonPlanItemAssessmentSettingsTable() {
const { lessonPlanItemSettings } = this.props;
const assessmentItemSettings = lessonPlanItemSettings.filter(
(setting) => setting.component === 'course_assessments_component',
);
- Create a ticketCreate a ticket
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { question, dragging, expanded } = this.props;
return (
<Accordion expanded={expanded}>
- Create a ticketCreate a ticket
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { groups } = this.props;
if (groups.length < 2) {
return null;
- Create a ticketCreate a ticket
Function renderRow
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderRow(setting) {
const componentTitle =
setting.component_title ??
(subscriptionComponents[setting.component] ? (
<FormattedMessage {...subscriptionComponents[setting.component]} />
- Create a ticketCreate a ticket
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
commentForms,
posts,
topic,
- Create a ticketCreate a ticket
Function IndividualInvitations
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const IndividualInvitations: FC<Props> = (props) => {
const { isLoading, permissions, fieldsConfig, intl } = props;
const { append, fields } = fieldsConfig;
const appendNewRow = (): void => {
- Create a ticketCreate a ticket
Function Toolbar
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Toolbar = (props: ToolbarProps): JSX.Element => {
const { intl } = props;
const handleDeleteFiles = (e): void => {
e.preventDefault();
- Create a ticketCreate a ticket
Function SidebarContainer
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(props, ref): JSX.Element => {
const smallScreen = useMedia.MinWidth('md');
const mobile = useMedia.PointerCoarse();
const [pinned, setPinned] = useState<boolean>();
- Create a ticketCreate a ticket
Function CourseInvitationCodeForm
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CourseInvitationCodeForm: FC<Props> = (props) => {
const { intl } = props;
const [code, setCode] = useState('');
- Create a ticketCreate a ticket
Function AllAttemptsIndex
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AllAttemptsIndex: FC<Props> = (props) => {
const { curAnswerId, index } = props;
const { t } = useTranslation();
const { courseId, assessmentId } = useParams();
- Create a ticketCreate a ticket
Function ProgressPanel
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ProgressPanel = (props): JSX.Element => {
const { submission } = props;
const { late, submitter, workflowState } = submission;
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function NewProgrammingQuestionPage
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const NewProgrammingQuestionPage = (): JSX.Element => {
const [id, setId] = useState<number>();
const [persisted, setPersisted] = useState(false);
const createOrUpdate = (
- Create a ticketCreate a ticket
Function renderActions
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderActions = (email: EmailData): JSX.Element | null => {
if (email.isPrimary) return null;
const confirmationUrl = email.confirmationEmailPath;
const setPrimaryUrl = email.setPrimaryUserEmailPath;
- Create a ticketCreate a ticket
Function MultipleResponseOptionsField
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const MultipleResponseOptionsField = (props) => {
const {
disabled,
field: { onChange, value },
fieldState: { error },
- Create a ticketCreate a ticket