Showing 62 of 222 total issues
Function Profile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Profile = (props, { backgroundless, vertical }) => {
const { status, statusHighlighted, isPlaceholder } = props;
const renderName = (prop, name, nameClasses, nameLink) => {
if (! name) {
- 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 _updateState
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_updateState(props = this.props) {
const { isAnyApiCallLoadingBeyondThreshold, isAnyApiCallLoading } = props;
if (! IS_ACTIVE) return; // CONFIG flag check
if (isAnyApiCallLoadingBeyondThreshold) {
this.setState({ isThrobberVisible: true });
- 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 HistoryLink
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const HistoryLink = (props) => {
const currentRoute = props.routes[props.routes.length - 1];
let history = currentRoute.history;
if (is.function(currentRoute.canAccess) && (! (currentRoute.canAccess(props)))) return 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 _setPageTitle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_setPageTitle(props) {
this._breadcrumbs = BreadcrumbsBuilder.buildWithProps(props);
const visibleBreadcrumbCount =
this._breadcrumbs && this._breadcrumbs.filter((bc) => ! bc.hidden).length;
if (! this._breadcrumbs || visibleBreadcrumbCount <= 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 handleChange
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
handleChange(e) {
if (this.props.acceptedChars) {
if (this.props.acceptedChars.type === 'number' &&
e.target.value.match(/\D/g)
) {
- 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 mapStateToProps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function mapStateToProps(state, { routes }) {
const user = state.get('singleSignOn').get('user');
const permissionChecks = routes.filter((route) => {
if (is.not.existy(route.canAccess)) {
return 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 AuthorizationHandler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const AuthorizationHandler = (props) => {
const { user, permissionChecks, children, havePrivilegesLoaded } = props;
const spinner = <PageLoadingSpinner />;
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const props = this.props;
const type = props.type || Type.default;
validateType(type);
- 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
Avoid too many return
statements within this function. Open
return new ApiResponse({ data: apiResponse.data });
Avoid too many return
statements within this function. Open
return new ApiResponse({ error: apiResponse.error });
Avoid too many return
statements within this function. Open
return children;
Avoid too many return
statements within this function. Open
return new ApiResponse({ error: new Error(apiResponse.error) });
Avoid too many return
statements within this function. Open
return state;
Avoid too many return
statements within this function. Open
return state.set(key, newState);
Avoid too many return
statements within this function. Open
return new ApiResponse({ data: apiResponse });
Avoid too many return
statements within this function. Open
return this._sendCallbackWithNewValue(this._max);
Avoid too many return
statements within this function. Open
return <AuthorisationErrorPage {...props} />;
Function createApiActionCreator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const createApiActionCreator = (actionObjectName,
url, method = 'GET',
requestExtras = {}, successExtras = {}, failureExtras = {}) => // these are optional!
(dispatch) => {
- 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 ErrorPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const ErrorPage = (props) => {
const { config } = props;
return <div className={styles.ErrorPage}>
<div className={styles.ErrorPage_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 parseRoutes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function parseRoutes(routes, store) {
if (is.array(routes)) {
return routes.map((route) => parseRoutes(route, store));
}
- 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"