Showing 1,205 of 1,252 total issues
Function CourseDisplay
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CourseDisplay: FC<Props> = (props) => {
const { intl, courses } = props;
const {
processedItems: processedCourses,
- Create a ticketCreate a ticket
Function ManageStaff
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ManageStaff: FC<Props> = (props) => {
const { intl } = props;
const [isLoading, setIsLoading] = useState(true);
const staff = useAppSelector(getAllStaffMiniEntities);
const permissions = useAppSelector(getManageCourseUserPermissions);
- Create a ticketCreate a ticket
Function StatisticsIndex
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const StatisticsIndex: FC = () => {
const { t } = useTranslation();
const statisticsUrl = getCourseStatisticsURL(getCourseId());
const tabs: TabData[] = [
- Create a ticketCreate a ticket
Function MaterialUploadForm
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MaterialUploadForm: FC<Props> = (props) => {
const {
handleClose,
onSubmit,
isSubmitting,
- Create a ticketCreate a ticket
Function PulseGrid
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PulseGrid = (props: PulseGridProps): JSX.Element => {
const { courseId, monitorId, title } = props.with;
const { t } = useTranslation();
const [userIds, setUserIds] = useState<number[]>([]);
- Create a ticketCreate a ticket
Function SubmitButton
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SubmitButton: FC<Props> = (props) => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const { questionId } = props;
- Create a ticketCreate a ticket
Method parse_from_file
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def parse_from_file(file)
row_num = 0
[].tap do |invites|
CSV.foreach(file).with_index(1) do |row, row_number|
row_num = row_number
- 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 SidebarSettingsForm
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const SidebarSettingsForm = (props: SidebarSettingsFormProps): JSX.Element => {
const { t } = useTranslation();
const [settings, setSettings] = useState(props.data);
const moveItem = (sourceIndex: number, destinationIndex: number): void => {
- 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 SubscribeButton
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const SubscribeButton: FC<Props> = ({
emailSubscription,
entityType,
entityId,
entityUrl,
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const numPostsSelected = this.state.selectedPostPacks.length;
const hasNoChanges =
JSON.stringify(
this.state.selectedPostPacks.map((pack) => pack.corePost.id).sort(),
- Create a ticketCreate a ticket
Function AssessmentTab
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AssessmentTab: FC<AssessmentTabProps> = (props) => {
const { tab } = props;
const assessments = useAppSelector((state) =>
getAssessmentsForTab(state, tab.id),
);
- Create a ticketCreate a ticket
Function AnnouncementsIndex
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AnnouncementsIndex = (): JSX.Element => {
const { t } = useTranslation();
// For new announcements form dialog
const [isOpen, setIsOpen] = useState(false);
- Create a ticketCreate a ticket
Function renderCommentContent
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderCommentContent = (): JSX.Element => {
if (editMode) {
return (
<div className="edit-discussion-post-form" id={`edit_post_${post.id}`}>
<CKEditorRichText
- Create a ticketCreate a ticket
Function Link
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Link = forwardRef<LinkRef, LinkProps>((props, ref): JSX.Element => {
const {
opensInNewTab,
external,
to: route,
- Create a ticketCreate a ticket
Function DataFileRow
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DataFileRow = (props: DataFileRowProps): JSX.Element => {
const file = unwrap(props.of);
const toBeDeleted = isMarked(props.of);
const handleClickDelete = (): void => {
- Create a ticketCreate a ticket
Function CourseUserItem
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CourseUserItem = (props: CourseUserItemProps): JSX.Element => {
const { from: data } = props;
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function McqWidget
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const McqWidget = (props: McqWidgetProps): JSX.Element | null => {
const { for: question } = props;
const { t } = useTranslation();
const [expanded, setExpanded] = useState(false);
- Create a ticketCreate a ticket
Function ResetProgrammingAnswerButton
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ResetProgrammingAnswerButton: FC<Props> = (props) => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const { questionId } = props;
- Create a ticketCreate a ticket
Function CoursesButtons
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CoursesButtons: FC<Props> = (props) => {
const { intl, course, deleteOperation } = props;
const dispatch = useAppDispatch();
const [openPrompt, setOpenPrompt] = useState(false);
const [isDeleting, setIsDeleting] = useState(false);
- Create a ticketCreate a ticket
Function BaseActiveSessionBlob
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const BaseActiveSessionBlob = (
props: BaseActiveSessionBlobProps,
): JSX.Element => {
const { of: snapshot, for: userId } = props;
- Create a ticketCreate a ticket