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,
Severity: Minor
Found in public/vendor/cwr.js - About 1 hr to fix

    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,
    Severity: Minor
    Found in public/vendor/cwr.js - About 1 hr to fix

      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,
      Severity: Minor
      Found in public/vendor/cwr.js - About 1 hr to fix

        Function Brand has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const Brand = forwardRef((props, ref) => {
          const {
            svgHeight,
            maxWidth,
            minWidth,
        Severity: Minor
        Found in src/app/legacy/psammead/psammead-brand/src/index.jsx - About 1 hr to fix

          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)) {
          Severity: Minor
          Found in src/app/hooks/useImageColour/colorthief.js - About 1 hr 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

          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,
          Severity: Minor
          Found in public/vendor/cwr.js - About 1 hr to fix

            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,
            Severity: Minor
            Found in public/vendor/cwr.js - About 1 hr to fix

              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))
              Severity: Minor
              Found in public/vendor/cwr.js - About 1 hr to fix

                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)) {
                Severity: Minor
                Found in src/app/hooks/useImageColour/colorthief.js - About 1 hr to fix

                  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,
                    Severity: Minor
                    Found in src/app/legacy/psammead/psammead-image/src/index.jsx - About 1 hr to fix

                      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 {
                      Severity: Minor
                      Found in src/app/components/FrostedGlassPromo/withData.tsx - About 1 hr to fix

                        Function getServerSideProps has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const getServerSideProps: GetServerSideProps = async context => {
                          logResponseTime(
                            {
                              path: context.resolvedUrl,
                            },
                        Severity: Minor
                        Found in ws-nextjs-app/pages/[service]/downloads/[[...variant]].page.tsx - About 1 hr to fix

                          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',
                            );
                          
                          
                          Severity: Minor
                          Found in src/app/components/Byline/utilities/getAuthorTwitterHandle/index.js - About 1 hr to fix

                            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[];
                            Severity: Minor
                            Found in ws-nextjs-app/pages/[service]/send/[id]/FormField/File/index.tsx - About 1 hr to fix

                              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 = {};
                              Severity: Minor
                              Found in public/vendor/cwr.js - About 1 hr to fix

                                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,
                                Severity: Minor
                                Found in src/app/components/FrostedGlassPromo/withData.tsx - About 1 hr to fix

                                  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;

                                  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;
                                  Severity: Minor
                                  Found in src/app/legacy/containers/SocialEmbed/index.jsx - About 1 hr 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

                                  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);
                                  
                                  
                                  Severity: Minor
                                  Found in src/app/components/MediaLoader/utils/urlConstructors.ts - About 1 hr 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language