Showing 462 of 1,667 total issues
Function StudentExerciseList
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const StudentExerciseList = (props) => {
const {
assignments, course, current_user, editAssignments, exerciseView, openKey, selected,
sort, trainingStatus, wikidataLabels, sortUsers, userRevisions = {}
} = props;
Function CampaignList
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const CampaignList = ({ keys, showSearch, RowElement, headerText, userOnly, showStatistics = false }) => {
const { all_campaigns, all_campaigns_loaded, sort } = useSelector(state => state.campaigns);
const [searchParams, setSearchParams] = useSearchParams();
const search = searchParams.get('search');
const filteredCampaigns = showSearch && search ? all_campaigns.filter(campaign => campaign.title.toLowerCase().includes(search.toLowerCase())) : all_campaigns;
- 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 TextInput
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const TextInput = ({
value,
value_key,
editable,
label,
- 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 course
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function course(state = initialState, action) {
switch (action.type) {
case RECEIVE_COURSE:
return { loading: false, ...action.data.course };
case RECEIVE_COURSE_UPDATE: {
Function EditableRedux
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EditableRedux = (Component, Label) => {
const editableComponent = createReactClass({
displayName: 'EditableRedux',
propTypes: {
course_id: PropTypes.any,
Function Confirm
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Confirm = () => {
const dispatch = useDispatch();
const confirmationActive = useSelector(state => state.confirm.confirmationActive);
const confirmMessage = useSelector(state => state.confirm.confirmMessage);
Function CampaignOresPlot
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CampaignOresPlot = (props) => {
const [show, setShow] = useState(false);
const [loading, setLoading] = useState(true);
const [filePath, setFilePath] = useState(null);
Function onreadystatechange
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
document.onreadystatechange = () => {
if (document.readyState === 'complete') {
// Find tables with rows with data-link attribute, then make them clickable
document.querySelector('tr[data-link]')?.addEventListener('click', (e) => {
// skip if a button was clicked (used for other actions)
- 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 getAssessments
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export const getAssessments = (allRatings, revisions) => {
const ratings = Object.assign({}, ...allRatings);
const assessments = {};
for (const revision of revisions) {
const assessment = {};
- 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 Upload
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const Upload = ({ upload, view, linkUsername }) => {
const [width, setWidth] = useState(null);
const [height, setHeight] = useState(null);
const [isUploadViewerOpen, setIsUploadViewerOpen] = useState(false);
const [imageFile, setImageFile] = useState(null);
- 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 NotifyInstructorsButton
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
const NotifyInstructorsButton = (props) => {
const { notification, visible } = props;
const dispatch = useDispatch();
const sendNotificationHandler = () => {
DatePicker
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
const DatePicker = createReactClass({
displayName: 'DatePicker',
propTypes: {
id: PropTypes.string,
Function Assignment
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Assignment = (props) => {
if (!props.course.home_wiki) { return <div />; }
const article = props.article || CourseUtils.articleFromAssignment(props.assignmentGroup[0], props.course.home_wiki);
if (!article.formatted_title) {
article.formatted_title = CourseUtils.formattedArticleTitle(article, props.course.home_wiki, props.wikidataLabel);
Function render
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
render() {
const dateCalc = new DateCalculator(this.props.timeline_start, this.props.timeline_end, this.props.index, { zeroIndexed: false });
let weekDatesContent;
let meetDates;
if (this.props.meetings && this.props.meetings.length > 0) {
- 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 EnrollCard
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const EnrollCard = ({
user, userRoles, course, courseLink, passcode, enrolledParam, enrollFailureReason
}) => {
const [modalShown, setModalShown] = useState(false);
const [isHovered, setIsHovered] = 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 SearchableCourseList
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const SearchableCourseList = () => {
const [searchParams, setSearchParams] = useSearchParams();
const { results, loaded, sort } = useSelector(state => state.course_search_results);
const dispatch = useDispatch();
const searchRef = useRef();
- 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 a Cognitive Complexity of 16 (exceeds 5 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;
- 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 EditableRedux
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const EditableRedux = (Component, Label) => {
const editableComponent = createReactClass({
displayName: 'EditableRedux',
propTypes: {
course_id: PropTypes.any,
- 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 UploadList
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const UploadList = ({ uploads, view, sortBy, loadingUploads, totalUploadsCount }) => {
let elements;
let noUploadsMessage;
if (uploads.length > 0) {
elements = uploads.map(upload => (
- 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 AssignmentLinks
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const AssignmentLinks = ({ assignment, courseType, user, course, project, editMode }) => {
const { article_url, id, role, editors } = assignment;
const actions = [];
if ((editors && editors.length) || assignment.role === ASSIGNED_ROLE) {
- 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"