XingFramework/Relayer

View on GitHub

Showing 591 of 591 total issues

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

gulp.task('bump:major', function(){
  gulp.src(['./bower.json', './package.json'])
  .pipe(bump({type:'major'}))
  .pipe(gulp.dest('./'));
});
Severity: Major
Found in gulpfile.js and 1 other location - About 1 hr to fix
gulpfile.js on lines 92..96

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

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

var Mapper = (function () {
  function Mapper(transport, response, relationshipDescription) {
    var useErrors = arguments[3] === undefined ? false : arguments[3];

    _classCallCheck(this, Mapper);
Severity: Minor
Found in dist/cjs/relayer/mappers/Mapper.js - About 1 hr to fix

    Function pathSet has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        value: function pathSet(jsonpath, value) {
          var path = (0, _jsonpathJs2["default"])(this._response, jsonpath, { wrap: true, resultType: "path" });
          if (path && path.length > 0) {
            path = path[0];
            if (path[0] !== "$") {
    Severity: Minor
    Found in dist/cjs/relayer/DataWrapper.js - About 1 hr to fix

      Function MetaMap has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

              Object.defineProperty(this._component.prototype, BIND_PREFIX + key, {
                enumerable: true,
                configurable: true,
                set: genericSetter(BINDING, RAW_STRING),
                get: function() {
        Severity: Major
        Found in dist/relayer.es5.js and 1 other location - About 1 hr to fix
        dist/relayer.es5.js on lines 3060..3067

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

        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: "resourceApply",
            value: function resourceApply(target) {
              target.constructor.relationships[this.name] = this.relationship;
              this.addFunction(target, this.resourceFn);
        Severity: Major
        Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js and 1 other location - About 1 hr to fix
        dist/cjs/relayer/decorators/RelatedResourceDecorator.js on lines 162..168

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

        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: "errorsApply",
            value: function errorsApply(target) {
              target.constructor.relationships[this.name] = this.relationship;
              this.addFunction(target, this.errorFn);
        Severity: Major
        Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js and 1 other location - About 1 hr to fix
        dist/cjs/relayer/decorators/RelatedResourceDecorator.js on lines 156..162

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

        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

              Object.defineProperty(this._component.prototype, STRING_PREFIX + key, {
                enumerable: true,
                configurable: true,
                set: genericSetter(RAW_STRING, BINDING),
                get: function() {
        Severity: Major
        Found in dist/relayer.es5.js and 1 other location - About 1 hr to fix
        dist/relayer.es5.js on lines 3052..3059

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

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

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

          Function pathClear has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              value: function pathClear(jsonpath) {
                var path = (0, _jsonpathJs2["default"])(this._response, jsonpath, { wrap: true, resultType: "path" });
                if (path && path.length === 0) {
                  return;
                }
          Severity: Minor
          Found in dist/cjs/relayer/DataWrapper.js - About 1 hr to fix

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

                value: function handleMessage(attrName) {
                  if (this[attrName]) {
                    this.unhandled = this.unhandled.filter(function (name) {
                      return name != attrName;
                    });
            Severity: Major
            Found in dist/cjs/relayer/APIError.js and 1 other location - About 1 hr to fix
            dist/relayer.es5.js on lines 370..377

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

            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)(APIError, {handleMessage: function(attrName) {
                  if (this[attrName]) {
                    this.unhandled = this.unhandled.filter((function(name) {
                      return name != attrName;
                    }));
            Severity: Major
            Found in dist/relayer.es5.js and 1 other location - About 1 hr to fix
            dist/cjs/relayer/APIError.js on lines 43..50

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

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

                    this._resourceFn = function (uriParams) {
                      var _this = this;
            
                      var recursiveCall = arguments[1] === undefined ? false : arguments[1];
            
            
            Severity: Minor
            Found in dist/cjs/relayer/decorators/RelatedResourceDecorator.js - About 1 hr to fix

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

                      this._resourceFn = function(uriParams) {
                        var recursiveCall = arguments[1] !== (void 0) ? arguments[1] : false;
                        var $__10 = this;
                        if (relationship.async && this.isPersisted) {
                          var endpoint;
              Severity: Minor
              Found in dist/relayer.es5.js - About 1 hr to fix

                Function setupProperty has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  ($traceurRuntime.createClass)(PropertiesBuilder, {setupProperty: function(key, properties) {
                      properties[STRING_PREFIX + key] = "@" + this._bindObj[key];
                      properties[BIND_PREFIX + key] = "=?bind" + this._bindObj[key][0].toUpperCase() + this._bindObj[key].slice(1);
                      Object.defineProperty(this._component.prototype, BIND_PREFIX + key, {
                        enumerable: true,
                Severity: Minor
                Found in dist/relayer.es5.js - About 1 hr to fix

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

                    function ManyRelationshipInitializer(singleRelationshipInitializerFactory, ResourceClass, initialValues) {
                      _classCallCheck(this, ManyRelationshipInitializer);
                  
                      _get(Object.getPrototypeOf(ManyRelationshipInitializer.prototype), "constructor", this).call(this, ResourceClass, initialValues);
                      this.singleRelationshipInitializerFactory = singleRelationshipInitializerFactory;
                  dist/cjs/relayer/initializers/MapRelationshipInitializer.js on lines 28..33

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

                  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

                    function MapRelationshipInitializer(singleRelationshipInitializerFactory, ResourceClass, initialValues) {
                      _classCallCheck(this, MapRelationshipInitializer);
                  
                      _get(Object.getPrototypeOf(MapRelationshipInitializer.prototype), "constructor", this).call(this, ResourceClass, initialValues);
                      this.singleRelationshipInitializerFactory = singleRelationshipInitializerFactory;
                  Severity: Major
                  Found in dist/cjs/relayer/initializers/MapRelationshipInitializer.js and 1 other location - About 1 hr to fix
                  dist/cjs/relayer/initializers/ManyRelationshipInitializer.js on lines 28..33

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

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

                    function MultipleRelationshipDescription(relationshipInitializerFactory, resourceMapperFactory, resourceSerializerFactory, inflector, embeddedRelationshipTransformerFactory, singleFromManyTransformerFactory, loadedDataEndpointFactory, name, ResourceClass, initialValues) {

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

                    var TemplatedUrl = (function () {
                      function TemplatedUrl(uriTemplate) {
                        var uriParams = arguments[1] === undefined ? {} : arguments[1];
                    
                        _classCallCheck(this, TemplatedUrl);
                    Severity: Minor
                    Found in dist/cjs/relayer/TemplatedUrl.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 ListResourceMapper has 10 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      function ListResourceMapper(templatedUrlFromUrlFactory, resourceBuilderFactory, primaryResourceBuilderFactory, primaryResourceTransformerFactory, manyResourceMapperFactory, temporaryTemplatedUrlFactory, transport, response, relationshipDescription, endpoint) {
                    Severity: Major
                    Found in dist/cjs/relayer/mappers/ListResourceMapper.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language