Showing 462 of 1,667 total issues
Function exports
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (env) => {
const mode = env.development ? 'development' : 'production';
const isProductionOrCI = env.production || env.coverage;
let devtool = 'eval-cheap-source-map';
// see https://webpack.js.org/configuration/devtool/ for the detailed descriptions of these
Function render
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let content;
let faqLink;
let wikipediaHelpButton;
File course_cloned_modal.jsx
has 383 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 Modal from '../common/modal.jsx';
import TextInput from '../common/text_input.jsx';
Function renderGraph
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderGraph = () => {
const vegaSpec = {
width: props.graphWidth,
height: props.graphHeight,
padding: 5,
Function CourseDates
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CourseDates = (props) => {
const updateCourseDates = (key, value) => {
const updatedCourse = CourseDateUtils.updateCourseDates(props.course, key, value);
props.updateCourseProps(updatedCourse);
};
Function render
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (this.props.loading) {
return <Loading />;
}
- 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 RevisionHandler
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
const RevisionHandler = ({ course, courseScopedLimit }) => {
const [isCourseScoped, setIsCourseScoped] = useState(false);
const dispatch = useDispatch();
- 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 routes.rb
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
Rails.application.routes.draw do
get 'errors/file_not_found'
get 'errors/unprocessable'
get 'errors/login_error'
get 'errors/internal_server_error'
Function NotesPanel
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
const NotesPanel = () => {
// State variables for managing the modal and note creation
const [isModalOpen, setIsModalOpen] = useState(null);
const [isNoteCreationActive, setIsNoteCreationActive] = useState(false);
Function render
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const spacer = this.props.spacer || ': ';
let label;
let timeLabel;
let currentMonth;
Function Feedback
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
const Feedback = ({ assignment, username, current_user }) => {
const [show, setShow] = useState(false);
const [fetched, setFetched] = useState(false);
const [feedbackSent, setFeedbackSent] = useState(false);
const [feedbackInput, setFeedbackInput] = 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 render
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { course, current_user } = this.props;
if (course.cloned_status === 1 || course.cloned_status === 3) {
return (
Function Panel
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
const Panel = (props) => {
const persistState = () => {
const step = props.step.toLowerCase().split(' ').slice(0, 2);
step[1] = +step[1] + 1; // Keeping the step in line with the UI
window.history.pushState(
- 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 InputHOC
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
const InputHOC = (Component) => {
const validatingComponent = createReactClass({
displayName: `Input${Component.displayName}`,
// value passed is HOC's state value
- 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 Wp10Graph
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Wp10Graph = (props) => {
useEffect(() => {
renderGraph();
}, []);
Function render
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
render() {
const spacer = this.props.spacer || ': ';
let label;
let timeLabel;
let currentMonth;
- 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 _handleMoveBlock
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
_handleMoveBlock(moveUp, blockId) {
for (let i = 0; i < this.props.weeks.length; i += 1) {
const week = this.props.weeks[i];
const blocks = this.getBlocksInWeek(week.id);
for (let j = 0; j < blocks.length; j += 1) {
- 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 PagePileScoping
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PagePileScoping = () => {
const [inputValue, setInputValue] = useState('');
const pagePileIds = useSelector(state => state.scopingMethods.pagepile.ids);
const dispatch = useDispatch();
Function PetScanScoping
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PetScanScoping = () => {
const [inputValue, setInputValue] = React.useState('');
const petscanIDs = useSelector(state => state.scopingMethods.petscan.psids);
const dispatch = useDispatch();
const home_wiki = useSelector(state => state.course.home_wiki);
File course_approval.jsx
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import { difference, uniq } from 'lodash-es';