Showing 1,205 of 1,252 total issues
Function MaterialsSettingsForm
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MaterialsSettingsForm = (
props: MaterialsSettingsFormProps,
): JSX.Element => {
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function ForumTopicNew
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ForumTopicNew: FC<Props> = (props) => {
const { open, onClose, availableTopicTypes, isAnonymousEnabled } = props;
const { t } = useTranslation();
const { forumId } = useParams();
const navigate = useNavigate();
- Create a ticketCreate a ticket
Function handleUpdate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleUpdate = (): Promise<void> => {
setIsUpdating(true);
return dispatch(
entityType === 'forum'
? updateForumSubscription(
- Create a ticketCreate a ticket
Function AnnouncementsSettingsForm
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AnnouncementsSettingsForm = (
props: AnnouncementsSettingsFormProps,
): JSX.Element => {
const { t } = useTranslation();
- Create a ticketCreate a ticket
Function useSliders
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useSliders = (): UseSlidersHook => {
const ref = useRef<HTMLDivElement>(null);
const [showSliders, setShowSliders] = useState([false, false]);
const resetShowSliders = (element: Element): void => {
- Create a ticketCreate a ticket
Function UnavailableAlert
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const UnavailableAlert = (props: UnavailableAlertProps): JSX.Element => {
const { for: assessment } = props;
const { t } = useTranslation();
if (!assessment.permissions.canAttempt)
- Create a ticketCreate a ticket
Function InstanceUsersInvitations
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InstanceUsersInvitations: FC<Props> = (props) => {
const { intl } = props;
const [isLoading, setIsLoading] = useState(false);
const invitations = useAppSelector(getAllInvitationMiniEntities);
- Create a ticketCreate a ticket
Function SurveyDetails
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const SurveyDetails = (props) => {
const { survey, courseId, disabled } = props;
const navigate = useNavigate();
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 CategoryCard
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const CategoryCard = ({
category,
numGroups,
intl,
onManageGroups,
- 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 QuestionFormOption
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const QuestionFormOption = (props) => {
const {
fieldsConfig,
field,
index,
- 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 Gate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const Gate = (props) => {
const {
canModify,
dispatch,
gateInputSizeThreshold,
- 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
Method annotation_replied
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def annotation_replied(post)
category = post.topic.actable.file.answer.submission.assessment.tab.category
email_enabled = category.course.email_enabled(:assessments, :new_comment, category.id)
return unless email_enabled.regular || email_enabled.phantom
- 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
Method post_replied
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def post_replied(post)
category = post.topic.actable.submission.assessment.tab.category
email_enabled = category.course.email_enabled(:assessments, :new_comment, category.id)
return unless email_enabled.regular || email_enabled.phantom
- 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
Method update_todo
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def update_todo
return unless todo
if submitted?
todo.update_attribute(:workflow_state, 'completed') unless todo.completed?
- 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
Method validate_no_repeat_bundles
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def validate_no_repeat_bundles(assignment_set)
attempted_questions = {}
@assessment.question_bundle_assignments.where.not(submission: nil).pluck(:user_id, :bundle_id).
each do |user_id, bundle_id|
attempted_questions[user_id] ||= Set.new
- 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 Checkbox
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
(props, ref): JSX.Element => {
const {
component,
label,
dangerouslySetInnerHTML,
- 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 buildFormData
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const buildFormData = (draft: ProgrammingFormRequestData): FormData => {
const data = new FormData();
appendInto(data, 'title', draft.question.title);
appendInto(data, 'description', draft.question.description);
- 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 AvatarSelector
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const AvatarSelector = (props: AvatarSelectorProps): JSX.Element => {
const { t } = useTranslation();
const [selectedImage, setSelectedImage] = useState<File>();
const [cropping, setCropping] = useState(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 getTabTypesToRender
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const getTabTypesToRender = (
permissions: CommentPermissions,
tabInfo: CommentTabInfo,
): CommentTabData[] => {
const tabs = [] as CommentTabTypes[];
- 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 ForumTopicTable
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const ForumTopicTable: FC<Props> = (props) => {
const { forum, forumTopics } = props;
const { t } = useTranslation();
if (!forum || forumTopics.length === 0) {
- 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"