Showing 390 of 2,206 total issues
Function dealWithNonNumericCharacters
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const dealWithNonNumericCharacters = (versionString, timeJson) => {
const patchVersion = versionString.match(/patch/);
if (patchVersion) {
const possibleVersionStrings = versionString.match(
/@npm:([\d.]+)|@([\d.]+)/,
Function performanceNavigationEventHandlerTimingLevel1
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.performanceNavigationEventHandlerTimingLevel1 = function() {
setTimeout((function() {
var t = performance.timing,
n = t.navigationStart,
r = {
Function w
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function w(e, t, n) {
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
var r,
o = n.apply(e, t || []),
Function signString
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
}, e.prototype.signString = function(e, t) {
var n = void 0 === t ? {} : t,
r = n.signingDate,
o = void 0 === r ? new Date : r,
i = n.signingRegion,
Function rowsTest
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const rowsTest = value => {
describe('first section', () => {
it(`should correctly split ${value} stories`, () => {
const items = numberOfStories[value].input;
const isFirstSection = true;
Function allowedItemsTest
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const allowedItemsTest = value => {
describe('first section', () => {
it(`should return correct allowed items for ${value} stories`, () => {
const items = numberOfStories[value].input;
const isFirstSection = true;
Function AdvertTagLoader
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AdvertTagLoader = () => {
const location = useLocation();
const queryString = location ? location.search : '';
useEffect(() => {
Function getRemoteGitFile
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getRemoteGitFile = async (gitDepUrl, args) => {
let url = `https://api.github.com/repos/${gitDepUrl}/contents/package.json`;
if (url.includes('/tree/')) {
url = url
.replace(/\/tree\/[^/]+\//, '/contents/')
Function assumeRoleWithWebIdentity
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.assumeRoleWithWebIdentity = function(e) {
return E(t, void 0, void 0, (function() {
var t,
n,
r;
Function bylineExtractor
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const bylineExtractor = (blocks: OptimoBylineContributorBlock[]) => {
const bylineBlocks = blocks?.[0]?.model?.blocks || [];
const authorBlock = bylineBlocks.find(block => block.type === 'name');
const jobRoleBlock = bylineBlocks.find(block => block.type === 'role');
Function squashTopStories
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const squashTopStories = jsonRaw => {
const json = jsonRaw;
let groups = pathOr(null, ['content', 'groups'], json);
let collectedItems = [];
let collectedStrapline;
Function checkA11y
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const checkA11y = () => {
cy.injectAxe();
cy.configureAxe({
runOnly: {
type: 'tag',
Function LinkContents
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const LinkContents = ({ item, isInline = false, id }) => {
const {
translations: { media: mediaTranslations },
} = useContext(ServiceContext);
- 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 LinkedData
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const LinkedData = ({
showAuthor = false,
type,
seoTitle,
headline,
- 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 CurationPromo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const CurationPromo = ({
id,
title,
lastPublished,
imageUrl,
- 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 Byline
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const Byline = ({
blocks,
children = null,
}: PropsWithChildren<OptimoBylineBlock['model']>) => {
const { translations, dir } = useContext(ServiceContext);
- 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 o
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
var o = function() {
function e(e) {
this.method = e.method || "GET",
this.hostname = e.hostname || "localhost",
this.port = e.port,
Function handleServerLogging
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleServerLogging = (ctx: DocumentContext) => {
const url = ctx.asPath || '';
const headers = removeSensitiveHeaders(ctx.req?.headers);
const pageType = derivePageType(url);
const { statusCode } = ctx.res || {};
Function fetchEventHandler
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const fetchEventHandler = async event => {
if (
/^https:\/\/ichef(\.test)?\.bbci\.co\.uk\/(news|images|ace\/(standard|ws))\/.+.webp$/.test(
event.request.url,
)
Function getInitialProps
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
static async getInitialProps(ctx: DocumentContext) {
const url = ctx.asPath || '';
const isApp = isAppPath(url);
const isLite = isLitePath(url);