petuomin/marc-record-js

View on GitHub

Showing 5 of 11 total issues

Function Record has 241 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function Record(rec) {

    var CONTROL_FIELD_LIST = ['FMT', '001', '002', '003', '004', '005', '006', '007', '008', '009'];

    if (rec !== undefined) {
Severity: Major
Found in lib/MarcRecord.js - About 1 day to fix

    File MarcRecord.js has 315 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    
    /*
    {
      leader: 'string',
      fields: [
    Severity: Minor
    Found in lib/MarcRecord.js - About 3 hrs to fix

      Function insertField has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          this.insertField = function(fieldDef, index) {
            
            if (isArray(fieldDef)) {
              if (fieldDef.length < 5) {
                throw new Error('Data field array must contain at least 5 elements: [tag, i1, i2, subcode1, subvalue1]');
      Severity: Minor
      Found in lib/MarcRecord.js - About 1 hr to fix

        Function containsFieldWithValue has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            this.containsFieldWithValue = function() {
              var args = Array.prototype.slice.call(arguments);
              if (args.length < 2) {
                throw new Error('At least 2 arguments are required');
              }
        Severity: Minor
        Found in lib/MarcRecord.js - About 1 hr to fix

          Function isEqual has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            Record.isEqual = function(record1, record2) {
              return record1.leader === record2.leader && fieldsEqual(record1.fields, record2.fields);
          
              function fieldsEqual(fields1, fields2) {
                
          Severity: Minor
          Found in lib/MarcRecord.js - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language