XingFramework/Relayer

View on GitHub
dist/cjs/relayer/decorators/RelatedResourceDecorator.js

Summary

Maintainability
F
6 days
Test Coverage

Function RelatedResourceDecorator has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
Open

var RelatedResourceDecorator = (function (_ResourceDecorator) {
  function RelatedResourceDecorator(promiseEndpointFactory, relationshipUtilities, name, relationship) {
    _classCallCheck(this, RelatedResourceDecorator);

    _get(Object.getPrototypeOf(RelatedResourceDecorator.prototype), "constructor", this).call(this, name);
Severity: Minor
Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.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 RelatedResourceDecorator has 124 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var RelatedResourceDecorator = (function (_ResourceDecorator) {
  function RelatedResourceDecorator(promiseEndpointFactory, relationshipUtilities, name, relationship) {
    _classCallCheck(this, RelatedResourceDecorator);

    _get(Object.getPrototypeOf(RelatedResourceDecorator.prototype), "constructor", this).call(this, name);
Severity: Major
Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js - About 4 hrs to fix

    Function get has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        get: function () {
          if (!this._resourceFn) {
            var name = this.name;
            var relationship = this.relationship;
            var promiseEndpointFactory = this.promiseEndpointFactory;
    Severity: Minor
    Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js - About 1 hr to fix

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

      var _get = function get(_x3, _x4, _x5) { var _again = true; _function: while (_again) { var object = _x3, property = _x4, receiver = _x5; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x3 = parent; _x4 = property; _x5 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
      Severity: Minor
      Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.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 _resourceFn has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              this._resourceFn = function (uriParams) {
                var _this = this;
      
                var recursiveCall = arguments[1] === undefined ? false : arguments[1];
      
      
      Severity: Minor
      Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js - About 1 hr to fix

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

            get: function () {
        
              if (!this._endpointFn) {
        
                var name = this.name;
        Severity: Minor
        Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js - About 1 hr to fix

          Function _createClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
          Severity: Minor
          Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js - About 25 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

          Similar blocks of code found in 29 locations. Consider refactoring.
          Open

          var _get = function get(_x3, _x4, _x5) { var _again = true; _function: while (_again) { var object = _x3, property = _x4, receiver = _x5; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x3 = parent; _x4 = property; _x5 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
          Severity: Major
          Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js and 28 other locations - About 1 day to fix
          dist/cjs/relayer/APIError.js on lines 9..9
          dist/cjs/relayer/Resource.js on lines 9..9
          dist/cjs/relayer/TemplatedUrl.js on lines 7..7
          dist/cjs/relayer/TemporaryTemplatedUrl.js on lines 9..9
          dist/cjs/relayer/decorators/JsonPropertyDecorator.js on lines 9..9
          dist/cjs/relayer/endpoints/LoadedDataEndpoint.js on lines 9..9
          dist/cjs/relayer/endpoints/PromiseEndpoint.js on lines 7..7
          dist/cjs/relayer/endpoints/ResolvedEndpoint.js on lines 9..9
          dist/cjs/relayer/initializers/ListRelationshipInitializer.js on lines 9..9
          dist/cjs/relayer/initializers/ManyRelationshipInitializer.js on lines 9..9
          dist/cjs/relayer/initializers/MapRelationshipInitializer.js on lines 9..9
          dist/cjs/relayer/injector.js on lines 8..8
          dist/cjs/relayer/mappers/ListResourceMapper.js on lines 9..9
          dist/cjs/relayer/mappers/ManyResourceMapper.js on lines 9..9
          dist/cjs/relayer/mappers/MapResourceMapper.js on lines 9..9
          dist/cjs/relayer/mappers/ResourceMapper.js on lines 9..9
          dist/cjs/relayer/relationshipDescriptions/ListRelationshipDescription.js on lines 9..9
          dist/cjs/relayer/relationshipDescriptions/MultipleRelationshipDescription.js on lines 9..9
          dist/cjs/relayer/relationshipDescriptions/SingleRelationshipDescription.js on lines 9..9
          dist/cjs/relayer/serializers/ListResourceSerializer.js on lines 9..9
          dist/cjs/relayer/serializers/ManyResourceSerializer.js on lines 9..9
          dist/cjs/relayer/serializers/MapResourceSerializer.js on lines 9..9
          dist/cjs/relayer/transformers/CreateResourceTransformer.js on lines 9..9
          dist/cjs/relayer/transformers/EmbeddedPropertyTransformer.js on lines 9..9
          dist/cjs/relayer/transformers/EmbeddedRelationshipTransformer.js on lines 9..9
          dist/cjs/relayer/transformers/IndividualFromListTransformer.js on lines 9..9
          dist/cjs/relayer/transformers/PrimaryResourceTransformer.js on lines 9..9
          dist/cjs/relayer/transformers/SingleFromManyTransformer.js on lines 9..9

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 224.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 48 locations. Consider refactoring.
          Open

          var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
          Severity: Major
          Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js and 47 other locations - About 6 hrs to fix
          dist/cjs/relayer.js on lines 7..7
          dist/cjs/relayer/APIError.js on lines 7..7
          dist/cjs/relayer/DataWrapper.js on lines 7..7
          dist/cjs/relayer/MetaMap.js on lines 7..7
          dist/cjs/relayer/PrimaryResourceBuilder.js on lines 7..7
          dist/cjs/relayer/RelationshipUtilities.js on lines 7..7
          dist/cjs/relayer/Resource.js on lines 7..7
          dist/cjs/relayer/ResourceBuilder.js on lines 7..7
          dist/cjs/relayer/ResourceDescription.js on lines 7..7
          dist/cjs/relayer/TemplatedUrl.js on lines 9..9
          dist/cjs/relayer/TemporaryTemplatedUrl.js on lines 7..7
          dist/cjs/relayer/Transport.js on lines 7..7
          dist/cjs/relayer/UrlHelper.js on lines 7..7
          dist/cjs/relayer/decorators/JsonPropertyDecorator.js on lines 7..7
          dist/cjs/relayer/decorators/ResourceDecorator.js on lines 7..7
          dist/cjs/relayer/endpoints/Endpoint.js on lines 7..7
          dist/cjs/relayer/endpoints/LoadedDataEndpoint.js on lines 7..7
          dist/cjs/relayer/endpoints/ResolvedEndpoint.js on lines 7..7
          dist/cjs/relayer/initializers/ListRelationshipInitializer.js on lines 7..7
          dist/cjs/relayer/initializers/ManyRelationshipInitializer.js on lines 7..7
          dist/cjs/relayer/initializers/MapRelationshipInitializer.js on lines 7..7
          dist/cjs/relayer/initializers/RelationshipInitializer.js on lines 7..7
          dist/cjs/relayer/initializers/SingleRelationshipInitializer.js on lines 7..7
          dist/cjs/relayer/injector.js on lines 10..10
          dist/cjs/relayer/mappers/ListResourceMapper.js on lines 7..7
          dist/cjs/relayer/mappers/ManyResourceMapper.js on lines 7..7
          dist/cjs/relayer/mappers/MapResourceMapper.js on lines 7..7
          dist/cjs/relayer/mappers/Mapper.js on lines 7..7
          dist/cjs/relayer/mappers/ResourceMapper.js on lines 7..7
          dist/cjs/relayer/relationshipDescriptions/ListRelationshipDescription.js on lines 7..7
          dist/cjs/relayer/relationshipDescriptions/MultipleRelationshipDescription.js on lines 7..7
          dist/cjs/relayer/relationshipDescriptions/RelationshipDescription.js on lines 7..7
          dist/cjs/relayer/relationshipDescriptions/SingleRelationshipDescription.js on lines 7..7
          dist/cjs/relayer/serializers/ListResourceSerializer.js on lines 7..7
          dist/cjs/relayer/serializers/ManyResourceSerializer.js on lines 7..7
          dist/cjs/relayer/serializers/MapResourceSerializer.js on lines 7..7
          dist/cjs/relayer/serializers/ResourceSerializer.js on lines 7..7
          dist/cjs/relayer/serializers/Serializer.js on lines 7..7
          dist/cjs/relayer/transformers/CreateResourceTransformer.js on lines 7..7
          dist/cjs/relayer/transformers/EmbeddedPropertyTransformer.js on lines 7..7
          dist/cjs/relayer/transformers/EmbeddedRelationshipTransformer.js on lines 7..7
          dist/cjs/relayer/transformers/IndividualFromListTransformer.js on lines 7..7
          dist/cjs/relayer/transformers/PrimaryResourceTransformer.js on lines 7..7
          dist/cjs/relayer/transformers/ResourceTransformer.js on lines 14..14
          dist/cjs/relayer/transformers/SingleFromManyTransformer.js on lines 7..7
          dist/cjs/relayer/transformers/ThrowErrorTransformer.js on lines 7..7
          dist/cjs/src/relayer.js on lines 7..7

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 171.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 35 locations. Consider refactoring.
          Open

          function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
          Severity: Major
          Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js and 34 other locations - About 3 hrs to fix
          dist/cjs/relayer/APIError.js on lines 15..15
          dist/cjs/relayer/ListResource.js on lines 11..11
          dist/cjs/relayer/Resource.js on lines 15..15
          dist/cjs/relayer/TemplatedUrl.js on lines 11..11
          dist/cjs/relayer/TemporaryTemplatedUrl.js on lines 13..13
          dist/cjs/relayer/decorators/JsonPropertyDecorator.js on lines 15..15
          dist/cjs/relayer/endpoints/LoadedDataEndpoint.js on lines 15..15
          dist/cjs/relayer/endpoints/PromiseEndpoint.js on lines 13..13
          dist/cjs/relayer/endpoints/ResolvedEndpoint.js on lines 15..15
          dist/cjs/relayer/initializers/ListRelationshipInitializer.js on lines 15..15
          dist/cjs/relayer/initializers/ManyRelationshipInitializer.js on lines 15..15
          dist/cjs/relayer/initializers/MapRelationshipInitializer.js on lines 15..15
          dist/cjs/relayer/initializers/SingleRelationshipInitializer.js on lines 13..13
          dist/cjs/relayer/injector.js on lines 22..22
          dist/cjs/relayer/mappers/ListResourceMapper.js on lines 15..15
          dist/cjs/relayer/mappers/ManyResourceMapper.js on lines 15..15
          dist/cjs/relayer/mappers/MapResourceMapper.js on lines 15..15
          dist/cjs/relayer/mappers/ResourceMapper.js on lines 15..15
          dist/cjs/relayer/relationshipDescriptions/ListRelationshipDescription.js on lines 15..15
          dist/cjs/relayer/relationshipDescriptions/ManyRelationshipDescription.js on lines 11..11
          dist/cjs/relayer/relationshipDescriptions/MapRelationshipDescription.js on lines 11..11
          dist/cjs/relayer/relationshipDescriptions/MultipleRelationshipDescription.js on lines 15..15
          dist/cjs/relayer/relationshipDescriptions/SingleRelationshipDescription.js on lines 15..15
          dist/cjs/relayer/serializers/ListResourceSerializer.js on lines 15..15
          dist/cjs/relayer/serializers/ManyResourceSerializer.js on lines 15..15
          dist/cjs/relayer/serializers/MapResourceSerializer.js on lines 15..15
          dist/cjs/relayer/serializers/ResourceSerializer.js on lines 13..13
          dist/cjs/relayer/transformers/CreateResourceTransformer.js on lines 15..15
          dist/cjs/relayer/transformers/EmbeddedPropertyTransformer.js on lines 15..15
          dist/cjs/relayer/transformers/EmbeddedRelationshipTransformer.js on lines 15..15
          dist/cjs/relayer/transformers/IndividualFromListTransformer.js on lines 15..15
          dist/cjs/relayer/transformers/PrimaryResourceTransformer.js on lines 15..15
          dist/cjs/relayer/transformers/SingleFromManyTransformer.js on lines 15..15
          dist/cjs/relayer/transformers/ThrowErrorTransformer.js on lines 13..13

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 114.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                    var newPromise = function newPromise() {
                      return _this2.load().then(function (resource) {
                        if (relationship.async) {
                          return resource[name](uriParams);
                        } else {
          Severity: Major
          Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js and 1 other location - About 2 hrs to fix
          dist/relayer.es5.js on lines 1177..1187

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 84.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                      if (!this.relationships[name]) {
                        if (recursiveCall === false) {
                          endpoint = promiseEndpointFactory(function () {
                            return _this.self().load().then(function (resource) {
                              return resource[name](uriParams, true);
          Severity: Major
          Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js and 1 other location - About 2 hrs to fix
          dist/relayer.es5.js on lines 1116..1130

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 81.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                    } else {
                      if (this.relationships[name] instanceof _TemplatedUrlJs.TemplatedUrl) {
                        throw "Error: non-async relationships must be embedded";
                      } else {
                        if (uriParams) {
          Severity: Major
          Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js and 1 other location - About 1 hr to fix
          dist/cjs/relayer/decorators/RelatedResourceDecorator.js on lines 102..112

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 70.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  this._errorFn = function (uriParams) {
                    if (this.relationships[name] instanceof _TemplatedUrlJs.TemplatedUrl) {
                      throw "Error: non-async relationships must be embedded";
                    } else {
                      if (uriParams) {
          Severity: Major
          Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js and 1 other location - About 1 hr to fix
          dist/cjs/relayer/decorators/RelatedResourceDecorator.js on lines 79..89

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 70.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            }, {
              key: "errorsApply",
              value: function errorsApply(target) {
                target.constructor.relationships[this.name] = this.relationship;
                this.addFunction(target, this.errorFn);
          Severity: Major
          Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js and 1 other location - About 1 hr to fix
          dist/cjs/relayer/decorators/RelatedResourceDecorator.js on lines 156..162

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 63.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            }, {
              key: "resourceApply",
              value: function resourceApply(target) {
                target.constructor.relationships[this.name] = this.relationship;
                this.addFunction(target, this.resourceFn);
          Severity: Major
          Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js and 1 other location - About 1 hr to fix
          dist/cjs/relayer/decorators/RelatedResourceDecorator.js on lines 162..168

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 63.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          There are no issues that match your filters.

          Category
          Status