XingFramework/Relayer

View on GitHub

Showing 591 of 591 total issues

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

var ResourceBuilder = (function () {
  function ResourceBuilder(templatedUrlFromUrlFactory, resolvedEndpointFactory, throwErrorTransformerFactory, createResourceTransformerFactory, transport, response, primaryResourceTransformer, ResourceClass, relationshipDescription) {
    _classCallCheck(this, ResourceBuilder);

    this.transport = transport;
Severity: Minor
Found in dist/cjs/relayer/ResourceBuilder.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 3 locations. Consider refactoring.
Open

Inject(
  factory(ListRelationshipInitializer),
  factory(ListResourceMapper),
  factory(ListResourceSerializer),
  Inflector,
dist/relayer.es5.js on lines 4351..4351
dist/relayer/relationshipDescriptions/ListRelationshipDescription.js on lines 164..179

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

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

Inject(
  factory(ListRelationshipInitializer),
  factory(ListResourceMapper),
  factory(ListResourceSerializer),
  Inflector,
dist/relayer.es5.js on lines 4351..4351
src/relayer/relationshipDescriptions/ListRelationshipDescription.js on lines 164..179

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

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

  Inject(factory(ListRelationshipInitializer), factory(ListResourceMapper), factory(ListResourceSerializer), Inflector, factory(SingleRelationshipDescription), value(ListResource), factory(PrimaryResourceTransformer), factory(EmbeddedRelationshipTransformer), factory(IndividualFromListTransformer), factory(CreateResourceTransformer), factory(ResolvedEndpoint), factory(LoadedDataEndpoint), factory(TemplatedUrlFromUrl), factory(TemplatedUrl))(ListRelationshipDescription);
Severity: Major
Found in dist/relayer.es5.js and 2 other locations - About 2 hrs to fix
dist/relayer/relationshipDescriptions/ListRelationshipDescription.js on lines 164..179
src/relayer/relationshipDescriptions/ListRelationshipDescription.js on lines 164..179

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

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

var UrlHelper = (function () {
  function UrlHelper(baseUrl) {
    _classCallCheck(this, UrlHelper);

    if (this.isFullUrl(baseUrl)) {
Severity: Major
Found in dist/cjs/relayer/UrlHelper.js - About 2 hrs to fix

    Function IndividualFromListTransformer has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

            for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
              args[_key - 1] = arguments[_key];
            }
      Severity: Major
      Found in dist/cjs/relayer/endpoints/Endpoint.js and 1 other location - About 1 hr to fix
      dist/cjs/relayer/injector.js on lines 250..252

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

      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

          dasherize: function(key) {
            if (!angular.isString(key)) {
              return key;
            }
            return key.replace(/[A-Z]/g, function(match, index) {
      Severity: Major
      Found in dist/relayer.es5.js and 1 other location - About 1 hr to fix
      dist/relayer.es5.js on lines 3345..3352

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

      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

            for (var _len6 = arguments.length, args = Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
              args[_key6 - 1] = arguments[_key6];
            }
      Severity: Major
      Found in dist/cjs/relayer/injector.js and 1 other location - About 1 hr to fix
      dist/cjs/relayer/endpoints/Endpoint.js on lines 52..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 74.

      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

          underscore: function(key) {
            if (!angular.isString(key)) {
              return key;
            }
            return key.replace(/[A-Z]/g, function(match, index) {
      Severity: Major
      Found in dist/relayer.es5.js and 1 other location - About 1 hr to fix
      dist/relayer.es5.js on lines 3353..3360

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

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

      var ResourceMapper = (function (_Mapper) {
        function ResourceMapper(templatedUrlFromUrlFactory, resourceBuilderFactory, primaryResourceBuilderFactory, primaryResourceTransformerFactory, transport, response, relationshipDescription) {
          var endpoint = arguments[7] === undefined ? null : arguments[7];
          var useErrors = arguments[8] === undefined ? false : arguments[8];
      
      
      Severity: Minor
      Found in dist/cjs/relayer/mappers/ResourceMapper.js - About 1 hr to fix

        Function ResourceBuilder has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Function ResourceLayer has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var ResourceLayer = (function () {
            function ResourceLayer($provide) {
              var _this = this;
          
              _classCallCheck(this, _ResourceLayer);
          Severity: Minor
          Found in dist/cjs/src/relayer.js - About 1 hr to fix

            Function ResourceLayer has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Function JsonPropertyDecorator has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

              var JsonPropertyDecorator = (function (_ResourceDecorator) {
                function JsonPropertyDecorator(loadedDataEndpointFactory, embeddedPropertyTransformerFactory, promiseEndpointFactory, name, path, value, options) {
                  _classCallCheck(this, JsonPropertyDecorator);
              
                  _get(Object.getPrototypeOf(JsonPropertyDecorator.prototype), "constructor", this).call(this, name);
              Severity: Minor
              Found in dist/cjs/relayer/decorators/JsonPropertyDecorator.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 UrlHelper has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

              var UrlHelper = (function () {
                function UrlHelper(baseUrl) {
                  _classCallCheck(this, UrlHelper);
              
                  if (this.isFullUrl(baseUrl)) {
              Severity: Minor
              Found in dist/cjs/relayer/UrlHelper.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 trace has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  trace: function trace(expr, val, path) {
                    function addRet(elems) {
                      ret = ret.concat(elems);
                    }
                    // no expr to follow? return path and value as the result of this trace branch
              Severity: Minor
              Found in dist/cjs/relayer/jsonpath.js - About 1 hr to fix

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

                    value: function load(res, rej) {
                      return this.endpointPromise().then(function (endpoint) {
                        if (endpoint._load) {
                          return endpoint._load();
                        } else {
                Severity: Major
                Found in dist/cjs/relayer/endpoints/Endpoint.js and 1 other location - About 1 hr to fix
                dist/relayer.es5.js on lines 433..441

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

                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

                    load: function(res, rej) {
                      return this.endpointPromise().then((function(endpoint) {
                        if (endpoint._load) {
                          return endpoint._load();
                        } else {
                Severity: Major
                Found in dist/relayer.es5.js and 1 other location - About 1 hr to fix
                dist/cjs/relayer/endpoints/Endpoint.js on lines 40..48

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

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

                var Injector = (function () {
                  function Injector() {
                    _classCallCheck(this, Injector);
                
                    this._instantiations = [];
                Severity: Minor
                Found in dist/cjs/relayer/injector.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language