Showing 29 of 36 total issues

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

module.exports = function(priv, opts) {
  return function *save() {
    if (this.id && utils.empty(this.json(true))) {
      // nothing to update
      return this;
Severity: Minor
Found in lib/yamb/proto/methods/save.js - About 1 day 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 a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function(priv, options) {
  var getter = function() {
    if (!utils.is.obj(this[priv.cache][options.name])) {
      this[priv.cache][options.name] = Object.defineProperties({}, descriptors(priv, this, options));
    }
Severity: Minor
Found in lib/yamb/proto/virtual.js - About 4 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 a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function(priv) {
  var facility = function(relate) {
    return utils.is.yamb(relate) && relate[priv.symbl].id;
  };

Severity: Minor
Found in lib/yamb/proto/props/related.js - About 3 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 a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function(opts) {
  var props = require('./proto/props')(priv, opts);

  var yamb = function Yamb(params) {
    this[priv.shado] = utils.clone(schema);
Severity: Minor
Found in lib/yamb/index.js - About 3 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 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(priv, opts) {
  return function *save() {
    if (this.id && utils.empty(this.json(true))) {
      // nothing to update
      return this;
Severity: Major
Found in lib/yamb/proto/methods/save.js - About 3 hrs to fix

    Function save has 75 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      return function *save() {
        if (this.id && utils.empty(this.json(true))) {
          // nothing to update
          return this;
        }
    Severity: Major
    Found in lib/yamb/proto/methods/save.js - About 3 hrs to fix

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

      module.exports = function(priv, options) {
        var getter = function() {
          if (!utils.is.obj(this[priv.cache][options.name])) {
            this[priv.cache][options.name] = Object.defineProperties({}, descriptors(priv, this, options));
          }
      Severity: Major
      Found in lib/yamb/proto/virtual.js - About 2 hrs to fix

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

        module.exports = function(priv) {
          var getter = function() {
            if (!utils.is.obj(this[priv.cache].stats)) {
              this[priv.cache].stats = Object.defineProperties({}, descriptors(priv, this));
            }
        Severity: Minor
        Found in lib/yamb/proto/props/stats.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 exports has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(opts) {
          if (!opts.storage) {
            // TODO: fix error message
            throw new Error('error with storage');
          }
        Severity: Minor
        Found in lib/index.js - About 1 hr to fix

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

          module.exports = function(priv) {
            var facility = function(relate) {
              return utils.is.yamb(relate) && relate[priv.symbl].id;
            };
          
          
          Severity: Minor
          Found in lib/yamb/proto/props/related.js - About 1 hr to fix

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

            module.exports = function(opts) {
              if (!opts.storage) {
                // TODO: fix error message
                throw new Error('error with storage');
              }
            Severity: Minor
            Found in lib/index.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 exports has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = function(priv, opts) {
              return function *similar(all) {
                if (!this.id || utils.empty(this.related)) {
                  return [];
                }
            Severity: Minor
            Found in lib/yamb/proto/methods/similar.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 exports has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function(opts) {
              var props = require('./proto/props')(priv, opts);
            
              var yamb = function Yamb(params) {
                this[priv.shado] = utils.clone(schema);
            Severity: Minor
            Found in lib/yamb/index.js - About 1 hr to fix

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

              module.exports = function(priv) {
                var getter = function() {
                  if (!utils.is.obj(this[priv.cache].stats)) {
                    this[priv.cache].stats = Object.defineProperties({}, descriptors(priv, this));
                  }
              Severity: Minor
              Found in lib/yamb/proto/props/stats.js - About 1 hr to fix

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

                module.exports = function(priv) {
                  var getter = function() {
                    return utils.clone(this[priv.symbl].tags);
                  };
                
                
                Severity: Minor
                Found in lib/yamb/proto/props/tags.js - About 1 hr to fix

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

                  module.exports = function(priv) {
                    var getter = function() {
                      return utils.clone(this[priv.symbl].tags);
                    };
                  
                  
                  Severity: Minor
                  Found in lib/yamb/proto/props/tags.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 setter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    var setter = function(related) {
                      if (!utils.is.arr(related) && !suppose(related) && !facility(related)) {
                        return;
                      }
                  
                  
                  Severity: Minor
                  Found in lib/yamb/proto/props/related.js - About 1 hr to fix

                    Function setter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      var setter = function(value) {
                        if (options.direct && utils.is.str(value)) {
                          value = utils.striptags(value.trim());
                    
                          if (!utils.whitespace(value)) {
                    Severity: Minor
                    Found in lib/yamb/proto/virtual.js - About 1 hr to fix

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

                      module.exports = function(priv) {
                        return function json(newer) {
                          var data = utils.clone(this[priv.symbl]);
                      
                          if (newer === true) {
                      Severity: Minor
                      Found in lib/yamb/proto/methods/json.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 exports has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = function(priv) {
                        var getter = function() {
                          var date = this[priv.symbl].publish;
                          if (!date) {
                            return false;
                      Severity: Minor
                      Found in lib/yamb/proto/props/publish.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

                      Severity
                      Category
                      Status
                      Source
                      Language