Showing 453 of 1,605 total issues
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,
File course_cloned_modal.jsx
has 374 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 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
Function render
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
render() {
const canRename = this.canRename();
const isClassroomProgramType = this.props.course.type === 'ClassroomProgramCourse';
const timelineDatesDiffer = this.props.course.start !== this.props.course.timeline_start || this.props.course.end !== this.props.course.timeline_end;
let campus;
- 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 365 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'
API
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
const API = {
// /////////
// Getters /
// /////////
fetchFeedback(articleTitle, assignmentId) {
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) {
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 _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 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 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);
Function Course
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Course = withRouter((props) => {
useEffect(() => {
// Fetch all the data needed to render a course page
const courseSlug = getCourseSlug();
props.fetchCourse(courseSlug);
Function Panel
has 101 lines of code (exceeds 25 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(
Function OnboardingSupplementary
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const OnboardingSupplementary = (props) => {
const formRef = useRef(null);
const navigate = useNavigate();
const [state, setState] = useState({
heardFrom: '',