jakubrohleder/angular-jsonapi

View on GitHub
src/model/abstract-model/abstract-model.js

Summary

Maintainability
F
1 wk
Test Coverage

Function AngularJsonAPIAbstractModelWrapper has 488 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function AngularJsonAPIAbstractModelWrapper(
    AngularJsonAPIModelSourceError,
    AngularJsonAPIModelValidationError,
    AngularJsonAPIModelErrorsManager,
    AngularJsonAPIModelLinkerService,
Severity: Major
Found in src/model/abstract-model/abstract-model.js - About 2 days to fix

    File abstract-model.js has 525 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    (function() {
      'use strict';
    
      angular.module('angular-jsonapi')
      .factory('AngularJsonAPIAbstractModel', AngularJsonAPIAbstractModelWrapper);
    Severity: Major
    Found in src/model/abstract-model/abstract-model.js - About 1 day to fix

      Function __setData has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function __setData(object, validatedData) {
      
            var $jsonapi = $injector.get('$jsonapi');
            var schema = object.schema;
      
      
      Severity: Major
      Found in src/model/abstract-model/abstract-model.js - About 2 hrs to fix

        Function link has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function link(key, target) {
              var deferred = $q.defer();
              var _this = this;
              var error;
              var config = {
        Severity: Major
        Found in src/model/abstract-model/abstract-model.js - About 2 hrs to fix

          Function unlink has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function unlink(key, target) {
                var deferred = $q.defer();
                var _this = this;
                var error;
                var config = {
          Severity: Major
          Found in src/model/abstract-model/abstract-model.js - About 2 hrs to fix

            Function refresh has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function refresh(params) {
                  var $jsonapi = $injector.get('$jsonapi');
                  var deferred = $q.defer();
                  var _this = this;
                  params = params === undefined ? _this.schema.params.get : params;
            Severity: Major
            Found in src/model/abstract-model/abstract-model.js - About 2 hrs to fix

              Function unlinkAll has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function unlinkAll(key) {
                    var _this = this;
                    var deferred = $q.defer();
              
                    __incrementLoadingCounter(_this);
              Severity: Major
              Found in src/model/abstract-model/abstract-model.js - About 2 hrs to fix

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

                    function save() {
                      var _this = this;
                      var deferred = $q.defer();
                      var config = {
                        action: _this.new === true ? 'add' : 'update',
                Severity: Minor
                Found in src/model/abstract-model/abstract-model.js - About 1 hr to fix

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

                      function remove() {
                        var _this = this;
                        var deferred = $q.defer();
                  
                        var config = {
                  Severity: Minor
                  Found in src/model/abstract-model/abstract-model.js - About 1 hr to fix

                    Function AngularJsonAPIAbstractModel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function AngularJsonAPIAbstractModel(data, config, updatedAt) {
                          var _this = this;
                    
                          data.relationships = data.relationships || {};
                    
                    
                    Severity: Minor
                    Found in src/model/abstract-model/abstract-model.js - About 1 hr to fix

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

                            function removeReflectionLink(reflectionKey, target) {
                              var reflectionSchema = target.schema.relationships[reflectionKey];
                              var config = {
                                action: 'unlinkReflection',
                                object: target,
                      Severity: Minor
                      Found in src/model/abstract-model/abstract-model.js - About 1 hr to fix

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

                            AngularJsonAPIModelSourceError,
                            AngularJsonAPIModelValidationError,
                            AngularJsonAPIModelErrorsManager,
                            AngularJsonAPIModelLinkerService,
                            AngularJsonAPIModelForm,
                        Severity: Major
                        Found in src/model/abstract-model/abstract-model.js - About 1 hr to fix

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

                                function setRelationships(schema, key) {
                                  var relationshipData = validatedData.relationships[key];
                          
                                  if (relationshipData === undefined) {
                                    if (object.data.relationships[key] === undefined) {
                          Severity: Minor
                          Found in src/model/abstract-model/abstract-model.js - About 1 hr to fix

                            Function resolve has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  function resolve(response) {
                                    $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:link', 'resolved', _this, response);
                            
                                    var targets = AngularJsonAPIModelLinkerService.link(_this, key, target);
                            
                            
                            Severity: Minor
                            Found in src/model/abstract-model/abstract-model.js - About 1 hr to fix

                              Function resolve has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    function resolve(response) {
                                      $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:unlink', 'resolved', _this, response);
                              
                                      var targets = AngularJsonAPIModelLinkerService.link(_this, key, target);
                              
                              
                              Severity: Minor
                              Found in src/model/abstract-model/abstract-model.js - About 1 hr to fix

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

                                      if (target === undefined) {
                                        error = AngularJsonAPIModelSourceError.create('Can\'t link undefined', null, 0, 'link');
                                        _this.errors.synchronization.add('link', error);
                                        deferred.reject(error);
                                      } else if (_this.new === true) {
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 1 other location - About 6 hrs to fix
                                src/model/abstract-model/abstract-model.js on lines 516..530

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

                                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 (target === undefined) {
                                        error = AngularJsonAPIModelSourceError.create('Can\'t unlink undefined', null, 0, 'unlink');
                                        _this.errors.synchronization.add('unlink', error);
                                        deferred.reject(_this);
                                      } else if (_this.new === true) {
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 1 other location - About 6 hrs to fix
                                src/model/abstract-model/abstract-model.js on lines 429..443

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

                                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

                                        function resolveIncluded(includedResponse) {
                                          angular.forEach(includedResponse, function(operation, key) {
                                            if (operation.success === true) {
                                              $rootScope.$emit('angularJsonAPI:' + results.included[key].data.type + ':object:include', 'resolved', results.included[key], operation);
                                              operation.value.finish();
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 1 other location - About 4 hrs to fix
                                src/collection/collection.factory.js on lines 170..180

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

                                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 reject(response) {
                                        $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:link', 'rejected', _this, response);
                                
                                        deferred.reject(response.errors);
                                        response.finish();
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 1 other location - About 3 hrs to fix
                                src/model/abstract-model/abstract-model.js on lines 570..577

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

                                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 reject(response) {
                                        $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:unlink', 'rejected', _this, response);
                                
                                        deferred.reject(response.errors);
                                        response.finish();
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 1 other location - About 3 hrs to fix
                                src/model/abstract-model/abstract-model.js on lines 483..490

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

                                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

                                      function reject(response) {
                                        $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:save', 'rejected', _this, response);
                                
                                        response.finish();
                                        _this.errors.synchronization.concat(response.errors);
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 2 other locations - About 2 hrs to fix
                                src/model/abstract-model/abstract-model.js on lines 241..247
                                src/model/abstract-model/abstract-model.js on lines 395..401

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

                                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

                                      function reject(response) {
                                        $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:refresh', 'rejected', _this, response);
                                
                                        response.finish();
                                        _this.errors.synchronization.concat(response.errors);
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 2 other locations - About 2 hrs to fix
                                src/model/abstract-model/abstract-model.js on lines 151..157
                                src/model/abstract-model/abstract-model.js on lines 395..401

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

                                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

                                        function reject(response) {
                                          $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:unlinkReflection', 'rejected', _this, response);
                                
                                          response.finish();
                                          _this.errors.synchronization.concat(response.errors);
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 2 other locations - About 2 hrs to fix
                                src/model/abstract-model/abstract-model.js on lines 151..157
                                src/model/abstract-model/abstract-model.js on lines 241..247

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

                                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 synchronize(result) {
                                          __incrementLoadingCounter(target);
                                
                                          return target.synchronize({
                                            action: 'unlinkReflection',
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 1 other location - About 2 hrs to fix
                                src/model/abstract-model/abstract-model.js on lines 460..469

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

                                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 synchronize(result) {
                                          __incrementLoadingCounter(target);
                                
                                          return target.synchronize({
                                            action: 'linkReflection',
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 1 other location - About 2 hrs to fix
                                src/model/abstract-model/abstract-model.js on lines 547..556

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

                                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

                                    function hasErrors() {
                                      var _this = this;
                                      var answer = false;
                                
                                      angular.forEach(_this.errors, function(error) {
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 1 other location - About 1 hr to fix
                                src/collection/collection.factory.js on lines 98..107

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

                                  function __decrementLoadingCounter(object) {
                                    object = object === undefined ? this : object;
                                    object.loadingCount -= 1;
                                    object.loading = object.loadingCount > 0;
                                  }
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 2 other locations - About 1 hr to fix
                                src/collection/collection.factory.js on lines 206..210
                                src/model/abstract-model/abstract-model.js on lines 752..756

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

                                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

                                  function __decrementSavingCounter(object) {
                                    object = object === undefined ? this : object;
                                    object.savingCount -= 1;
                                    object.saving = object.savingCount > 0;
                                  }
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 2 other locations - About 1 hr to fix
                                src/collection/collection.factory.js on lines 206..210
                                src/model/abstract-model/abstract-model.js on lines 740..744

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

                                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

                                        function synchronizeIncluded(object) {
                                          __incrementLoadingCounter(object);
                                
                                          return object.synchronize({
                                            action: 'include',
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 1 other location - About 1 hr to fix
                                src/collection/collection.factory.js on lines 161..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 55.

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

                                      function notify(response) {
                                        $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:refresh', 'notify', _this, response);
                                
                                        deferred.notify(response);
                                      }
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 4 other locations - About 45 mins to fix
                                src/model/abstract-model/abstract-model.js on lines 159..163
                                src/model/abstract-model/abstract-model.js on lines 327..331
                                src/model/abstract-model/abstract-model.js on lines 492..496
                                src/model/abstract-model/abstract-model.js on lines 579..583

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

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

                                      function notify(response) {
                                        $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:link', 'notify', _this, response);
                                
                                        deferred.notify(response);
                                      }
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 4 other locations - About 45 mins to fix
                                src/model/abstract-model/abstract-model.js on lines 159..163
                                src/model/abstract-model/abstract-model.js on lines 249..253
                                src/model/abstract-model/abstract-model.js on lines 327..331
                                src/model/abstract-model/abstract-model.js on lines 579..583

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

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

                                      function notify(response) {
                                        $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:remove', 'notify', _this, response);
                                
                                        deferred.notify(response);
                                      }
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 4 other locations - About 45 mins to fix
                                src/model/abstract-model/abstract-model.js on lines 159..163
                                src/model/abstract-model/abstract-model.js on lines 249..253
                                src/model/abstract-model/abstract-model.js on lines 492..496
                                src/model/abstract-model/abstract-model.js on lines 579..583

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

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

                                      function notify(response) {
                                        $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:save', 'notify', _this, response);
                                
                                        deferred.notify(response);
                                      }
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 4 other locations - About 45 mins to fix
                                src/model/abstract-model/abstract-model.js on lines 249..253
                                src/model/abstract-model/abstract-model.js on lines 327..331
                                src/model/abstract-model/abstract-model.js on lines 492..496
                                src/model/abstract-model/abstract-model.js on lines 579..583

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

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

                                      function notify(response) {
                                        $rootScope.$emit('angularJsonAPI:' + _this.data.type + ':object:unlink', 'notify', _this, response);
                                
                                        deferred.notify(response);
                                      }
                                Severity: Major
                                Found in src/model/abstract-model/abstract-model.js and 4 other locations - About 45 mins to fix
                                src/model/abstract-model/abstract-model.js on lines 159..163
                                src/model/abstract-model/abstract-model.js on lines 249..253
                                src/model/abstract-model/abstract-model.js on lines 327..331
                                src/model/abstract-model/abstract-model.js on lines 492..496

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

                                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

                                      angular.forEach(data.relationships, function(value, key) {
                                        if (value.data !== undefined) {
                                          relationships[key] = value;
                                        }
                                      });
                                Severity: Minor
                                Found in src/model/abstract-model/abstract-model.js and 1 other location - About 40 mins to fix
                                src/model/model-form/model-form.factory.js on lines 56..60

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

                                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 __incrementSavingCounter(object) {
                                    object = object === undefined ? this : object;
                                    object.savingCount += 1;
                                    object.saving = true;
                                  }
                                Severity: Minor
                                Found in src/model/abstract-model/abstract-model.js and 1 other location - About 40 mins to fix
                                src/collection/collection.factory.js on lines 200..204

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

                                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

                                There are no issues that match your filters.

                                Category
                                Status