NatLibFi/marc-record-js

View on GitHub

Showing 87 of 87 total issues

File utils.spec.js has 522 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable max-lines */
import {expect} from 'chai';
import * as Utils from './utils';

describe('utils', () => {
Severity: Major
Found in src/utils.spec.js - About 1 day to fix

    Function doTest has 203 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function doTest(metadata) {
    
        // Get input & expected output
        const {getFixture} = metadata;
        const {input, result, immutable, noinput, validationOptions} = metadata;
    Severity: Major
    Found in src/index.spec.js - About 1 day to fix

      Function runOperation has 162 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function runOperation(op) {
            const {name, args} = op;
      
            //-------------------------------------------------------------------------
            if (name === 'nop') {
      Severity: Major
      Found in src/index.spec.js - About 6 hrs to fix

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

                it('Should consider the field invalid (subfield with empty value), subieldValues: true', () => {
                  const field = {'tag': 'CAT', 'ind1': ' ', 'ind2': ' ', 'subfields': [{'code': 'b', 'value': ''}, {'code': 'c', 'value': '20150121'}]};
        
                  try {
                    Utils.validateField(field, {subfieldValues: true});
        Severity: Major
        Found in src/utils.spec.js and 3 other locations - About 5 hrs to fix
        src/utils.spec.js on lines 432..444
        src/utils.spec.js on lines 466..478
        src/utils.spec.js on lines 486..498

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

        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

                it('Should consider the field invalid (subfield with empty code), characters: true', () => {
                  const field = {'tag': 'CAT', 'ind1': ' ', 'ind2': ' ', 'subfields': [{'code': ' ', 'value': 'foo'}, {'code': 'c', 'value': '20150121'}]};
        
                  try {
                    Utils.validateField(field, {characters: true});
        Severity: Major
        Found in src/utils.spec.js and 3 other locations - About 5 hrs to fix
        src/utils.spec.js on lines 466..478
        src/utils.spec.js on lines 486..498
        src/utils.spec.js on lines 510..522

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

        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

                it('Should consider the field invalid (subfield with non-ASCII code), characters: true', () => {
                  const field = {'tag': 'CAT', 'ind1': ' ', 'ind2': ' ', 'subfields': [{'code': 'Ä', 'value': 'foo'}, {'code': 'c', 'value': '20150121'}]};
        
                  try {
                    Utils.validateField(field, {characters: true});
        Severity: Major
        Found in src/utils.spec.js and 3 other locations - About 5 hrs to fix
        src/utils.spec.js on lines 432..444
        src/utils.spec.js on lines 466..478
        src/utils.spec.js on lines 510..522

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

        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

                it('Should consider the field invalid (subfield with uppercase code), characters: true', () => {
                  const field = {'tag': 'CAT', 'ind1': ' ', 'ind2': ' ', 'subfields': [{'code': 'A', 'value': 'foo'}, {'code': 'c', 'value': '20150121'}]};
        
                  try {
                    Utils.validateField(field, {characters: true});
        Severity: Major
        Found in src/utils.spec.js and 3 other locations - About 5 hrs to fix
        src/utils.spec.js on lines 432..444
        src/utils.spec.js on lines 486..498
        src/utils.spec.js on lines 510..522

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

        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

              it('Should consider the field invalid (tag with mixed case characters), characters: true', () => {
                const field = {'tag': 'AaA', 'ind1': ' ', 'ind2': ' ', 'subfields': [{'code': 'c', 'value': '20150121'}]};
        
                try {
                  Utils.validateField(field, {characters: true});
        Severity: Major
        Found in src/utils.spec.js and 4 other locations - About 5 hrs to fix
        src/utils.spec.js on lines 341..353
        src/utils.spec.js on lines 383..395
        src/utils.spec.js on lines 631..643
        src/utils.spec.js on lines 652..664

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

        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

              it('Should consider the field invalid (non-ASCII indicator), characters: true', () => {
                const field = {'tag': 'CAT', 'ind1': 'Ä', 'ind2': ' ', 'subfields': [{'code': 'c', 'value': '20150121'}]};
        
                try {
                  Utils.validateField(field, {characters: true});
        Severity: Major
        Found in src/utils.spec.js and 4 other locations - About 5 hrs to fix
        src/utils.spec.js on lines 341..353
        src/utils.spec.js on lines 361..373
        src/utils.spec.js on lines 383..395
        src/utils.spec.js on lines 631..643

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

        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

              it('Should consider the field invalid (tag with non-alphanumeric character), characters: true', () => {
                const field = {'tag': '#44', 'ind1': ' ', 'ind2': ' ', 'subfields': [{'code': 'c', 'value': '20150121'}]};
        
                try {
                  Utils.validateField(field, {characters: true});
        Severity: Major
        Found in src/utils.spec.js and 4 other locations - About 5 hrs to fix
        src/utils.spec.js on lines 361..373
        src/utils.spec.js on lines 383..395
        src/utils.spec.js on lines 631..643
        src/utils.spec.js on lines 652..664

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

        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

              it('Should consider the field invalid (non alpha-numeric/blank indicator), characters: true', () => {
                const field = {'tag': 'CAT', 'ind1': '#', 'ind2': ' ', 'subfields': [{'code': 'c', 'value': '20150121'}]};
        
                try {
                  Utils.validateField(field, {characters: true});
        Severity: Major
        Found in src/utils.spec.js and 4 other locations - About 5 hrs to fix
        src/utils.spec.js on lines 341..353
        src/utils.spec.js on lines 361..373
        src/utils.spec.js on lines 383..395
        src/utils.spec.js on lines 652..664

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

        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

              it('Should consider the field invalid (tag with non-ASCII characters), characters: true', () => {
                const field = {'tag': 'ÄÄÄ', 'ind1': ' ', 'ind2': ' ', 'subfields': [{'code': 'c', 'value': '20150121'}]};
        
                try {
                  Utils.validateField(field, {characters: true});
        Severity: Major
        Found in src/utils.spec.js and 4 other locations - About 5 hrs to fix
        src/utils.spec.js on lines 341..353
        src/utils.spec.js on lines 361..373
        src/utils.spec.js on lines 631..643
        src/utils.spec.js on lines 652..664

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

        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

              it('Should consider the field invalid (2 character tag)', () => {
                const field = {'tag': '44', 'ind1': ' ', 'ind2': ' ', 'subfields': [{'code': 'c', 'value': '20150121'}]};
        
                try {
                  Utils.validateField(field);
        Severity: Major
        Found in src/utils.spec.js and 3 other locations - About 4 hrs to fix
        src/utils.spec.js on lines 327..339
        src/utils.spec.js on lines 579..591
        src/utils.spec.js on lines 703..715

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

        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

              it('Should consider the field invalid (empty indicator)', () => {
                const field = {'tag': 'CAT', 'ind1': ' ', 'ind2': '', 'subfields': [{'code': 'c', 'value': '20150121'}]};
        
                try {
                  Utils.validateField(field);
        Severity: Major
        Found in src/utils.spec.js and 3 other locations - About 4 hrs to fix
        src/utils.spec.js on lines 313..325
        src/utils.spec.js on lines 327..339
        src/utils.spec.js on lines 703..715

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

        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

              it('Should consider the field invalid (empty tag)', () => {
                const field = {'tag': '', 'ind1': ' ', 'ind2': ' ', 'subfields': [{'code': 'c', 'value': '20150121'}]};
        
                try {
                  Utils.validateField(field);
        Severity: Major
        Found in src/utils.spec.js and 3 other locations - About 4 hrs to fix
        src/utils.spec.js on lines 313..325
        src/utils.spec.js on lines 579..591
        src/utils.spec.js on lines 703..715

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

        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

              it('Should consider datafield with too long subfield value (>9999 chars) invalid', () => {
                const field = {'tag': 'CAT', 'ind1': ' ', 'ind2': ' ', 'subfields': [{'code': 'c', 'value': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut aliquam consequat sem finibus volutpat. Pellentesque eu auctor elit, sit amet hendrerit tortor. Cras finibus risus sed arcu ullamcorper, quis semper nibh facilisis. Quisque auctor molestie aliquam. Fusce ornare, metus sed rhoncus sodales, risus lectus auctor velit, ut suscipit tortor augue eget risus. Aliquam in tempus augue. Nam metus erat, vulputate eu nunc vel, tempor dignissim orci. In aliquet vel tellus eu interdum. Mauris vitae ultrices urna. Curabitur tempus lorem ac convallis vehicula. Aliquam bibendum efficitur tellus. Curabitur eu odio tristique, mollis dui ac, vehicula nulla. Proin quis nisi justo. Nunc pellentesque, lorem in auctor malesuada, mauris ex rhoncus est, in lobortis felis risus eu eros. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur tincidunt rhoncus velit, vitae egestas magna dapibus ut. Vestibulum feugiat odio eu nulla sagittis, sit amet hendrerit enim molestie. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Suspendisse non rutrum nibh. Vivamus ullamcorper vel turpis dapibus tempus. Phasellus porta ac quam at gravida. Maecenas luctus arcu tortor, ac interdum purus congue a. Mauris lobortis aliquam risus euismod volutpat. Fusce eu nibh dignissim, elementum est vitae, convallis felis. Quisque ut faucibus sem. Proin mattis tortor sit amet auctor pharetra. Etiam et mollis dolor, in posuere tellus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque laoreet hendrerit tortor sit amet porta. Donec lobortis ex sit amet posuere porta. Integer eu est ipsum. Nam laoreet tristique mi, vulputate fermentum purus pellentesque in. Mauris auctor aliquam nunc, ut iaculis tortor maximus vehicula. Nunc id cursus eros. Nam a aliquet ligula. Aliquam tempus tincidunt risus, et semper mi aliquet quis. Interdum et malesuada fames ac ante ipsum primis in faucibus. Morbi rhoncus, arcu nec vulputate placerat, magna nibh ullamcorper ipsum, nec cursus nisl tellus vitae felis. Pellentesque justo dolor, ultricies sed leo nec, condimentum pretium odio. Ut sem diam, feugiat a faucibus quis, molestie eget quam. In tempus et tortor a accumsan. Integer condimentum sapien in elementum pharetra. Proin interdum velit orci, quis facilisis mauris tincidunt eget. Morbi eu ante at nulla vulputate elementum. Phasellus sollicitudin sollicitudin laoreet. Mauris ultrices eros vitae mi vehicula pharetra. Mauris consectetur turpis ultrices blandit feugiat. Etiam id viverra metus. In convallis semper ipsum ut ullamcorper. Mauris vel dictum odio. Mauris commodo odio id dui scelerisque commodo. Sed ipsum turpis, ultricies ut nisl eget, tempus lacinia felis. Maecenas pharetra facilisis quam ac sodales. Ut sed erat pellentesque, ornare elit in, vehicula elit. Sed varius lectus justo. Suspendisse sit amet mi ligula. Vestibulum sollicitudin massa eget placerat accumsan. Donec a orci ut quam lobortis viverra. Curabitur ut egestas mi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nunc tellus tortor, tristique eu iaculis sed, pretium at leo. Vivamus porta imperdiet ex, ac tempus diam lacinia ut. Suspendisse accumsan quam mi, et eleifend metus tristique pretium. Quisque vulputate nisi quis augue pulvinar ultricies. Mauris vestibulum dictum condimentum. Nullam sit amet vulputate turpis. Vivamus a nibh fermentum, porta lacus non, sollicitudin orci. Quisque sed nulla in nulla porta ornare. Sed scelerisque mauris ac libero mattis commodo. Pellentesque nulla enim, dignissim in sodales sit amet, lacinia in eros. Integer pulvinar sapien ac sapien varius, in gravida velit sodales. Donec facilisis placerat mattis. Sed arcu dui, porta eu pretium imperdiet, porttitor eget ante. Integer varius tortor efficitur, eleifend est quis, congue dolor. Integer pulvinar urna massa, ut mollis risus condimentum quis. Suspendisse lobortis ipsum eleifend lectus pellentesque, ac ullamcorper turpis efficitur. In quis venenatis risus. Quisque interdum suscipit eros, et faucibus nulla. Fusce quis blandit nibh. Morbi aliquam convallis leo, eu maximus odio elementum quis. Aenean at neque neque. Praesent gravida nisi ex, a vulputate libero ultricies eu. Nam mi purus, semper sed elementum eget, sodales at ex. Maecenas tincidunt ligula vitae accumsan pretium. Aenean sed porta justo. Fusce mollis nec metus a sagittis. Etiam ultricies augue id lorem maximus, rhoncus mollis risus sollicitudin. Donec vel ligula nec turpis volutpat tristique sed a diam. Proin dapibus, nisl vitae elementum ultricies, ligula lectus egestas massa, ut viverra metus velit at ligula. Nunc posuere nec neque in mollis. Nulla sed blandit sapien. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non felis ut ante iaculis vestibulum. Integer suscipit arcu lectus, imperdiet imperdiet enim vehicula a. Suspendisse sit amet nibh egestas, rutrum turpis non, interdum massa. Nulla vitae ullamcorper arcu, sed dictum magna. Pellentesque vitae velit nibh. Aenean eget elit a turpis dignissim dignissim. Vestibulum et tincidunt dui, nec tincidunt dui. Morbi tristique eget felis quis dictum. Proin molestie scelerisque volutpat. Maecenas et quam id orci commodo sodales in nec urna. Vivamus eu convallis enim. Ut at convallis ex, ac accumsan arcu. Ut consequat pharetra nisl eu malesuada. Donec lobortis mauris in metus consectetur interdum. Morbi quis elementum odio. Praesent commodo elit luctus convallis consequat. Aliquam venenatis aliquam ex, ut pellentesque nisl pharetra vitae. Etiam ac interdum velit, vitae finibus nunc. Nunc enim ligula, malesuada at turpis a, congue suscipit metus. Quisque auctor nec ipsum ut malesuada. Sed in ligula vel leo cursus venenatis in eu diam. Nullam vehicula, mauris eget laoreet mattis, justo urna interdum mauris, a scelerisque enim dolor non ante. Cras rutrum mattis neque non fringilla. Phasellus nec diam lobortis, fringilla sem vitae, pharetra metus. In hac habitasse platea dictumst. Integer elementum elit felis, sit amet mattis urna tristique in. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Duis ullamcorper vulputate mauris, vitae vestibulum nisi ornare non. Quisque non ornare erat. Donec viverra, purus vel vulputate facilisis, risus velit semper tellus, sed mattis elit nibh et felis. Quisque egestas risus turpis, in imperdiet dolor malesuada ac. Interdum et malesuada fames ac ante ipsum primis in faucibus. Suspendisse potenti. Sed ullamcorper eget est vitae lacinia. Proin lacinia lacus est, ac aliquam nisi posuere non. Aliquam risus ex, dictum ut ante quis, rutrum molestie libero. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Cras condimentum mauris quis quam bibendum, id accumsan lorem vehicula. Sed vehicula mauris leo, ac varius lorem hendrerit at. Mauris orci elit, volutpat quis commodo at, ultrices sed est. Ut feugiat urna tortor, vel aliquam turpis luctus a. Aliquam posuere non nisl sed efficitur. Vestibulum tempus magna id massa sollicitudin, ac cursus ligula varius. Aliquam iaculis orci nec malesuada ornare. Praesent placerat nisl sed nulla pulvinar tincidunt in nec felis. Aenean sollicitudin viverra pellentesque. Pellentesque semper purus vel mi dictum, pretium ullamcorper purus congue. Fusce nec euismod augue. Duis at libero sollicitudin, cursus erat sit amet, facilisis ipsum. Aliquam varius rutrum felis et elementum. Fusce ipsum justo, feugiat sed elit eu, pretium luctus tortor. Sed ex ante, fringilla id tincidunt non, malesuada a neque. In mattis urna ut nunc gravida, ut efficitur magna laoreet. Sed tellus risus, posuere vitae sollicitudin quis, pretium quis leo. Proin eleifend commodo nulla, a consectetur est iaculis in. Nulla scelerisque pharetra mauris, vel dapibus mi convallis sit amet. Mauris tincidunt ipsum in lorem mattis accumsan sed sed purus. Maecenas tristique sit amet nunc in placerat. Vestibulum nisl diam, interdum non lacus et, ullamcorper imperdiet orci. Donec mattis nunc sit amet elit porttitor, eget convallis magna lobortis. Vestibulum nec libero at libero molestie eleifend vitae eu metus.  In hac habitasse platea dictumst. Nulla ex nulla, sagittis eget porttitor ut, tincidunt quis ante. Nam quis tortor elit. Vestibulum in urna odio. Sed cursus nisi sit amet turpis rhoncus, ac consectetur magna condimentum. Nullam aliquam, nisl vitae consectetur varius, felis augue convallis felis, vel porta ipsum nibh eu lacus. Maecenas in porta nibh, congue ultrices turpis. Suspendisse elit sapien, finibus sed feugiat in, malesuada at magna. Morbi nec mi vel nisl imperdiet dictum. Sed ut ante pharetra eros finibus luctus vitae sed sapien. Quisque non lacus eu lacus vehicula lacinia et sit amet ex. Pellentesque eget turpis et tortor lobortis accumsan. Donec congue est at metus posuere varius tristique a leo. Duis ullamcorper tincidunt nisi, vitae ultrices tellus. Maecenas sodales eros sed ligula interdum, eget lacinia erat semper. Duis rhoncus mauris eu turpis dapibus, ac varius tellus iaculis. Curabitur ornare, ex quis lacinia sodales, dolor diam vulputate nisl, nec aliquam magna magna eget augue. Aliquam condimentum ante ante, eget luctus orci molestie vel. Morbi varius, tellus nec faucibus pretium, lorem ante fermentum metus, in accumsan eros ex non erat. Maecenas eget suscipit magna, nec bibendum neque. Cras sapien neque, blandit ut erat at, sagittis aliquet lorem. Curabitur varius est neque. Duis bibendum id lectus vel luctus. Curabitur sodales nisi felis, in mattis tellus consectetur volutpat.Aenean at varius ante. Suspendisse vitae ante leo. Vivamus molestie, nisi vel efficitur scelerisque, nisi erat mollis erat, nec dapibus purus neque et nisi. In dictum neque dui. Nullam nec tincidunt libero. Quisque a dui lobortis, fringilla magna quis, tempus mi. Mauris laoreet viverra dolor, vitae bibendum augue luctus ut. Nam vitae metus consequat eros tempus fringilla. Praesent iaculis tristique ultrices. Proin justo tortor, sagittis amet.'}]};
        
                try {
                  Utils.validateField(field);
        Severity: Major
        Found in src/utils.spec.js and 3 other locations - About 4 hrs to fix
        src/utils.spec.js on lines 313..325
        src/utils.spec.js on lines 327..339
        src/utils.spec.js on lines 579..591

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

        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

        MarcRecord has 35 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export class MarcRecord {
        
          static setValidationOptions(options) {
            globalValidationOptions = {...validationOptionsDefaults, ...options};
          }
        Severity: Minor
        Found in src/index.js - About 4 hrs to fix

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

                it('Should consider the field invalid (numeric controlfield tag not beginning with 00), characters: true', () => {
                  const field = {'tag': '500', 'value': '123456'};
          
                  try {
                    Utils.validateField(field, {characters: true});
          Severity: Major
          Found in src/utils.spec.js and 1 other location - About 4 hrs to fix
          src/utils.spec.js on lines 247..259

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

          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 consider the field invalid (controlfield with non-ASCII content), characters: true', () => {
                  const field = {'tag': '003', 'value': 'ÅÖÖ'};
          
                  try {
                    Utils.validateField(field, {characters: true});
          Severity: Major
          Found in src/utils.spec.js and 1 other location - About 4 hrs to fix
          src/utils.spec.js on lines 225..237

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

          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 consider the field invalid (just value)', () => {
                const field = {value: 'FOO'};
          
                try {
                  Utils.validateField(field);
          Severity: Major
          Found in src/utils.spec.js and 1 other location - About 3 hrs to fix
          src/utils.spec.js on lines 37..51

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

          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