Showing 390 of 2,206 total issues
File fixtures.ts
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { PromoProps } from './types';
export const promoProps = {
children:
'Además de sus decenas de museos tradicionales, Ciudad de México es una galería al aire libre de arte callejero, en la que exponen artistas nacionales y extranjeros. Lo invitamos a un recorrido.',
File index.test.jsx
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { RequestContextProvider } from '#contexts/RequestContext';
import { ToggleContextProvider } from '#contexts/ToggleContext';
import * as clickTracking from '#hooks/useClickTrackerHandler';
import * as viewTracking from '#hooks/useViewTracker';
File index.test.tsx
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import assocPath from 'ramda/src/assocPath';
import pashtoPageData from '#data/pashto/bbc_pashto_radio/w3ct0lz1.json';
import koreanPageData from '#data/korean/bbc_korean_radio/w3ct0kn5.json';
import zhongwenPageData from '#data/zhongwen/bbc_cantonese_radio/w172xf3r5x8hw4v.json';
File dataStructures.js
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
DesktopBigPromo,
BigPromo,
VerticalPromo,
TallPromo,
Function Tt
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
}(), Ct = "navigation", xt = "load", Tt = function() {
function e() {
var e = this;
this.eventListener = function() {
0 === performance.getEntriesByType(Ct).length ? e.performanceNavigationEventHandlerTimingLevel1() : new PerformanceObserver((function(t) {
Function _n
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
var _n = function() {
function e(e, t, n, r) {
void 0 === r && (r = {}),
void 0 === n && (n = "us-west-2");
var o = An(An({}, {
Function testsThatNeverRunDuringSmokeTestingForCanonicalOnly
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const testsThatNeverRunDuringSmokeTestingForCanonicalOnly = () => {
// TODO: Re-enable these and check for consent banner
describe.skip('Social Embed', () => {
// This test specifically covers an edge case where more than one tweet is
// included in a Story and twitter needs to be prompted to render the tweet
File index.stories.jsx
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { storiesOf } from '@storybook/react';
import styled from '@emotion/styled';
import {
color,
Function Image
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
const Image = ({
alt,
aspectRatio,
attribution,
className,
- 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 test
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
it('should be displayed if the toggle is on, and shows the expected number of items', function test() {
let toggleName;
if (Cypress.env('currentPath').includes('podcasts')) {
toggleName = 'recentPodcastEpisodes';
File directives.js
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { bbcDomains, advertisingServiceCountryDomains } from './domainLists';
const advertisingDirectives = {
frameSrc: [
'https://*.doubleclick.net',
File bn.test.js
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment';
import './bn';
moment.locale('bn');
Function t
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
function t(t) {
var n = e.call(this) || this;
return n.addXRayTraceIdHeader = function() {
return n.config.addXRayTraceIdHeader
}, n.isTracingEnabled = function() {
Function Cn
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Cn = function(e) {
function t(t) {
var n = e.call(this) || this;
return n.isTracingEnabled = function() {
return n.context.config.enableXRay
File index.test.js
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
videoBlock,
rawVideoBlock,
blockContainingText,
blockBase,
File index.test.tsx
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import {
act,
fireEvent,
render,
Function collectResults
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const collectResults = async (link, service, type) => {
await fetchWithCert(link).then(response => {
if (response.ok) {
response.json().then(json => {
const jsondata = 'data' in json ? json.data : json;
- 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 collectResults
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const collectResults = async (link, service, type) => {
await fetchWithCert(link).then(response => {
if (response.ok) {
response.json().then(json => {
const jsondata = 'data' in json ? json.data : json;
- 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 Xt
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
}, Xt = function() {
function e() {
this.pluginId = "com.amazonaws.rum.web-vitals"
}
return e.prototype.load = function(e) {
Function useClickTrackerHandler
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useClickTrackerHandler = (props = {}) => {
const preventNavigation = path(['preventNavigation'], props);
const componentName = path(['componentName'], props);
const url = path(['url'], props);
const advertiserID = path(['advertiserID'], props);