Showing 390 of 2,206 total issues
Function StoryPromoContainer
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const StoryPromoContainer = ({
item,
index = 0,
promoType = 'regular',
lazyLoadImage = 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 getPageData
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const getPageData = ({ service, pageType, variant = 'default', id }) => {
// eslint-disable-next-line no-param-reassign
service = config[service]?.name || service;
const env = Cypress.env('APP_ENV');
- 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 MediaArticlePage
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const MediaArticlePage = ({ pageData }: { pageData: Article }) => {
const { pageType, service } = useContext(RequestContext);
const {
articleAuthor,
isTrustProjectParticipant,
- 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 testsThatAlwaysRunForCanonicalOnly
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const testsThatAlwaysRunForCanonicalOnly = () => {
const skipOnLocal =
Cypress.env('APP_ENV') !== 'local' ? describe : describe.skip;
skipOnLocal(
Function decorators
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
story => {
useEffect(() => {
if (isChromatic()) {
forceVisible();
}
Function signEvent
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
}, e.prototype.signEvent = function(e, t) {
var n = e.headers,
r = e.payload,
o = t.signingDate,
i = void 0 === o ? new Date : o,
Function getToggles
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getToggles = async (service, cache) => {
const environment = getEnvConfig().SIMORGH_APP_ENV || 'local';
const timeout =
parseInt(getEnvConfig().SIMORGH_CONFIG_TIMEOUT_SECONDS, 10) * 1000;
const localToggles = defaultToggles[environment];
Function getAmpIframeUrl
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const getAmpIframeUrl = ({ id, versionID, lang }: FuncProps) => {
if (!id) return null;
const { platform, service, variant, assetId } = parseAvRoute(id);
- 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 shouldRender
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const shouldRender = (
{ pageData, status },
service,
pathName,
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 e
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function e(e) {
var t = this;
this.resourceEventListener = function(e) {
var n = [],
r = [],
Function getPromo
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getPromo = podcastPromo => {
if (!podcastPromo) {
return {};
}
Function generateLaunchDates
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
const generateLaunchDates = service => {
const output = [];
const serviceLaunch = launchDates[service];
if (serviceLaunch) {
Function a
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
a = function() {
function e(e) {
if (this.hash = new i.RawSha256, e) {
this.outer = new i.RawSha256;
var t = function(e) {
Function e
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function e(e, t) {
var n = this;
this.events = [],
this.recordPageView = function(e) {
n.isCurrentUrlAllowed() && n.pageManager.recordPageView(e)
Function bylineBlock
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const bylineBlock = (text, id = null) => {
const fragment = singleFragmentBlock(`@${text}`, id);
const urlLink = optionalIdBlock(
blockBase('urlLink', {
text: `@${text}`,
Function Ln
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Ln = function(e) {
return Pn(void 0, void 0, void 0, (function() {
var t,
n;
return kn(this, (function(r) {
Function exports
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = api => {
const env = api.env();
const useModern = env === 'modern';
const presets = [
Function test
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
it('should be displayed if there is enough schedule data', function test() {
const currentPath = `${Cypress.env(
'currentPath',
)}.json${overrideRendererOnTest()}`;
Function childrenFallback
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
const childrenFallback = (
item,
dir,
columnsGroup,
marginsGroup,
Function liveBlogUpdate
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map(result => {
const headerBlocks = result?.header?.model?.blocks;
const contentBlocks = result?.content?.model?.blocks;
if (!headerBlocks || !contentBlocks) return null;