XingFramework/Relayer

View on GitHub

Showing 591 of 591 total issues

Function InitializedResourceClasses has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var InitializedResourceClasses = (function () {
  function InitializedResourceClasses(resourceDescriptionFactory) {
    _classCallCheck(this, InitializedResourceClasses);

    this.resourceDescriptionFactory = resourceDescriptionFactory;
Severity: Minor
Found in dist/cjs/relayer/ResourceDescription.js - About 1 hr to fix

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

      function metadataValueOrCall(key, target, cb) {
        if (metaMap.hasMetadata(key, target)) {
          return metaMap.getMetadata(key, target);
        } else {
          var value = cb();
    Severity: Major
    Found in dist/relayer.es5.js and 3 other locations - About 1 hr to fix
    dist/cjs/relayer/injector.js on lines 32..40
    dist/relayer/injector.js on lines 5..13
    src/relayer/injector.js on lines 5..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 69.

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

    function metadataValueOrCall(key, target, cb) {
      if (metaMap.hasMetadata(key, target)) {
        return metaMap.getMetadata(key, target);
      } else {
        var value = cb();
    Severity: Major
    Found in src/relayer/injector.js and 3 other locations - About 1 hr to fix
    dist/cjs/relayer/injector.js on lines 32..40
    dist/relayer.es5.js on lines 512..520
    dist/relayer/injector.js on lines 5..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 69.

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

    function metadataValueOrCall(key, target, cb) {
      if (metaMap.hasMetadata(key, target)) {
        return metaMap.getMetadata(key, target);
      } else {
        var value = cb();
    Severity: Major
    Found in dist/cjs/relayer/injector.js and 3 other locations - About 1 hr to fix
    dist/relayer.es5.js on lines 512..520
    dist/relayer/injector.js on lines 5..13
    src/relayer/injector.js on lines 5..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 69.

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

    function metadataValueOrCall(key, target, cb) {
      if (metaMap.hasMetadata(key, target)) {
        return metaMap.getMetadata(key, target);
      } else {
        var value = cb();
    Severity: Major
    Found in dist/relayer/injector.js and 3 other locations - About 1 hr to fix
    dist/cjs/relayer/injector.js on lines 32..40
    dist/relayer.es5.js on lines 512..520
    src/relayer/injector.js on lines 5..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 69.

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

        applyToError: function(error) {
          this.allDecorators.forEach((function(decorator) {
            decorator.errorsApply(error);
          }));
          if (this.parentDescription) {
    Severity: Major
    Found in dist/relayer.es5.js and 2 other locations - About 1 hr to fix
    dist/relayer.es5.js on lines 4626..4633
    dist/relayer.es5.js on lines 4642..4649

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

    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: "relationships",
        get: function () {
          if (!this.hasOwnProperty("_relationships")) {
            this._relationships = Object.create(this._relationships || {});
    Severity: Major
    Found in dist/cjs/relayer/Resource.js and 1 other location - About 1 hr to fix
    dist/cjs/relayer/Resource.js on lines 181..189

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

    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: "properties",
        get: function () {
          if (!this.hasOwnProperty("_properties")) {
            this._properties = Object.create(this._properties || {});
    Severity: Major
    Found in dist/cjs/relayer/Resource.js and 1 other location - About 1 hr to fix
    dist/cjs/relayer/Resource.js on lines 173..181

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

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

        applyToEndpoint: function(endpoint) {
          this.allDecorators.forEach((function(decorator) {
            decorator.endpointApply(endpoint);
          }));
          if (this.parentDescription) {
    Severity: Major
    Found in dist/relayer.es5.js and 2 other locations - About 1 hr to fix
    dist/relayer.es5.js on lines 4626..4633
    dist/relayer.es5.js on lines 4634..4641

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

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

        applyToResource: function(resource) {
          this.allDecorators.forEach((function(decorator) {
            decorator.resourceApply(resource);
          }));
          if (this.parentDescription) {
    Severity: Major
    Found in dist/relayer.es5.js and 2 other locations - About 1 hr to fix
    dist/relayer.es5.js on lines 4634..4641
    dist/relayer.es5.js on lines 4642..4649

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

    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 (!(relationship instanceof _TemplatedUrlJs.TemplatedUrl)) {
              var relationshipDefinition = _this.resource.constructor.relationships[relationshipName];
              var serializer = relationshipDefinition.serializerFactory(relationship);
              _this.resource.pathSet(relationshipDefinition.dataPath, serializer.serialize());
            }
    Severity: Major
    Found in dist/cjs/relayer/serializers/ResourceSerializer.js and 1 other location - About 1 hr to fix
    dist/relayer.es5.js on lines 1645..1649

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

    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 (!(relationship instanceof TemplatedUrl)) {
              var relationshipDefinition = $__4.resource.constructor.relationships[relationshipName];
              var serializer = relationshipDefinition.serializerFactory(relationship);
              $__4.resource.pathSet(relationshipDefinition.dataPath, serializer.serialize());
            }
    Severity: Major
    Found in dist/relayer.es5.js and 1 other location - About 1 hr to fix
    dist/cjs/relayer/serializers/ResourceSerializer.js on lines 41..45

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

    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 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 pathSet has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          pathSet: function(jsonpath, value) {
            var path = jsonPath(this._response, jsonpath, {
              wrap: true,
              resultType: "path"
            });
      Severity: Minor
      Found in dist/relayer.es5.js - About 1 hr to fix

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

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

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

                return response.then(function (resolvedResponse) {
                  endpoint.templatedUrl.etag = resolvedResponse.etag;
                  return _this.primaryResourceMapperFactory(endpoint.transport, resolvedResponse.data, _this.relationshipDescription, endpoint).map();
                })["catch"](function (resolvedError) {
          Severity: Major
          Found in dist/cjs/relayer/transformers/PrimaryResourceTransformer.js and 1 other location - About 1 hr to fix
          dist/relayer.es5.js on lines 1395..1398

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

          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

                return response.then((function(resolvedResponse) {
                  endpoint.templatedUrl.etag = resolvedResponse.etag;
                  return $__2.primaryResourceMapperFactory(endpoint.transport, resolvedResponse.data, $__2.relationshipDescription, endpoint).map();
                })).catch((function(resolvedError) {
          Severity: Major
          Found in dist/relayer.es5.js and 1 other location - About 1 hr to fix
          dist/cjs/relayer/transformers/PrimaryResourceTransformer.js on lines 51..54

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

          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 RelationshipDescription has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var RelationshipDescription = (function () {
            function RelationshipDescription(relationshipInitializerFactory, resourceMapperFactory, resourceSerializerFactory, inflector, name, ResourceClass, initialValues) {
              _classCallCheck(this, RelationshipDescription);
          
              this.initializer = relationshipInitializerFactory(ResourceClass, initialValues);

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

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

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

                get resourceFn(){
                  if(!this._resourceFn) {
                    var name = this.name;
                    var relationship = this.relationship;
                    var promiseEndpointFactory = this.promiseEndpointFactory;
              Severity: Minor
              Found in src/relayer/decorators/RelatedResourceDecorator.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language