Showing 390 of 2,206 total issues
Function Ve
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Ve = function(e, t) {
var n = e.headers,
r = e.body;
return be(void 0, void 0, void 0, (function() {
var e,
Function e
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function e(e, t, n, r) {
void 0 === r && (r = {}),
void 0 === n && (n = "us-west-2");
var o = An(An({}, {
unique: !1,
Function createCanonicalRequest
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
}, e.prototype.createCanonicalRequest = function(e, t, n) {
var r = Object.keys(t).sort();
return e.method + "\n" + this.getCanonicalPath(e) + "\n" + function(e) {
var t,
n,
Function Brand
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Brand = forwardRef((props, ref) => {
const {
svgHeight,
maxWidth,
minWidth,
Function getPalette
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
(o.prototype.getPalette = function (t, o, e) {
var i = (function (t) {
var r = t.colorCount,
n = t.quality;
if (void 0 !== r && Number.isInteger(r)) {
- 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 x
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
x = function(e) {
var t = this;
this.assumeRoleWithWebIdentity = function(e) {
return E(t, void 0, void 0, (function() {
var t,
Function performanceNavigationEventHandlerTimingLevel2
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.performanceNavigationEventHandlerTimingLevel2 = function(t) {
var n = {
version: "1.0.0",
initiatorType: t.initiatorType,
navigationType: t.type,
Function Z
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Z = function() {
function e(e) {
var t = this;
this.eventHandler = function(e) {
t.recordEvent(q, V(e, t.config.stackTraceLength))
Function getPalette
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
(o.prototype.getPalette = function (t, o, e) {
var i = (function (t) {
var r = t.colorCount,
n = t.quality;
if (void 0 !== r && Number.isInteger(r)) {
Function withOptimizelyProvider
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const withOptimizelyProvider = Component => {
return props => {
const { service } = useContext(ServiceContext);
const isStoryBook = process.env.STORYBOOK;
const disableOptimizely = isStoryBook;
Function Img
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Img = props => {
const {
src,
srcset = null,
sizes = null,
Function buildImageProperties
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const buildImageProperties = (imageProps?: ImageProps) => {
const image =
imageProps?.path || imageProps?.locator ? imageProps : defaultImageProps;
const {
Function getServerSideProps
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getServerSideProps: GetServerSideProps = async context => {
logResponseTime(
{
path: context.resolvedUrl,
},
Function getAuthorTwitterHandle
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getAuthorTwitterHandle = articleContentBlocks => {
const [firstByline, ...otherBylines] = articleContentBlocks.filter(
block => block.type === 'byline',
);
Function handleFileChange
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleFileChange = (event: ChangeEvent<HTMLInputElement>) => {
// Converts FileList to an actual array
const chosenFiles = Array.prototype.slice.call(
event.target.files,
) as File[];
Function y
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
y = [fetch(v).then((function(t) {
var n,
r,
o = t.headers,
i = {};
Function optimoPromoFormatter
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const optimoPromoFormatter = (props: PromoProps): FormattedPromo => {
const defaultPromoImage = pathOr<OptimoBlock[]>(
[],
['item', 'images', 'defaultPromoImage', 'blocks'],
props,
Function filterUnknownContentTypes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const filterUnknownContentTypes = data => {
const groups = pathOr(null, ['content', 'groups'], data);
if (!groups) {
return data;
- 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 SocialEmbedContainer
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const SocialEmbedContainer = ({ blocks, source }) => {
const { isAmp, isLite, pageType } = useContext(RequestContext);
const { service, 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 getExternalEmbedUrl
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const getExternalEmbedUrl = ({ 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"