Showing 390 of 2,206 total issues

File index.ts has 313 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { getEnvConfig } from '#app/lib/utilities/getEnvConfig';
import {
  getDestination,
  getAppType,
  getScreenInfo,
Severity: Minor
Found in src/app/components/ATIAnalytics/atiUrl/index.ts - About 3 hrs to fix

    Function Et has 87 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                }, St = "CWR: Cannot dispatch; no AWS credentials.", Et = function() {
                    function e(e, t, n, r) {
                        var o = this;
                        this.dispatchFetch = function() {
                            return wt(o, void 0, void 0, (function() {
    Severity: Major
    Found in public/vendor/cwr.js - About 3 hrs to fix

      Function le has 86 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  }, ae = n(238), ce = "00000000-0000-0000-0000-000000000000", ue = "unknown", le = function() {
                      function e(e, t, n, r) {
                          this.appMonitorDetails = e,
                          this.config = t,
                          this.record = n,
      Severity: Major
      Found in public/vendor/cwr.js - About 3 hrs to fix

        File index.test.jsx has 310 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from 'react';
        import { BrowserRouter } from 'react-router-dom';
        import { suppressPropWarnings } from '#psammead/psammead-test-helpers/src';
        import { data as mundoBannerVariations } from '#data/mundo/topics/cw90edn9kw4t.json';
        import {
        Severity: Minor
        Found in src/app/pages/TopicPage/index.test.jsx - About 3 hrs to fix

          Function buildSections has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          export const buildSections = ({
            service,
            pageType,
            sectionName,
            categoryName,
          Severity: Minor
          Found in src/app/components/ChartbeatAnalytics/utils/index.ts - About 3 hrs to fix

          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

          File index.jsx has 309 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from 'react';
          import styled from '@emotion/styled';
          import {
            GEL_MARGIN_BELOW_400PX,
            GEL_GUTTER_BELOW_600PX,
          Severity: Minor
          Found in src/app/legacy/psammead/psammead-grid/src/index.jsx - About 3 hrs to fix

            Function load has 84 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                            return e.prototype.load = function(e) {
                                var t = this;
                                this.recordEvent = e.record,
                                function(e, t) {
                                    var n,
            Severity: Major
            Found in public/vendor/cwr.js - About 3 hrs to fix

              File withThemeProvider.tsx has 306 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { useContext } from 'react';
              import {
                Global,
                ThemeProvider as EmotionThemeProvider,
                Theme,
              Severity: Minor
              Found in src/app/components/ThemeProvider/withThemeProvider.tsx - About 3 hrs to fix

                Function getTranslations has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const getTranslations = (
                  provider: ConsentBannerProviders,
                  translations: Translations,
                  externalLinkText: string,
                ) => {
                Severity: Major
                Found in src/app/components/EmbedConsentBanner/ConsentBanner.tsx - About 3 hrs to fix

                  Function 914 has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              914: function(e, t, n) {
                                  "use strict";
                                  Object.defineProperty(t, "__esModule", {
                                      value: !0
                                  }),
                  Severity: Major
                  Found in public/vendor/cwr.js - About 3 hrs to fix

                    Function ArticlePage has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const ArticlePage = ({ pageData }: { pageData: Article }) => {
                      const { isApp, pageType, service, isAmp, id } = useContext(RequestContext);
                    
                      const {
                        articleAuthor,
                    Severity: Minor
                    Found in src/app/pages/ArticlePage/ArticlePage.tsx - About 3 hrs to fix

                    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

                    File index.jsx has 302 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* eslint-disable camelcase */
                    import express from 'express';
                    import compression from 'compression';
                    import ramdaPath from 'ramda/src/path';
                    import omit from 'ramda/src/omit';
                    Severity: Minor
                    Found in src/server/index.jsx - About 3 hrs to fix

                      Function P has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  P = function() {
                                      function e(e) {
                                          var t = this;
                                          this.ChainAnonymousCredentialsProvider = function() {
                                              return _(t, void 0, void 0, (function() {
                      Severity: Major
                      Found in public/vendor/cwr.js - About 3 hrs to fix

                        Function p has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                for (var p = function() {
                                        function t(e) {
                                            var t = (void 0 === e ? {} : e).requestTimeout;
                                            this.requestTimeout = t
                                        }
                        Severity: Major
                        Found in public/vendor/cwr.js - About 3 hrs to fix

                          File index.test.tsx has 298 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import React from 'react';
                          import {
                            act,
                            render,
                          } from '#app/components/react-testing-library-with-providers';
                          Severity: Minor
                          Found in ws-nextjs-app/pages/[service]/send/[id]/FormField/index.test.tsx - About 3 hrs to fix

                            Function presign has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                            return e.prototype.presign = function(e, t) {
                                                return void 0 === t && (t = {}), be(this, void 0, void 0, (function() {
                                                    var n,
                                                        r,
                                                        o,
                            Severity: Major
                            Found in public/vendor/cwr.js - About 3 hrs to fix

                              Function setupNodeEvents has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  setupNodeEvents(on, config) {
                                    if (!config.env.APP_ENV) {
                                      config.env.APP_ENV = 'local';
                                    }
                              
                              
                              Severity: Major
                              Found in cypress.config.ts - About 3 hrs to fix

                                Function snapshotTests has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const snapshotTests = (Component, additionalProps) => {
                                  shouldMatchSnapshot(
                                    'should render landscape image correctly',
                                    <Component
                                      alt={landscape.alt}

                                  Function generateLaunchDates has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const generateLaunchDates = service => {
                                    const output = [];
                                    const serviceLaunch = launchDates[service];
                                  
                                    if (serviceLaunch) {
                                  Severity: Minor
                                  Found in scripts/releaseInfo/index.js - About 3 hrs to fix

                                  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

                                  File index.test.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  /* eslint-disable global-require */
                                  import {
                                    renderHook,
                                    act,
                                  } from '#app/components/react-testing-library-with-providers';
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language