XingFramework/Relayer

View on GitHub

Showing 591 of 591 total issues

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

(0, _injectorJs.Inject)((0, _injectorJs.factory)(_TemplatedUrlJs.TemplatedUrlFromUrl), (0, _injectorJs.factory)(_ResourceBuilderJs2["default"]), (0, _injectorJs.factory)(_PrimaryResourceBuilderJs2["default"]), (0, _injectorJs.factory)(_transformersPrimaryResourceTransformerJs2["default"]))(ResourceMapper);
Severity: Major
Found in dist/cjs/relayer/mappers/ResourceMapper.js and 1 other location - About 2 hrs to fix
dist/cjs/relayer/ResourceBuilder.js on lines 87..87

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

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

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

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

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

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

(0, _injectorJs.Inject)((0, _injectorJs.factory)(_TemplatedUrlJs.TemplatedUrlFromUrl), (0, _injectorJs.factory)(_endpointsResolvedEndpointJs2["default"]), (0, _injectorJs.factory)(_transformersThrowErrorTransformerJs2["default"]), (0, _injectorJs.factory)(_transformersCreateResourceTransformerJs2["default"]))(ResourceBuilder);
Severity: Major
Found in dist/cjs/relayer/ResourceBuilder.js and 1 other location - About 2 hrs to fix
dist/cjs/relayer/mappers/ResourceMapper.js on lines 98..98

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

Function mapNestedRelationships has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    value: function mapNestedRelationships() {
      var _this = this;

      // add mappings for list resource
      _get(Object.getPrototypeOf(ListResourceMapper.prototype), "mapNestedRelationships", this).call(this);
Severity: Major
Found in dist/cjs/relayer/mappers/ListResourceMapper.js - About 2 hrs to fix

    Function mapNestedRelationships has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        mapNestedRelationships: function() {
          var $__16 = this;
          $traceurRuntime.superGet(this, $ListResourceMapper.prototype, "mapNestedRelationships").call(this);
          this.resource = this.mapped;
          var manyResourceMapper = this.manyResourceMapperFactory(this.transport, this.resource.pathGet("$.data"), this.relationshipDescription);
    Severity: Major
    Found in dist/relayer.es5.js - About 2 hrs to fix

      Function Endpoint has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      var Endpoint = (function () {
        function Endpoint() {
          _classCallCheck(this, Endpoint);
        }
      
      
      Severity: Minor
      Found in dist/cjs/relayer/endpoints/Endpoint.js - About 2 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

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

      export default class ManyResourceSerializer extends Serializer {
      
        constructor(resourceSerializerFactory, resource) {
          super(resource);
          this.resourceSerializerFactory = resourceSerializerFactory;
      Severity: Major
      Found in src/relayer/serializers/ManyResourceSerializer.js and 1 other location - About 2 hrs to fix
      dist/relayer/serializers/ManyResourceSerializer.js on lines 5..15

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

      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

      export default class ManyResourceSerializer extends Serializer {
      
        constructor(resourceSerializerFactory, resource) {
          super(resource);
          this.resourceSerializerFactory = resourceSerializerFactory;
      Severity: Major
      Found in dist/relayer/serializers/ManyResourceSerializer.js and 1 other location - About 2 hrs to fix
      src/relayer/serializers/ManyResourceSerializer.js on lines 5..15

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

      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

          annotationsFor: function(AnnotationClass) {
            var OriginalClass = AnnotationClass.originalClass || AnnotationClass;
            if (this.AnnotatedClass.annotations) {
              return this.AnnotatedClass.annotations.filter((function(annotation) {
                return annotation instanceof OriginalClass;
      Severity: Major
      Found in dist/relayer.es5.js and 1 other location - About 2 hrs to fix
      dist/relayer.es5.js on lines 1912..1921

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

      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

          annotationFor: function(AnnotationClass) {
            var OriginalClass = AnnotationClass.originalClass || AnnotationClass;
            if (this.AnnotatedClass.annotations) {
              return this.AnnotatedClass.annotations.find((function(annotation) {
                return annotation instanceof OriginalClass;
      Severity: Major
      Found in dist/relayer.es5.js and 1 other location - About 2 hrs to fix
      dist/relayer.es5.js on lines 1922..1931

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

      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

        ($traceurRuntime.createClass)(MapResourceSerializer, {serialize: function() {
            var $__6 = this;
            return Object.keys(this.resource).reduce((function(data, key) {
              data[key] = $__6.resourceSerializerFactory($__6.resource[key]).serialize();
              return data;
      Severity: Major
      Found in dist/relayer.es5.js and 1 other location - About 2 hrs to fix
      dist/cjs/relayer/serializers/MapResourceSerializer.js on lines 39..46

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

      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 serialize() {
            var _this = this;
      
            return Object.keys(this.resource).reduce(function (data, key) {
              data[key] = _this.resourceSerializerFactory(_this.resource[key]).serialize();
      Severity: Major
      Found in dist/cjs/relayer/serializers/MapResourceSerializer.js and 1 other location - About 2 hrs to fix
      dist/relayer.es5.js on lines 4462..4468

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

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

            trace: function(expr, val, path) {
              function addRet(elems) {
                ret = ret.concat(elems);
              }
              if (!expr.length) {
      Severity: Major
      Found in dist/relayer.es5.js - About 2 hrs to fix

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

          }, {
            key: "applyToError",
            value: function applyToError(error) {
              this.allDecorators.forEach(function (decorator) {
                decorator.errorsApply(error);
        Severity: Major
        Found in dist/cjs/relayer/ResourceDescription.js and 2 other locations - About 2 hrs to fix
        dist/cjs/relayer/ResourceDescription.js on lines 143..153
        dist/cjs/relayer/ResourceDescription.js on lines 163..173

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

        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

          }, {
            key: "applyToResource",
            value: function applyToResource(resource) {
              this.allDecorators.forEach(function (decorator) {
                decorator.resourceApply(resource);
        Severity: Major
        Found in dist/cjs/relayer/ResourceDescription.js and 2 other locations - About 2 hrs to fix
        dist/cjs/relayer/ResourceDescription.js on lines 153..163
        dist/cjs/relayer/ResourceDescription.js on lines 163..173

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

        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

          }, {
            key: "applyToEndpoint",
            value: function applyToEndpoint(endpoint) {
              this.allDecorators.forEach(function (decorator) {
                decorator.endpointApply(endpoint);
        Severity: Major
        Found in dist/cjs/relayer/ResourceDescription.js and 2 other locations - About 2 hrs to fix
        dist/cjs/relayer/ResourceDescription.js on lines 143..153
        dist/cjs/relayer/ResourceDescription.js on lines 153..163

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

        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 ListRelationshipDescription has 17 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          function ListRelationshipDescription(relationshipInitializerFactory, resourceMapperFactory, resourceSerializerFactory, inflector, singleRelationshipDescriptionFactory, ListResource, primaryResourceTransformerFactory, embeddedRelationshipTransformerFactory, individualFromListTransformerFactory, createResourceTransformerFactory, resolvedEndpointFactory, loadedDataEndpointFactory, templatedUrlFromUrlFactory, templatedUrlFactory, name, ResourceClass, initialValues) {

          Function ListRelationshipDescription has 17 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            var ListRelationshipDescription = function ListRelationshipDescription(relationshipInitializerFactory, resourceMapperFactory, resourceSerializerFactory, inflector, singleRelationshipDescriptionFactory, ListResource, primaryResourceTransformerFactory, embeddedRelationshipTransformerFactory, individualFromListTransformerFactory, createResourceTransformerFactory, resolvedEndpointFactory, loadedDataEndpointFactory, templatedUrlFromUrlFactory, templatedUrlFactory, name, ResourceClass, initialValues) {
          Severity: Major
          Found in dist/relayer.es5.js - About 2 hrs to fix

            Function RelationshipUtilities has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            var RelationshipUtilities = (function () {
              function RelationshipUtilities() {
                _classCallCheck(this, RelationshipUtilities);
              }
            
            
            Severity: Minor
            Found in dist/cjs/relayer/RelationshipUtilities.js - About 2 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

            Severity
            Category
            Status
            Source
            Language