Showing 2,206 of 2,206 total issues

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

      const { container } = render(
        <Timestamp
          timestamp={defaultTimestamp}
          dateTimeFormat="YYYY-MM-DD"
          format="D MMMM YYYY"
src/app/legacy/psammead/psammead-timestamp-container/src/index.test.jsx on lines 30..40

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 64.

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 2 locations. Consider refactoring.
Open

        expect(winston.transports.File).toHaveBeenCalledWith({
          filename: 'foobarDir/app.log',
          handleExceptions: true,
          humanReadableUnhandledException: true,
          format: 'Combine Mock',
Severity: Major
Found in src/app/lib/logger.node.test.js and 1 other location - About 1 hr to fix
src/app/lib/logger.node.test.js on lines 100..109

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 64.

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 2 locations. Consider refactoring.
Open

  it('should handle 3:45', () => {
    const duration = moment.duration({
      minutes: 3,
      seconds: 45,
    });
Severity: Major
Found in src/app/lib/utilities/formatDuration/index.test.js and 1 other location - About 1 hr to fix
src/app/lib/utilities/formatDuration/index.test.js on lines 15..21

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 64.

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 2 locations. Consider refactoring.
Open

  describe.each(['local', 'test'])(
    `homePage regex on the %s environment`,
    environment => {
      process.env.SIMORGH_APP_ENV = environment;

Severity: Major
Found in src/app/routes/utils/regex/index.test.js and 1 other location - About 1 hr to fix
src/app/routes/utils/regex/index.test.js on lines 572..581

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 64.

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 2 locations. Consider refactoring.
Open

  describe.each(['local', 'test'])(
    `frontPage regex on the %s environment`,
    environment => {
      process.env.SIMORGH_APP_ENV = environment;

Severity: Major
Found in src/app/routes/utils/regex/index.test.js and 1 other location - About 1 hr to fix
src/app/routes/utils/regex/index.test.js on lines 561..570

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 64.

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 2 locations. Consider refactoring.
Open

    const { container } = render(
      <Timestamp
        timestamp={noLeadingZeroTimestamp}
        dateTimeFormat="YYYY-MM-DD"
        format="D MMMM YYYY"
src/app/legacy/psammead/psammead-timestamp-container/src/index.test.jsx on lines 126..136

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 64.

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 2 locations. Consider refactoring.
Open

  it('should handle 23:45', () => {
    const duration = moment.duration({
      minutes: 23,
      seconds: 45,
    });
Severity: Major
Found in src/app/lib/utilities/formatDuration/index.test.js and 1 other location - About 1 hr to fix
src/app/lib/utilities/formatDuration/index.test.js on lines 23..29

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 64.

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 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

      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.]+)/,
      Severity: Minor
      Found in scripts/esmDependencyCheck.js - About 1 hr to fix

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

        test('suffix', () => {
          assert.equal(moment(30000).from(0), 'через несколько секунд', 'prefix');
          assert.equal(moment(0).from(30000), 'несколько секунд назад', 'suffix');
        });
        src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 296..299
        src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 294..297
        src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 184..187
        src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 280..283
        src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 286..293
        src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 283..286
        src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 317..320
        src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 283..290
        src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 290..293
        src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 280..283
        src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 341..344
        src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 249..252
        src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 326..329
        src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 254..257
        src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 284..287

        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 63.

        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 26 locations. Consider refactoring.
        Open

        test('suffix', () => {
          assert.equal(moment(30000).from(0), 'in a few seconds', 'prefix');
          assert.equal(moment(0).from(30000), 'a few seconds ago', 'suffix');
        });
        src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 296..299
        src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 294..297
        src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 184..187
        src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 286..293
        src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 283..286
        src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 317..320
        src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 283..290
        src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 458..461
        src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 290..293
        src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 280..283
        src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 341..344
        src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 249..252
        src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 326..329
        src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 254..257
        src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 284..287

        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 63.

        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 26 locations. Consider refactoring.
        Open

        test('suffix', () => {
          assert.equal(moment(30000).from(0), 'কয়েক সেকেন্ড পরে', 'prefix');
          assert.equal(moment(0).from(30000), 'কয়েক সেকেন্ড আগে', 'suffix');
        });
        src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 296..299
        src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 294..297
        src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 280..283
        src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 286..293
        src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 283..286
        src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 317..320
        src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 283..290
        src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 458..461
        src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 290..293
        src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 280..283
        src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 341..344
        src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 249..252
        src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 326..329
        src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 254..257
        src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 284..287

        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 63.

        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 26 locations. Consider refactoring.
        Open

        test('suffix', () => {
          assert.equal(moment(30000).from(0), 'bir neçə saniyə sonra', 'prefix');
          assert.equal(moment(0).from(30000), 'bir neçə saniyə əvvəl', 'suffix');
        });
        src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 296..299
        src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 184..187
        src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 280..283
        src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 286..293
        src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 283..286
        src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 317..320
        src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 283..290
        src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 458..461
        src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 290..293
        src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 280..283
        src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 341..344
        src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 249..252
        src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 326..329
        src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 254..257
        src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 284..287

        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 63.

        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 26 locations. Consider refactoring.
        Open

        test('suffix', () => {
          assert.equal(moment(30000).from(0), 'за неколико секунди', 'prefix');
          assert.equal(moment(0).from(30000), 'Пре неколико секунди', 'prefix');
        });
        src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 296..299
        src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 294..297
        src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 184..187
        src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 280..283
        src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 286..293
        src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 283..286
        src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 317..320
        src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 283..290
        src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 458..461
        src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 290..293
        src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 280..283
        src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 341..344
        src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 249..252
        src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 326..329
        src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 254..257
        src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 284..287

        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 63.

        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 26 locations. Consider refactoring.
        Open

        test('suffix', () => {
          assert.equal(moment(30000).from(0), 'inside just some seconds', 'prefix');
          assert.equal(
            moment(0).from(30000),
            'just some seconds wey don pass',
        src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 296..299
        src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 294..297
        src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 184..187
        src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 280..283
        src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 286..293
        src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 283..286
        src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 317..320
        src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 458..461
        src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 290..293
        src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 280..283
        src/app/legacy/psammead/psammead-locales/moment/ta.test.js on lines 341..344
        src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 249..252
        src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 326..329
        src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 254..257
        src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 284..287

        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 63.

        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 26 locations. Consider refactoring.
        Open

        test('suffix', () => {
          assert.equal(moment(30000).from(0), 'ஒரு சில விநாடிகள் இல்', 'prefix');
          assert.equal(moment(0).from(30000), 'ஒரு சில விநாடிகள் முன்னர்', 'suffix');
        });
        src/app/legacy/psammead/psammead-locales/moment/ar.test.js on lines 296..299
        src/app/legacy/psammead/psammead-locales/moment/az.test.js on lines 294..297
        src/app/legacy/psammead/psammead-locales/moment/bn.test.js on lines 184..187
        src/app/legacy/psammead/psammead-locales/moment/en-gb.test.js on lines 280..283
        src/app/legacy/psammead/psammead-locales/moment/es.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/gu.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/hi.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/ig.test.js on lines 286..293
        src/app/legacy/psammead/psammead-locales/moment/ky.test.js on lines 283..286
        src/app/legacy/psammead/psammead-locales/moment/mr.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/ne.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/pa-in.test.js on lines 317..320
        src/app/legacy/psammead/psammead-locales/moment/pcm.test.js on lines 283..290
        src/app/legacy/psammead/psammead-locales/moment/pt-br.test.js on lines 284..287
        src/app/legacy/psammead/psammead-locales/moment/ru.test.js on lines 458..461
        src/app/legacy/psammead/psammead-locales/moment/si.test.js on lines 290..293
        src/app/legacy/psammead/psammead-locales/moment/sr-cyrl.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/sr.test.js on lines 285..288
        src/app/legacy/psammead/psammead-locales/moment/sw.test.js on lines 280..283
        src/app/legacy/psammead/psammead-locales/moment/th.test.js on lines 249..252
        src/app/legacy/psammead/psammead-locales/moment/uk.test.js on lines 326..329
        src/app/legacy/psammead/psammead-locales/moment/ur.test.js on lines 254..257
        src/app/legacy/psammead/psammead-locales/moment/uz.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/yo.test.js on lines 287..290
        src/app/legacy/psammead/psammead-locales/moment/zh-tw.test.js on lines 284..287

        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 63.

        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