Showing 1,205 of 1,252 total issues
Function CKEditorRichText
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CKEditorRichText = (props: Props) => {
const {
label,
value,
onChange,
- Create a ticketCreate a ticket
Function ForumTopicManagementButtons
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForumTopicManagementButtons: FC<Props> = (props) => {
const { topic, pageType, disabled, showOnHover } = props;
const dispatch = useAppDispatch();
const { t } = useTranslation();
const navigate = useNavigate();
- Create a ticketCreate a ticket
Function SolutionsManager
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(props, ref): JSX.Element => {
const { disabled, for: originalSolutions, isAssessmentAutograded } = props;
const [solutions, setSolutions] = useState(originalSolutions);
const solutionRefs = useRef<Record<SolutionEntity['id'], SolutionRef>>({});
- Create a ticketCreate a ticket
Function InstanceUserRoleRequestForm
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InstanceUserRoleRequestForm: FC<Props> = (props) => {
const { open, onClose, instanceUserRoleRequest } = props;
const { t } = useTranslation();
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function ReplyCard
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ReplyCard: FC<Props> = (props) => {
const {
postId,
isReplying,
isAnonymousEnabled,
- Create a ticketCreate a ticket
Function render
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
confirmationDialogOpen,
disabled,
dispatch,
- Create a ticketCreate a ticket
Function ForumDisbursement
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForumDisbursement: FC = () => {
const retrievedPostUserIds = new Set();
const { t } = useTranslation();
const [selectedForumPostUser, setSelectedForumPostUser] =
useState<ForumDisbursementUserEntity | null>();
- Create a ticketCreate a ticket
Function AssessmentShowHeader
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AssessmentShowHeader = (
props: AssessmentShowHeaderProps,
): JSX.Element => {
const { with: assessment } = props;
const { t } = useTranslation();
- Create a ticketCreate a ticket
Class AssessmentsController
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Course::Assessment::AssessmentsController < Course::Assessment::Controller # rubocop:disable Metrics/ClassLength
include Course::Assessment::AssessmentsHelper
include Course::Assessment::KoditsuAssessmentConcern
include Course::Assessment::Question::KoditsuQuestionConcern
include Course::Assessment::KoditsuAssessmentInvitationConcern
- Create a ticketCreate a ticket
Function AssessmentDetails
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AssessmentDetails = (props: AssessmentDetailsProps): JSX.Element => {
const { for: assessment } = props;
const { t } = useTranslation();
return (
- Create a ticketCreate a ticket
Function QuestionGrade
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
Open
const QuestionGrade: FC<QuestionGradeProps> = (props) => {
const { questionId, isSaving } = props;
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 TextResponseForm
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TextResponseForm = <T extends 'new' | 'edit'>(
props: TextResponseFormProps<T>,
): JSX.Element => {
const { with: data } = props;
- Create a ticketCreate a ticket
Function DisbursementTable
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DisbursementTable: FC<Props> = (props: Props) => {
const { filteredUsers, onClickCopy, onClickRemove, intl } = props;
const columns: TableColumns[] = [
{
- Create a ticketCreate a ticket
Function FilterForm
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const FilterForm: FC<Props> = (props) => {
const { intl, initialValues } = props;
const [isSearching, setIsSearching] = useState(false);
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function UsersIndex
has 112 lines of code (exceeds 25 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 userCounts = useAppSelector(getAdminCounts);
- Create a ticketCreate a ticket
Function TimePopup
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TimePopup = (props: TimePopupProps): JSX.Element => {
const {
anchorsOn: anchorElement,
for: time,
assignedIn: timeline,
- Create a ticketCreate a ticket
Function ForumManagementButtons
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ForumManagementButtons: FC<Props> = (props) => {
const {
forum,
navigateToIndexAfterDelete,
navigateToShowAfterUpdate,
- Create a ticketCreate a ticket
Function SubmissionsTableRow
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
Open
const SubmissionsTableRow = (props) => {
const { assessment, assessmentId, courseId, dispatch, submission } = props;
const palette = useTheme().palette;
const [state, setState] = useState({
unsubmitConfirmation: 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 renderHeader
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderHeader(shownSubmissions) {
const {
assessment: { canPublishGrades, canForceSubmit, isKoditsuEnabled },
isPublishing,
isForceSubmitting,
- Create a ticketCreate a ticket
Function AssessmentCategoriesManager
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AssessmentCategoriesManager = (props: Props): JSX.Element => {
const { categories } = props;
const { t } = useTranslation();
const { createCategory, settings } = useAssessmentSettings();
- Create a ticketCreate a ticket