Showing 390 of 2,206 total issues
Function Grid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
(
{
children,
startOffset: gridStartOffset = {}, // alias this prop to prevent it rendering as an element attribute e.g. <div startoffset="[object Object]">
dir = 'ltr',
- 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 HeaderContainer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const HeaderContainer = ({
scriptSwitchId = '',
renderScriptSwitch = true,
}) => {
const { isAmp, isApp, pageType, isLite } = useContext(RequestContext);
- 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 StyledList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
${({ dir }) =>
`
@media (min-width: ${GEL_GROUP_0_SCREEN_WIDTH_MIN}){
margin-${dir === 'ltr' ? 'left' : 'right'}: ${GEL_SPACING};
&:first-child {
- 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 extractPlatform
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const extractPlatform = (query: Query): Platform | null => {
let platform: Platform | null = null;
// eslint-disable-next-line no-restricted-syntax
for (const id of query ?? []) {
- 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 childrenFallback
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const childrenFallback = (
item,
dir,
columnsGroup,
marginsGroup,
- 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 extractAltText
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const extractAltText = blocks => {
// eslint-disable-next-line no-restricted-syntax
for (const block of blocks) {
if (block.type === 'paragraph') {
return block.model.text;
- 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 providers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const providers = (provider, isLive) =>
({
instagram: {
script: 'https://www.instagram.com/embed.js',
styles: `
- 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 getEllipsisVisibility
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getEllipsisVisibility = (side: string, state: StateType) => {
// If we pruned some pages on this side, we display an ellipsis on all devices
const wasTruncated =
side === 'left' ? state.pagesTruncatedOnLeft : state.pagesTruncatedOnRight;
if (wasTruncated) return VISIBILITY.ALL;
- 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 OEmbedLoader
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const OEmbedLoader = ({ oembed }: OEmbedProps) => {
const { isAmp, isLite, canonicalLink } = useContext(RequestContext);
const { translations } = useContext(ServiceContext);
if (isLite) 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 getType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const getType = (pageType: PageTypes | 'index', shorthand = false) => {
switch (pageType) {
case FRONT_PAGE:
case 'index':
return shorthand ? 'IDX' : 'Index';
- 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 buildATIPageTrackPath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const buildATIPageTrackPath = ({
appName,
contentId,
contentType,
language,
- 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 SingleDoc
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const SingleDoc = ({ label, status, url, urlLabel }: SingleDocProps) => {
const iconStatusStyle = status ? styles.positive : styles.negative;
const hasIcon = status ? (
<Confirm css={styles.icon} />
) : (
- 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 SidebarLabel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const SidebarLabel = ({ item }) => {
const api = useStorybookApi();
const { isRoot, parameters, name, children, isComponent } = item;
const { docsOnly } = parameters ?? {};
- 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 RelatedContentItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
({ item, ariaLabelledBy, eventTrackingData = null }, viewRef) => {
if (!item || isEmpty(item)) return null;
const headlineFirst = pathOr<string>(
'',
- 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 [
'modern.OnDemandAudioPage-31ecd969.ec6af2d0.js',
'modern.commons-1111.js',
'modern.commons-2222.js',
'modern.1111-lib-1111.js',
Avoid too many return
statements within this function. Open
return [
'modern.ErrorPage-31ecd969.31473c35.js',
'modern.commons-1111.js',
'modern.commons-2222.js',
'modern.1111-lib-1111.js',
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return [
'modern.MostReadPage-31ecd969.7484ff05.js',
'modern.commons-1111.js',
'modern.commons-2222.js',
'modern.1111-lib-1111.js',
Avoid too many return
statements within this function. Open
return [
'modern.OnDemandTvPage-31ecd969.de41ab7f.js',
'modern.commons-1111.js',
'modern.1111-lib-1111.js',
'modern.3333-lib-2222.js',
Avoid too many return
statements within this function. Open
return [
'modern.FeatureIdxPage-31ecd969.31473c35.js',
'modern.commons-1111.js',
'modern.commons-2222.js',
'modern.1111-lib-1111.js',