NatLibFi/marc-record-validators-melinda

View on GitHub

Showing 1,137 of 1,137 total issues

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

      const recordInvalid = new MarcRecord({
        leader: '',
        fields: [
          {
            tag: '760',
Severity: Major
Found in src/ending-punctuation.spec.js and 7 other locations - About 2 hrs to fix
src/ending-punctuation.spec.js on lines 491..505
src/ending-punctuation.spec.js on lines 559..573
src/ending-punctuation.spec.js on lines 648..662
src/ending-punctuation.spec.js on lines 1301..1315
src/ending-punctuation.spec.js on lines 1514..1528
src/ending-punctuation.spec.js on lines 1643..1657
src/ending-punctuation.spec.js on lines 2319..2333

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

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

  function validate(record) {
    const res = {message: []};

    record.fields?.forEach(field => {
      validateField(field, res);
Severity: Major
Found in src/field-505-separators.js and 1 other location - About 2 hrs to fix
src/normalize-qualifying-information.js on lines 23..32

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

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

  function validate(record) {
    const res = {message: []};

    record.fields?.forEach(field => {
      validateField(field, res);
Severity: Major
Found in src/normalize-qualifying-information.js and 1 other location - About 2 hrs to fix
src/field-505-separators.js on lines 22..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 84.

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

      const recordInvalidEndC = new MarcRecord({
        leader: '',
        fields: [
          {
            tag: '260',
Severity: Major
Found in src/ending-punctuation.spec.js and 7 other locations - About 2 hrs to fix
src/ending-punctuation.spec.js on lines 491..505
src/ending-punctuation.spec.js on lines 648..662
src/ending-punctuation.spec.js on lines 1301..1315
src/ending-punctuation.spec.js on lines 1514..1528
src/ending-punctuation.spec.js on lines 1643..1657
src/ending-punctuation.spec.js on lines 2319..2333
src/ending-punctuation.spec.js on lines 2360..2374

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

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

      const recordValidEndC = new MarcRecord({
        leader: '',
        fields: [
          {
            tag: '260',
Severity: Major
Found in src/ending-punctuation.spec.js and 7 other locations - About 2 hrs to fix
src/ending-punctuation.spec.js on lines 559..573
src/ending-punctuation.spec.js on lines 648..662
src/ending-punctuation.spec.js on lines 1301..1315
src/ending-punctuation.spec.js on lines 1514..1528
src/ending-punctuation.spec.js on lines 1643..1657
src/ending-punctuation.spec.js on lines 2319..2333
src/ending-punctuation.spec.js on lines 2360..2374

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

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

      const recordValid647FastEndPunc = new MarcRecord({
        leader: '',
        fields: [
          {
            tag: '647',
Severity: Major
Found in src/ending-punctuation.spec.js and 7 other locations - About 2 hrs to fix
src/ending-punctuation.spec.js on lines 491..505
src/ending-punctuation.spec.js on lines 559..573
src/ending-punctuation.spec.js on lines 648..662
src/ending-punctuation.spec.js on lines 1301..1315
src/ending-punctuation.spec.js on lines 1643..1657
src/ending-punctuation.spec.js on lines 2319..2333
src/ending-punctuation.spec.js on lines 2360..2374

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

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 guessMissingBsForComputerFile has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function guessMissingBsForComputerFile(record) {
    const [field008] = record.get('008');
    const typeOfComputerFile = field008 && field008.value ? field008.value[26] : undefined;

    if (typeOfComputerFile) {
Severity: Major
Found in src/addMissingField336.js - About 2 hrs to fix

    Function mergeRelatorTermFields has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    function mergeRelatorTermFields(record, fix = false) {
      /* eslint-disable */
      // NV: 111/711, 751 and 752 where so rare that I did not add them here
      let fields = record.get('(?:[17][01]0|720)'); 
      let result = [];
    Severity: Minor
    Found in src/mergeRelatorTermFields.js - About 2 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

    Function default has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function (configuration) {
      if (Array.isArray(configuration)) {
        return {
          description:
            'Validates fixed fields',
    Severity: Major
    Found in src/fixed-fields.js - About 2 hrs to fix

      Function default has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function () {
      
        return {
          description: 'Fix deprecated country codes',
          validate, fix
      Severity: Major
      Found in src/fix-country-codes.js - About 2 hrs to fix

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

              const recordValid = new MarcRecord({
                leader: '',
                fields: [
                  {
                    tag: '538',
        Severity: Major
        Found in src/ending-punctuation.spec.js and 1 other location - About 2 hrs to fix
        src/ending-punctuation.spec.js on lines 1317..1331

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

        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 recordInvalidI = new MarcRecord({
                leader: '',
                fields: [
                  {
                    tag: '538',
        Severity: Major
        Found in src/ending-punctuation.spec.js and 1 other location - About 2 hrs to fix
        src/ending-punctuation.spec.js on lines 1238..1252

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

        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

        File removeInferiorDataFields.js has 266 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import createDebugLogger from 'debug';
        import {fieldToChain, sameField} from './removeDuplicateDataFields';
        import {fieldGetOccurrenceNumberPairs, fieldHasValidSubfield6, fieldSevenToOneOccurrenceNumber, fieldsToNormalizedString} from './subfield6Utils';
        import {fieldHasSubfield, fieldsToString, fieldToString, nvdebug, uniqArray} from './utils';
        import {fieldHasValidSubfield8} from './subfield8Utils';
        Severity: Minor
        Found in src/removeInferiorDataFields.js - About 2 hrs to fix

          Function field260To264s has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function field260To264s(field, record) { // might be generic... if so, move to utils...
            // As per my quick reading of usemarcon-cyrillux
            if (field.tag !== '260') {
              return;
            }
          Severity: Major
          Found in src/cyrillux-usemarcon-replacement.js - About 2 hrs to fix

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

                  const recordInvalidCopyrightCExtra = new MarcRecord({
                    leader: '',
                    fields: [
                      {
                        tag: '264',
            Severity: Major
            Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
            src/ending-punctuation.spec.js on lines 524..538
            src/ending-punctuation.spec.js on lines 664..678
            src/ending-punctuation.spec.js on lines 695..709
            src/ending-punctuation.spec.js on lines 735..749
            src/ending-punctuation.spec.js on lines 1254..1268
            src/ending-punctuation.spec.js on lines 1560..1574
            src/ending-punctuation.spec.js on lines 1689..1703
            src/ending-punctuation.spec.js on lines 1892..1906
            src/ending-punctuation.spec.js on lines 1952..1966
            src/ending-punctuation.spec.js on lines 2062..2076
            src/ending-punctuation.spec.js on lines 2122..2136

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

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

                  const recordValid650FinNo = new MarcRecord({
                    leader: '',
                    fields: [
                      {
                        tag: '650',
            Severity: Major
            Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
            src/ending-punctuation.spec.js on lines 524..538
            src/ending-punctuation.spec.js on lines 664..678
            src/ending-punctuation.spec.js on lines 695..709
            src/ending-punctuation.spec.js on lines 735..749
            src/ending-punctuation.spec.js on lines 751..765
            src/ending-punctuation.spec.js on lines 1254..1268
            src/ending-punctuation.spec.js on lines 1689..1703
            src/ending-punctuation.spec.js on lines 1892..1906
            src/ending-punctuation.spec.js on lines 1952..1966
            src/ending-punctuation.spec.js on lines 2062..2076
            src/ending-punctuation.spec.js on lines 2122..2136

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

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

                  const recordValid658EngYes = new MarcRecord({
                    leader: '',
                    fields: [
                      {
                        tag: '658',
            Severity: Major
            Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
            src/ending-punctuation.spec.js on lines 524..538
            src/ending-punctuation.spec.js on lines 664..678
            src/ending-punctuation.spec.js on lines 695..709
            src/ending-punctuation.spec.js on lines 735..749
            src/ending-punctuation.spec.js on lines 751..765
            src/ending-punctuation.spec.js on lines 1254..1268
            src/ending-punctuation.spec.js on lines 1560..1574
            src/ending-punctuation.spec.js on lines 1689..1703
            src/ending-punctuation.spec.js on lines 1892..1906
            src/ending-punctuation.spec.js on lines 2062..2076
            src/ending-punctuation.spec.js on lines 2122..2136

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

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

                  const recordValid655EngYes = new MarcRecord({
                    leader: '',
                    fields: [
                      {
                        tag: '655',
            Severity: Major
            Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
            src/ending-punctuation.spec.js on lines 524..538
            src/ending-punctuation.spec.js on lines 664..678
            src/ending-punctuation.spec.js on lines 695..709
            src/ending-punctuation.spec.js on lines 735..749
            src/ending-punctuation.spec.js on lines 751..765
            src/ending-punctuation.spec.js on lines 1254..1268
            src/ending-punctuation.spec.js on lines 1560..1574
            src/ending-punctuation.spec.js on lines 1689..1703
            src/ending-punctuation.spec.js on lines 1952..1966
            src/ending-punctuation.spec.js on lines 2062..2076
            src/ending-punctuation.spec.js on lines 2122..2136

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

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

                  const recordInvalid650FinYes = new MarcRecord({
                    leader: '',
                    fields: [
                      {
                        tag: '650',
            Severity: Major
            Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
            src/ending-punctuation.spec.js on lines 524..538
            src/ending-punctuation.spec.js on lines 664..678
            src/ending-punctuation.spec.js on lines 695..709
            src/ending-punctuation.spec.js on lines 735..749
            src/ending-punctuation.spec.js on lines 751..765
            src/ending-punctuation.spec.js on lines 1254..1268
            src/ending-punctuation.spec.js on lines 1560..1574
            src/ending-punctuation.spec.js on lines 1892..1906
            src/ending-punctuation.spec.js on lines 1952..1966
            src/ending-punctuation.spec.js on lines 2062..2076
            src/ending-punctuation.spec.js on lines 2122..2136

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

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

                  const recordValidEndB = new MarcRecord({
                    leader: '',
                    fields: [
                      {
                        tag: '260',
            Severity: Major
            Found in src/ending-punctuation.spec.js and 11 other locations - About 2 hrs to fix
            src/ending-punctuation.spec.js on lines 664..678
            src/ending-punctuation.spec.js on lines 695..709
            src/ending-punctuation.spec.js on lines 735..749
            src/ending-punctuation.spec.js on lines 751..765
            src/ending-punctuation.spec.js on lines 1254..1268
            src/ending-punctuation.spec.js on lines 1560..1574
            src/ending-punctuation.spec.js on lines 1689..1703
            src/ending-punctuation.spec.js on lines 1892..1906
            src/ending-punctuation.spec.js on lines 1952..1966
            src/ending-punctuation.spec.js on lines 2062..2076
            src/ending-punctuation.spec.js on lines 2122..2136

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

            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