XingFramework/Relayer

View on GitHub

Showing 591 of 591 total issues

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

  function EmbeddedRelationshipTransformer(relationshipName) {
    _classCallCheck(this, EmbeddedRelationshipTransformer);

    _get(Object.getPrototypeOf(EmbeddedRelationshipTransformer.prototype), "constructor", this).call(this);
    this.relationshipName = relationshipName;
dist/cjs/relayer/endpoints/PromiseEndpoint.js on lines 20..25
dist/cjs/relayer/injector.js on lines 102..107
dist/cjs/relayer/injector.js on lines 122..127
dist/cjs/relayer/injector.js on lines 150..155
dist/cjs/relayer/transformers/EmbeddedPropertyTransformer.js on lines 22..27
dist/cjs/relayer/transformers/PrimaryResourceTransformer.js on lines 22..27

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 57.

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 7 locations. Consider refactoring.
Open

  function ConstructableInjectable(Target) {
    _classCallCheck(this, ConstructableInjectable);

    _get(Object.getPrototypeOf(ConstructableInjectable.prototype), 'constructor', this).call(this);
    this.Target = Target;
Severity: Major
Found in dist/cjs/relayer/injector.js and 6 other locations - About 1 hr to fix
dist/cjs/relayer/endpoints/PromiseEndpoint.js on lines 20..25
dist/cjs/relayer/injector.js on lines 102..107
dist/cjs/relayer/injector.js on lines 122..127
dist/cjs/relayer/transformers/EmbeddedPropertyTransformer.js on lines 22..27
dist/cjs/relayer/transformers/EmbeddedRelationshipTransformer.js on lines 22..27
dist/cjs/relayer/transformers/PrimaryResourceTransformer.js on lines 22..27

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 57.

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 7 locations. Consider refactoring.
Open

  function FactoryInjectable(Target) {
    _classCallCheck(this, FactoryInjectable);

    _get(Object.getPrototypeOf(FactoryInjectable.prototype), 'constructor', this).call(this);
    this.Target = Target;
Severity: Major
Found in dist/cjs/relayer/injector.js and 6 other locations - About 1 hr to fix
dist/cjs/relayer/endpoints/PromiseEndpoint.js on lines 20..25
dist/cjs/relayer/injector.js on lines 102..107
dist/cjs/relayer/injector.js on lines 150..155
dist/cjs/relayer/transformers/EmbeddedPropertyTransformer.js on lines 22..27
dist/cjs/relayer/transformers/EmbeddedRelationshipTransformer.js on lines 22..27
dist/cjs/relayer/transformers/PrimaryResourceTransformer.js on lines 22..27

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 57.

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 7 locations. Consider refactoring.
Open

  function PrimaryResourceTransformer(relationshipDescription) {
    _classCallCheck(this, PrimaryResourceTransformer);

    _get(Object.getPrototypeOf(PrimaryResourceTransformer.prototype), "constructor", this).call(this);
    this.relationshipDescription = relationshipDescription;
dist/cjs/relayer/endpoints/PromiseEndpoint.js on lines 20..25
dist/cjs/relayer/injector.js on lines 102..107
dist/cjs/relayer/injector.js on lines 122..127
dist/cjs/relayer/injector.js on lines 150..155
dist/cjs/relayer/transformers/EmbeddedPropertyTransformer.js on lines 22..27
dist/cjs/relayer/transformers/EmbeddedRelationshipTransformer.js on lines 22..27

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 57.

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 7 locations. Consider refactoring.
Open

  function PromiseEndpoint(promiseFunction) {
    _classCallCheck(this, PromiseEndpoint);

    _get(Object.getPrototypeOf(PromiseEndpoint.prototype), "constructor", this).call(this);
    this.endpointPromise = promiseFunction;
Severity: Major
Found in dist/cjs/relayer/endpoints/PromiseEndpoint.js and 6 other locations - About 1 hr to fix
dist/cjs/relayer/injector.js on lines 102..107
dist/cjs/relayer/injector.js on lines 122..127
dist/cjs/relayer/injector.js on lines 150..155
dist/cjs/relayer/transformers/EmbeddedPropertyTransformer.js on lines 22..27
dist/cjs/relayer/transformers/EmbeddedRelationshipTransformer.js on lines 22..27
dist/cjs/relayer/transformers/PrimaryResourceTransformer.js on lines 22..27

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 57.

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 7 locations. Consider refactoring.
Open

  function ValueInjectable(value) {
    _classCallCheck(this, ValueInjectable);

    _get(Object.getPrototypeOf(ValueInjectable.prototype), 'constructor', this).call(this);
    this.value = value;
Severity: Major
Found in dist/cjs/relayer/injector.js and 6 other locations - About 1 hr to fix
dist/cjs/relayer/endpoints/PromiseEndpoint.js on lines 20..25
dist/cjs/relayer/injector.js on lines 122..127
dist/cjs/relayer/injector.js on lines 150..155
dist/cjs/relayer/transformers/EmbeddedPropertyTransformer.js on lines 22..27
dist/cjs/relayer/transformers/EmbeddedRelationshipTransformer.js on lines 22..27
dist/cjs/relayer/transformers/PrimaryResourceTransformer.js on lines 22..27

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 57.

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

    _transformRequest: function(transformers, request) {
      var $__4 = this;
      return transformers.slice(0).reverse().reduce((function(interimRequest, transformer) {
        return transformer.transformRequest($__4, interimRequest);
      }), request);
Severity: Major
Found in dist/relayer.es5.js and 1 other location - About 1 hr to fix
dist/cjs/relayer/endpoints/ResolvedEndpoint.js on lines 85..92

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 57.

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

    value: function _transformRequest(transformers, request) {
      var _this3 = this;

      return transformers.slice(0).reverse().reduce(function (interimRequest, transformer) {

Severity: Major
Found in dist/cjs/relayer/endpoints/ResolvedEndpoint.js and 1 other location - About 1 hr to fix
dist/relayer.es5.js on lines 736..741

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 57.

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

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

  get errorFn() {
    if(!this._errorFn) {
      var name = this.name;
      var path = this.path;
      var relationship = this.relationship;
Severity: Minor
Found in dist/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 ResourceDescription has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

var ResourceDescription = (function () {
  function ResourceDescription(jsonPropertyDecoratorFactory, relatedResourceDecoratorFactory, singleRelationshipDescriptionFactory, manyRelationshipDescriptionFactory, listRelationshipDescriptionFactory, mapRelationshipDescriptionFactory, inflector) {
    _classCallCheck(this, ResourceDescription);

    this.jsonPropertyDecoratorFactory = jsonPropertyDecoratorFactory;
Severity: Minor
Found in dist/cjs/relayer/ResourceDescription.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 ResolvedEndpoint has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

var ResolvedEndpoint = (function (_Endpoint) {
  function ResolvedEndpoint(Promise, transport, templatedUrl) {
    var _this = this;

    var resourceTransformers = arguments[3] === undefined ? [] : arguments[3];
Severity: Minor
Found in dist/cjs/relayer/endpoints/ResolvedEndpoint.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 errorFn has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  get errorFn() {
    if(!this._errorFn) {
      var name = this.name;
      var path = this.path;
      var relationship = this.relationship;
Severity: Minor
Found in src/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 MultipleRelationshipDescription has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var MultipleRelationshipDescription = (function (_RelationshipDescription) {
  function MultipleRelationshipDescription(relationshipInitializerFactory, resourceMapperFactory, resourceSerializerFactory, inflector, embeddedRelationshipTransformerFactory, singleFromManyTransformerFactory, loadedDataEndpointFactory, name, ResourceClass, initialValues) {
    _classCallCheck(this, MultipleRelationshipDescription);

    _get(Object.getPrototypeOf(MultipleRelationshipDescription.prototype), "constructor", this).call(this, relationshipInitializerFactory, resourceMapperFactory, resourceSerializerFactory, inflector, name, ResourceClass, initialValues);

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

    var SingleFromManyTransformer = (function (_ResourceTransformer) {
      function SingleFromManyTransformer(relationshipName, property) {
        _classCallCheck(this, SingleFromManyTransformer);
    
        _get(Object.getPrototypeOf(SingleFromManyTransformer.prototype), "constructor", this).call(this);
    Severity: Minor
    Found in dist/cjs/relayer/transformers/SingleFromManyTransformer.js - About 1 hr to fix

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

      var APIError = (function (_DataWrapper) {
        function APIError(responseData) {
          var _this = this;
      
          _classCallCheck(this, APIError);
      Severity: Minor
      Found in dist/cjs/relayer/APIError.js - About 1 hr to fix

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

            value: function removeDataPathLink(resource, path) {
              this._paths = this._paths.filter(function (pathLink) {
                return pathLink.resource != resource || pathLink.path != path;
              });
            }
        Severity: Major
        Found in dist/cjs/relayer/TemplatedUrl.js and 1 other location - About 1 hr to fix
        dist/relayer.es5.js on lines 1014..1018

        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 56.

        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

            removeDataPathLink: function(resource, path) {
              this._paths = this._paths.filter((function(pathLink) {
                return (pathLink.resource != resource) || (pathLink.path != path);
              }));
            }
        Severity: Major
        Found in dist/relayer.es5.js and 1 other location - About 1 hr to fix
        dist/cjs/relayer/TemplatedUrl.js on lines 72..76

        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 56.

        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

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

        var EmbeddedRelationshipTransformer = (function (_ResourceTransformer) {
          function EmbeddedRelationshipTransformer(relationshipName) {
            _classCallCheck(this, EmbeddedRelationshipTransformer);
        
            _get(Object.getPrototypeOf(EmbeddedRelationshipTransformer.prototype), "constructor", this).call(this);
        Severity: Minor
        Found in dist/cjs/relayer/transformers/EmbeddedRelationshipTransformer.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 EmbeddedPropertyTransformer has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var EmbeddedPropertyTransformer = (function (_ResourceTransformer) {
              function EmbeddedPropertyTransformer(path) {
                _classCallCheck(this, EmbeddedPropertyTransformer);
            
                _get(Object.getPrototypeOf(EmbeddedPropertyTransformer.prototype), "constructor", this).call(this);
            Severity: Minor
            Found in dist/cjs/relayer/transformers/EmbeddedPropertyTransformer.js - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language