NatLibFi/record-loader-melinda

View on GitHub

Showing 30 of 46 total issues

Function factory has 245 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function factory(Promise, Object, MelindaClient, MarcRecord, recordStoreFactory) {

  'use strict';

  function normalizeRecordId(id)
Severity: Major
Found in lib/record-store/melinda.js - About 1 day to fix

    Function factory has 198 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function factory(Promise, Object, MarcRecord, mergeObjects, hookFactory)
    {
        
        'use strict';
        
    Severity: Major
    Found in lib/hostcomp/hooks/related-records-matched/hostcomp.js - About 7 hrs to fix

      Function run has 176 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  run: function(records)
                  {
                      return record_store.read({
                          
                          idList: [records[0].melindaHostId],
      Severity: Major
      Found in lib/hostcomp/hooks/related-records-matched/hostcomp.js - About 7 hrs to fix

        Function normalizeMatches has 145 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                            function normalizeMatches(records)
                            {
                                
                                function hasFailures(records)
                                {
        Severity: Major
        Found in lib/hostcomp/hooks/related-records-matched/hostcomp.js - About 5 hrs to fix

          Function factory has 74 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function factory(Promise, Object, MarcRecord, hookFactory)
          {
            
            'use strict';
          
          
          Severity: Major
          Found in lib/hostcomp/hooks/related-records-retrieved/hostcomp.js - About 2 hrs to fix

            Function processBundles has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function processBundles(filenames, result) {
              var data;
              var filename = filenames.shift();
            
              if (filename) {
            Severity: Major
            Found in bin/run-host-components-merge.js - About 2 hrs to fix

              Function factory has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function factory(Promise, Object, validateFactory, MarcRecord, rankFactory, mergeFactory, processorFactory) {
              
                'use strict';
              
                var DEFAULT_OPTIONS = {
              Severity: Major
              Found in lib/processors/merge/melinda.js - About 2 hrs to fix

                Function factory has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function factory(Object, Promise, MarcRecord, marc_record_converters, resultFormatterFactory)
                {
                  
                  'use strict';
                
                
                Severity: Major
                Found in lib/result-formatter/melinda.js - About 2 hrs to fix

                  File melinda.js has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /**
                   *
                   * @licstart  The following is the entire license notice for the JavaScript code in this file. 
                   *
                   * Melinda-related modules for recordLoader
                  Severity: Minor
                  Found in lib/record-store/melinda.js - About 2 hrs to fix

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

                    module.exports = function(name, argv, console, std_streams)
                    {
                    
                      'use strict';
                      
                    Severity: Minor
                    Found in lib/scripts/merged-records-to-files.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 exports has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function(name, argv, console, std_streams)
                    {
                    
                      'use strict';
                      
                    Severity: Major
                    Found in lib/scripts/merged-records-to-files.js - About 2 hrs to fix

                      Function factory has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function factory(Promise, Object, jsonSimilarity, rankFactory, MarcRecord, processorFactory) {
                      
                        'use strict';
                      
                        return function(parameters)
                      Severity: Major
                      Found in lib/processors/match/melinda.js - About 2 hrs to fix

                        Function read has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              read: function(query)
                              {
                        
                                var fn_get_records, fn_get_records_cache;
                        
                        
                        Severity: Minor
                        Found in lib/record-store/melinda.js - About 2 hrs to fix

                          Function normalizeResults has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function normalizeResults(original_results) {
                              var normalized_results = {
                                matched: false,
                                matchingBundles: [],
                                bundleResults: clone(original_results),
                          Severity: Minor
                          Found in bin/run-host-components-merge.js - About 1 hr to fix

                            Function factory has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function factory(Object, marc_record_converters, recordSetFactory)
                            {
                              
                              'use strict';
                            
                            
                            Severity: Minor
                            Found in lib/hostcomp/record-set/hostcomp.js - About 1 hr to fix

                              Function findMissingByIndex has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                                      function findMissingByIndex(record, index, records)
                                                      {
                                                          
                                                          function getSurroundingRecords()
                                                          {
                              Severity: Minor
                              Found in lib/hostcomp/hooks/related-records-matched/hostcomp.js - About 1 hr to fix

                                Function run has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      run: function(record, matched_records)
                                      {
                                
                                        var result;
                                
                                
                                Severity: Minor
                                Found in lib/processors/merge/melinda.js - About 1 hr to fix

                                  Function update has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        update: function(query, record_data)
                                        {
                                  
                                          function process(list, results)
                                          {
                                  Severity: Minor
                                  Found in lib/record-store/melinda.js - About 1 hr to fix

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

                                            function pump(list, results)
                                            {
                                    
                                              var id = list.shift();
                                    
                                    
                                    Severity: Minor
                                    Found in lib/record-store/melinda.js - About 1 hr to fix

                                      Function run has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                            run: function(records_data)
                                            {
                                      
                                              logger.info('Retrieving record store counterpart');
                                      
                                      
                                      Severity: Minor
                                      Found in lib/hostcomp/hooks/related-records-retrieved/hostcomp.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language