aaronmccall/verymodel-riak

View on GitHub

Showing 6 of 12 total issues

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

function rehydrateIndexes(indexes) {
    this.getLogger().debug('Function [rehydrateIndexes] (indexesToData)');
    var self = this,
        payload = {},
        allKey = self.getAllKey();
Severity: Minor
Found in lib/indexes.js - About 1 hr to fix

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

    function build_index_request(obj, args) {
        var argLen  = args.length,
            payload = { qtype: 0 };
        // handle _getIndex('my_index', 'my_key') and 
        // _getIndex('my_index', 'range_min', 'range_max')
    Severity: Minor
    Found in lib/request_helpers.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 build_index_request has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function build_index_request(obj, args) {
        var argLen  = args.length,
            payload = { qtype: 0 };
        // handle _getIndex('my_index', 'my_key') and 
        // _getIndex('my_index', 'range_min', 'range_max')
    Severity: Minor
    Found in lib/request_helpers.js - About 1 hr to fix

      Function build_mapreduce_request has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      function build_mapreduce_request(obj, args) {
          var arg0isArray = (args[0] && Array.isArray(args[0])),
              payload = {};
          if (args.length === 3 || arg0isArray) {
      
      
      Severity: Minor
      Found in lib/request_helpers.js - About 55 mins 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 getName has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function getName(field, def) {
          if (!def) return field;
          var idxName;
          if (typeof def.index === 'string') {
              idxName = def.index;
      Severity: Minor
      Found in lib/indexes.js - About 45 mins 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 riakifyModel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      function riakifyModel(model) {
          // Extend options with any default options that aren't already defined
          _.defaults(model.options, defaults.options);
      
          var opts = model.options;
      Severity: Minor
      Found in index.js - About 35 mins 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

      Severity
      Category
      Status
      Source
      Language