XingFramework/Relayer

View on GitHub

Showing 201 of 591 total issues

Function addMethods has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  addMethods(target, resource, name) {
    target.get = function() {
      return resource.relationships[name];
    };
    target.present = function() {
Severity: Minor
Found in dist/relayer/RelationshipUtilities.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 addMethods has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  addMethods(target, resource, name) {
    target.get = function() {
      return resource.relationships[name];
    };
    target.present = function() {
Severity: Minor
Found in src/relayer/RelationshipUtilities.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 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

  var MultipleRelationshipDescription = function MultipleRelationshipDescription(relationshipInitializerFactory, resourceMapperFactory, resourceSerializerFactory, inflector, embeddedRelationshipTransformerFactory, singleFromManyTransformerFactory, loadedDataEndpointFactory, name, ResourceClass, initialValues) {
Severity: Major
Found in dist/relayer.es5.js - About 1 hr to fix

    Function ListResourceMapper has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      var ListResourceMapper = function ListResourceMapper(templatedUrlFromUrlFactory, resourceBuilderFactory, primaryResourceBuilderFactory, primaryResourceTransformerFactory, manyResourceMapperFactory, temporaryTemplatedUrlFactory, transport, response, relationshipDescription, endpoint) {
    Severity: Major
    Found in dist/relayer.es5.js - About 1 hr to fix

      Function RelationshipUtilities has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function _resourceFn has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              this._resourceFn = function(uriParams, recursiveCall = false) {
                if (relationship.async && this.isPersisted) {
                  var endpoint;
                  if (!this.relationships[name]) {
                    if (recursiveCall === false) {
        Severity: Minor
        Found in dist/relayer/decorators/RelatedResourceDecorator.js - About 1 hr to fix

          Function _resourceFn has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                this._resourceFn = function(uriParams, recursiveCall = false) {
                  if (relationship.async && this.isPersisted) {
                    var endpoint;
                    if (!this.relationships[name]) {
                      if (recursiveCall === false) {
          Severity: Minor
          Found in src/relayer/decorators/RelatedResourceDecorator.js - About 1 hr to fix

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

            var LoadedDataEndpoint = (function (_ResolvedEndpoint) {
              function LoadedDataEndpoint(Promise, resolvedEndpoint, resource) {
                var resourceTransformers = arguments[3] === undefined ? [] : arguments[3];
                var createResourceTransformers = arguments[4] === undefined ? [] : arguments[4];
            
            
            Severity: Minor
            Found in dist/cjs/relayer/endpoints/LoadedDataEndpoint.js - About 1 hr to fix

              Function ResourceBuilder has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                function ResourceBuilder(templatedUrlFromUrlFactory, resolvedEndpointFactory, throwErrorTransformerFactory, createResourceTransformerFactory, transport, response, primaryResourceTransformer, ResourceClass, relationshipDescription) {
              Severity: Major
              Found in dist/cjs/relayer/ResourceBuilder.js - About 1 hr to fix

                Function ResourceBuilder has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  var ResourceBuilder = function ResourceBuilder(templatedUrlFromUrlFactory, resolvedEndpointFactory, throwErrorTransformerFactory, createResourceTransformerFactory, transport, response, primaryResourceTransformer, ResourceClass, relationshipDescription) {
                Severity: Major
                Found in dist/relayer.es5.js - About 1 hr to fix

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

                      linkedEndpoint: function(parent, uriParams) {
                        var transport = parent.self().transport;
                        var url,
                            templatedUrl,
                            primaryResourceTransformer,
                  Severity: Minor
                  Found in dist/relayer.es5.js - About 1 hr to fix

                    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

                          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
                              Severity
                              Category
                              Status
                              Source
                              Language