Showing 390 of 2,206 total issues
Avoid too many return
statements within this function. Open
return PROVIDERS.UNKNOWN;
Avoid too many return
statements within this function. Open
return PROVIDERS.FACEBOOK;
Avoid too many return
statements within this function. Open
return localToggles;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return <FlourishEmbed {...oembed} />;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return <EmbedHtml embeddableContent={html} />;
Avoid too many return
statements within this function. Open
return 'Unknown';
Avoid too many return
statements within this function. Open
return curationLength > 1 && (title || isFirstCuration) ? (
<section aria-labelledby={id} role="region">
{isFirstCuration ? (
<VisuallyHiddenText id={id} as="h2">
{curationSubheading}
Function getRouteProps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getRouteProps = url => {
const matchedRoutes = matchRoutes(routes, url);
const route = path([0, 'route'], matchedRoutes);
const match = path([0, 'match'], matchedRoutes);
- 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 squashTopStories
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const squashTopStories = jsonRaw => {
const json = jsonRaw;
let groups = pathOr(null, ['content', 'groups'], json);
let collectedItems = [];
let collectedStrapline;
- 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 getCert
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getCert = async () => {
const caPath = process.env.CA_PATH || '/etc/pki/tls/certs/ca-bundle.crt';
const certChainPath =
process.env.CERT_CHAIN_PATH || '/etc/pki/tls/certs/client.crt';
const keyPath = process.env.KEY_PATH || '/etc/pki/tls/private/client.key';
- 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 pruneInvisible
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const pruneInvisible = (_state: StateType) => {
const state = clone(_state);
state.result = state.result.filter((page, index) => {
if (!page.visibility) {
// if an element is being filtered out, we need to remember we did this
- 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 addLiteExtension
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const addLiteExtension = (href?: string) => {
if (!href) return null;
const url = new URL(href, 'http://localhost');
- 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 FrostedGlassPromo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const FrostedGlassPromo = ({
image,
children,
footer = null,
url,
- 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 NielsenAnalytics
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const NielsenAnalytics = () => {
const { service, isAmp, pathname } = useContext(RequestContext);
// nielsenAnalytics toggle only set up as local toggle at the moment...
const { enabled } = useToggle('nielsenAnalytics');
- 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 getProviderFromSource
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getProviderFromSource = source => {
if (source.match(/^https:\/\/twitter\.com/)) {
return PROVIDERS.TWITTER;
}
if (source.match(/^https:\/\/www\.instagram\.com/)) {
- 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 IndexPageSection
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const IndexPageSection = ({
bar = true,
group,
sectionNumber,
showAllPromos = 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 RecentAudioEpisodes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const RecentAudioEpisodes = ({
masterBrand,
episodes,
brandId = '',
pageType,
- 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 ScrollablePromo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ScrollablePromo = ({ blocks, blockGroupIndex = null }) => {
const { script, service, dir, translations } = useContext(ServiceContext);
const eventTrackingData = {
componentName: `edoj${blockGroupIndex}`,
- 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"