Showing 2,206 of 2,206 total issues

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

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            const { container, getByText } = render(
              <TestComponent hookProps={defaultProps} />,
              {
                atiData: undefined,
                pageData: undefined,
        Severity: Major
        Found in src/app/hooks/useClickTrackerHandler/index.test.jsx and 3 other locations - About 1 hr to fix
        src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 446..456
        src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 492..502
        src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 517..527

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 67.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            const { container, getByText } = render(
              <TestComponent hookProps={trackingData} />,
              {
                atiData: atiAnalytics,
                pageData: pidginData,
        Severity: Major
        Found in src/app/hooks/useClickTrackerHandler/index.test.jsx and 3 other locations - About 1 hr to fix
        src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 446..456
        src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 465..475
        src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 492..502

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 67.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        const urlToObject = url => {
          const { origin, pathname, searchParams } = new URL(url);
        
          return {
            origin,
        Severity: Major
        Found in src/app/hooks/useViewTracker/index.test.jsx and 1 other location - About 1 hr to fix
        src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 23..31

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 67.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        const getBlockByType = (blocks, blockType) => {
          let blockData;
          blocks.forEach(block => {
            if (!blockData && block.type === blockType) {
              blockData = block;
        Severity: Major
        Found in src/app/legacy/containers/StoryPromo/index.jsx and 1 other location - About 1 hr to fix
        cypress/e2e/pages/articles/helpers.js on lines 3..12

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 67.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            const { container, getByText } = render(
              <TestComponent hookProps={trackingData} />,
              {
                atiData: atiAnalytics,
                pageData: pidginData,
        Severity: Major
        Found in src/app/hooks/useClickTrackerHandler/index.test.jsx and 3 other locations - About 1 hr to fix
        src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 446..456
        src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 465..475
        src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 517..527

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 67.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

            const { container, getByText } = render(
              <TestComponent hookProps={undefined} />,
              {
                atiData: atiAnalytics,
                pageData: pidginData,
        Severity: Major
        Found in src/app/hooks/useClickTrackerHandler/index.test.jsx and 3 other locations - About 1 hr to fix
        src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 465..475
        src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 492..502
        src/app/hooks/useClickTrackerHandler/index.test.jsx on lines 517..527

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 67.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        const urlToObject = url => {
          const { origin, pathname, searchParams } = new URL(url);
        
          return {
            origin,
        Severity: Major
        Found in src/app/hooks/useClickTrackerHandler/index.test.jsx and 1 other location - About 1 hr to fix
        src/app/hooks/useViewTracker/index.test.jsx on lines 77..85

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 67.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        export const getBlockByType = (blocks, blockType) => {
          let blockData;
        
          blocks.forEach(block => {
            if (!blockData && block.type === blockType) {
        Severity: Major
        Found in cypress/e2e/pages/articles/helpers.js and 1 other location - About 1 hr to fix
        src/app/legacy/containers/StoryPromo/index.jsx on lines 56..64

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 67.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

          it('should render video indicator correctly', () => {
            const { container } = render(
              <MediaIndicator type="video" script={latin} service="news" />,
            );
            expect(container).toMatchSnapshot();
        src/app/legacy/psammead/psammead-media-indicator/src/index.test.jsx on lines 43..48
        src/app/legacy/psammead/psammead-media-indicator/src/index.test.jsx on lines 50..55

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 67.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

          it('should render audio indicator correctly', () => {
            const { container } = render(
              <MediaIndicator type="audio" script={latin} service="news" />,
            );
            expect(container).toMatchSnapshot();
        src/app/legacy/psammead/psammead-media-indicator/src/index.test.jsx on lines 16..21
        src/app/legacy/psammead/psammead-media-indicator/src/index.test.jsx on lines 50..55

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 67.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

          it('should render photogallery correctly', () => {
            const { container } = render(
              <MediaIndicator type="photogallery" script={latin} service="news" />,
            );
            expect(container).toMatchSnapshot();
        src/app/legacy/psammead/psammead-media-indicator/src/index.test.jsx on lines 16..21
        src/app/legacy/psammead/psammead-media-indicator/src/index.test.jsx on lines 43..48

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 67.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        const optimizely = {
          onReady: jest.fn(() => Promise.resolve()),
          track: jest.fn(),
          setUser: jest.fn(() => Promise.resolve()),
        };
        src/app/legacy/containers/OptimizelyPageViewTracking/index.test.jsx on lines 13..17

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 66.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 5 locations. Consider refactoring.
        Open

          describe('with no data', () => {
            it('should return the errorMain component and 500 status', () => {
              const { container } = render(<WithDataHOC {...noDataProps} />);
        
              expect(container).toMatchSnapshot();
        src/app/legacy/containers/PageHandlers/withData/index.test.jsx on lines 66..71
        src/app/legacy/containers/PageHandlers/withData/index.test.jsx on lines 79..84
        src/app/legacy/containers/PageHandlers/withData/index.test.jsx on lines 87..92
        src/app/legacy/containers/PageHandlers/withData/index.test.jsx on lines 94..99

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 66.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 5 locations. Consider refactoring.
        Open

            describe('but different home service other than locale service', () => {
              it('should return the errorMain component', () => {
                const { container } = render(<WithDataHOC {...validPersianProps} />);
                expect(container).toMatchSnapshot();
              });
        src/app/legacy/containers/PageHandlers/withData/index.test.jsx on lines 58..64
        src/app/legacy/containers/PageHandlers/withData/index.test.jsx on lines 66..71
        src/app/legacy/containers/PageHandlers/withData/index.test.jsx on lines 87..92
        src/app/legacy/containers/PageHandlers/withData/index.test.jsx on lines 94..99

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 66.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        const loadCerts = ({ caPath, certChainPath, keyPath }) =>
          Promise.all([
            fsPromises.readFile(caPath, 'UTF-8'),
            fsPromises.readFile(certChainPath, 'UTF-8'),
            fsPromises.readFile(keyPath, 'UTF-8'),
        Severity: Major
        Found in scripts/mostReadCollectionTimes.js and 1 other location - About 1 hr to fix
        scripts/mostReadAndWatchedCollectionData.js on lines 23..28

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 66.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 5 locations. Consider refactoring.
        Open

          describe('with valid front-pages data', () => {
            it('should return the passed in component', () => {
              const { container } = render(<WithDataHOC {...validFrontPagesProps} />);
              expect(container).toMatchSnapshot();
            });
        src/app/legacy/containers/PageHandlers/withData/index.test.jsx on lines 58..64
        src/app/legacy/containers/PageHandlers/withData/index.test.jsx on lines 66..71
        src/app/legacy/containers/PageHandlers/withData/index.test.jsx on lines 79..84
        src/app/legacy/containers/PageHandlers/withData/index.test.jsx on lines 94..99

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 66.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language