NatLibFi/record-loader-melinda

View on GitHub

Showing 30 of 46 total issues

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

function factory(Promise, Object, MarcRecord, validateFactory, processorFactory) {
  
  'use strict';
  
  return function(parameters) {
Severity: Minor
Found in lib/processors/preprocess/melinda.js - About 1 hr to fix

    Function processBundles has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    function processBundles(filenames, result) {
      var data;
      var filename = filenames.shift();
    
      if (filename) {
    Severity: Minor
    Found in bin/run-host-components-merge.js - 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 factory has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function factory(Object, processorFactory) {
    
      'use strict';
    
      return function(parameters)
    Severity: Minor
    Found in lib/hostcomp/processors/match/melinda.js - About 1 hr to fix

      Function exports has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function(config) {
        config.set({
          singleRun: true,
          frameworks: ['mocha', 'requirejs'],
          browsers: ['PhantomJS'],
      Severity: Minor
      Found in karma.conf.js - About 1 hr to fix

        Function factory has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function factory(Promise, Object, validateFactory, MarcRecord, rankFactory, mergeFactory, processorFactory) {
        Severity: Major
        Found in lib/processors/merge/melinda.js - About 50 mins to fix

          Function factory has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function factory(Promise, Object, jsonSimilarity, rankFactory, MarcRecord, processorFactory) {
          Severity: Minor
          Found in lib/processors/match/melinda.js - About 45 mins to fix

            Function factory has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function factory(Promise, Object, MelindaClient, MarcRecord, recordStoreFactory) {
            Severity: Minor
            Found in lib/record-store/melinda.js - About 35 mins to fix

              Function factory has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function factory(Promise, Object, MarcRecord, validateFactory, processorFactory) {
              Severity: Minor
              Found in lib/processors/preprocess/melinda.js - About 35 mins to fix

                Function factory has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function factory(Promise, Object, MarcRecord, mergeObjects, hookFactory)
                Severity: Minor
                Found in lib/hostcomp/hooks/related-records-matched/hostcomp.js - About 35 mins to fix

                  Function factory has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function factory(Object, Promise, MarcRecord, marc_record_converters, resultFormatterFactory)
                  Severity: Minor
                  Found in lib/result-formatter/melinda.js - About 35 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language