Showing 1,205 of 1,252 total issues
Function buildQuestionDataFromPrototype
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const buildQuestionDataFromPrototype = (
prefilledData: QuestionPrototypeFormData,
languageId: LanguageData['id'],
languageMode: LanguageMode,
): ProgrammingFormRequestData => {
- Create a ticketCreate a ticket
Function ContactableErrorAlert
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ContactableErrorAlert = (
props: ContactableErrorAlertProps,
): JSX.Element => {
const {
children: message,
- Create a ticketCreate a ticket
Function buildFormData
has 32 lines of code (exceeds 25 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);
- Create a ticketCreate a ticket
Function Accordion
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Accordion = (props: AccordionProps): JSX.Element => {
const { title, children, subtitle, disabled, icon, ...accordionProps } =
props;
return (
- Create a ticketCreate a ticket
Function handleLock
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleLock = (): Promise<void> => {
setIsLocking(true);
return dispatch(
updateForumTopicLocked(topic.id, topic.topicUrl, topic.isLocked),
)
- Create a ticketCreate a ticket
Function ForumNew
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ForumNew: FC<Props> = (props) => {
const { t } = useTranslation();
const { open, onClose } = props;
const dispatch = useAppDispatch();
- Create a ticketCreate a ticket
Function handleHide
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleHide = (): Promise<void> => {
setIsHiding(true);
return dispatch(
updateForumTopicHidden(topic.id, topic.topicUrl, topic.isHidden),
)
- Create a ticketCreate a ticket
Function onSubmit
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSubmit = (formData: IFormInputs): Promise<void> => {
const data = {
...formData,
id: item.id,
};
- Create a ticketCreate a ticket
Function CourseInfoBox
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CourseInfoBox = (props: CourseInfoBoxProps): JSX.Element => {
const { course } = props;
return (
<Grid item lg={1} md={1} sm={1} style={{ padding: 10 }} xl={1} xs={1}>
- Create a ticketCreate a ticket
Function ContinueButton
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ContinueButton: FC<Props> = (props) => {
const { stepIndex, onContinue } = props;
const { t } = useTranslation();
const assessment = useAppSelector(getAssessment);
- Create a ticketCreate a ticket
Function StatisticsCharts
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const StatisticsCharts: FC<Props> = (props) => {
const { t } = useTranslation();
const { submissions } = props;
const noPhantomSubmissions = submissions.filter(
- Create a ticketCreate a ticket
Function pollQuestionExportJobs
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const pollQuestionExportJobs = (): void => {
Object.values(generatePageData.conversations)
.filter(
(conversation) =>
conversation.exportStatus === 'importing' &&
- Create a ticketCreate a ticket
Function InstanceAdminNavigator
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InstanceAdminNavigator = (): JSX.Element => {
const { t } = useTranslation();
return (
<AdminNavigablePage
- Create a ticketCreate a ticket
Function default
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function (state = initialState, action) {
switch (action.type) {
case actions.FETCH_SUBMISSION_SUCCESS: {
const { expMultiplier } = state;
const submission = action.payload.submission;
- 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 processSubmissionsIntoChartData
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function processSubmissionsIntoChartData(
assessments,
submissions,
showPhantoms,
) {
- 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 default
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function (state = {}, action) {
switch (action.type) {
case actions.FETCH_SUBMISSION_SUCCESS:
case actions.FINALISE_SUCCESS:
case actions.UNSUBMIT_SUCCESS:
- 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 GroupUserManager
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const GroupUserManager = ({
dispatch,
categoryId,
group,
groups,
- 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 ResponseForm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const ResponseForm = (props) => {
const {
initialValues,
onSubmit,
readOnly,
- 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 define_permissions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def define_permissions
if course_user
allow_staff_read_groups if course_user.staff?
allow_teaching_staff_manage_groups if course_user.teaching_staff?
allow_group_manager_manage_group unless course_user.teaching_staff?
- 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 process_package
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def process_package
if attachment_changed?
attachment ? process_new_package : remove_old_package
elsif should_evaluate_package
# For non-autograded questions, the attachment is not present
- 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"