Showing 462 of 1,667 total issues
Function TicketsHandler
has 171 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TicketsHandler = () => {
const [page, setPage] = useState(0);
const [mode, setMode] = useState('filter');
const [searchQuery, setSearchQuery] = useState({ by_email_or_username: '', in_subject: '', in_content: '', by_course: '', });
File AssignButton.jsx
has 450 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { useDispatch } from 'react-redux';
import { Link } from 'react-router-dom';
Function ArticleViewer
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
const ArticleViewer = ({ showOnMount, users, showArticleFinder, showButtonLabel,
fetchArticleDetails, assignedUsers, article, course, current_user = {},
showButtonClass, showPermalink = true, title }) => {
const [failureMessage, setFailureMessage] = useState(null);
const [fetched, setFetched] = useState(false);
- Read upRead up
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 revisions
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function revisions(state = initialState, action) {
switch (action.type) {
case INCREASE_LIMIT: {
let revisionsDisplayed = state.revisionsDisplayed.concat(
state.revisions.slice(
Function ArticleFinderRow
has 163 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ArticleFinderRow = (props) => {
const [isLoading, setIsLoading] = useState(false);
const prevPropsRef = useRef();
// Note: This comment is applicable for the article finder row of a course
Function ArticleFinderRow
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
const ArticleFinderRow = (props) => {
const [isLoading, setIsLoading] = useState(false);
const prevPropsRef = useRef();
// Note: This comment is applicable for the article finder row of a course
- Read upRead up
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 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.props.loadingUserCourses) {
return <div />;
}
// There are four fundamental states: NewOrClone, CourseForm, wizardForm and CloneChooser
File timeline.jsx
has 424 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import createReactClass from 'create-react-class';
import PropTypes from 'prop-types';
import { HTML5Backend } from 'react-dnd-html5-backend';
import { DndProvider } from 'react-dnd';
Function Nav
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Nav = () => {
const {
rooturl: rootUrl,
logopath: logoPath,
fluid: fluidStr,
Function AvailableActions
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
const AvailableActions = ({ course, current_user, updateCourse, courseCreationNotice }) => {
const dispatch = useDispatch();
const join = (role = null) => {
const enrollURL = course.enroll_url;
- Read upRead up
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 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const keys = articleListKeys(this.props.course);
const project = this.props.course.home_wiki.project;
const trackedEditable = this.props.current_user && this.props.current_user.isAdvancedRole;
Function TextResults
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
const TextResults = ({ followUpOnly, answers_data, follow_up_answers: followUpAnswers, sentiment, question }) => {
const [limit, setLimit] = useState();
const [buttonText, setbuttonText] = useState('More');
const followUpAnswerCount = Object.keys(followUpAnswers).length;
- Read upRead up
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 AssignButton
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
const AssignButton = ({ course, role, course_id, wikidataLabels = {}, hideAssignedArticles,
assignments, unassigned, student, allowMultipleArticles, current_user, isStudentsPage,
permitted, tooltip_message }) => {
const dispatch = useDispatch();
const [language, setLanguage] = useState('');
- Read upRead up
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 ArticleFinder
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
const ArticleFinder = (props) => {
const [isSubmitted, setIsSubmitted] = useState(false);
const [showFilters, setShowFilters] = useState(false);
useEffect(() => {
- Read upRead up
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 WeekdayPicker
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
const WeekdayPicker = ({
className: componentClassName,
style,
tabIndex,
- Read upRead up
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
File course_utils.spec.js
has 404 lines of code (exceeds 250 allowed). Consider refactoring. Open
import '../testHelper';
import courseUtils from '../../app/assets/javascripts/utils/course_utils.js';
describe('courseUtils.generateTempId', () => {
test('creates a slug from term, title and school', () => {
Function Form
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Form = (props) => {
const [state, setState] = useState({
started: false,
user: props.currentUser,
name: props.currentUser.real_name,
API
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
const API = {
// /////////
// Getters /
// /////////
fetchFeedback(articleTitle, assignmentId) {
File article_finder.jsx
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux';
import InputRange from 'react-input-range';
import { includes, map, find } from 'lodash-es';
import qs from 'query-string';
Function EditSizeGraph
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EditSizeGraph = (props) => {
useEffect(() => {
renderGraph();
}, []);