File RoutedSavableApp.jsx
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import Scroll from 'react-scroll';
import { withRouter } from 'react-router';
import { connect } from 'react-redux';
Function UNSAFE_componentWillReceiveProps
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
UNSAFE_componentWillReceiveProps(newProps) {
// When a user is logged in, the profile finishes loading after the component
// has mounted, so we check here.
// If we're done loading the profile, check to see if we should load or redirect
if (
- 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 UNSAFE_componentWillReceiveProps
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
UNSAFE_componentWillReceiveProps(newProps) {
// When a user is logged in, the profile finishes loading after the component
// has mounted, so we check here.
// If we're done loading the profile, check to see if we should load or redirect
if (
Function render
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { currentLocation, formConfig, children, loadedStatus } = this.props;
const appType = formConfig?.customText?.appType || APP_TYPE_DEFAULT;
const trimmedPathname = currentLocation.pathname.replace(/\/$/, '');
let content;
Function redirectOrLoad
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
redirectOrLoad(props) {
// Stop a user that's been redirected from being redirected again after
// logging in
this.shouldRedirectOrLoad = false;
Function render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { currentLocation, formConfig, children, loadedStatus } = this.props;
const appType = formConfig?.customText?.appType || APP_TYPE_DEFAULT;
const trimmedPathname = currentLocation.pathname.replace(/\/$/, '');
let content;
- 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 redirectOrLoad
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
redirectOrLoad(props) {
// Stop a user that's been redirected from being redirected again after
// logging in
this.shouldRedirectOrLoad = 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"